From 275b781f4827e6ba55ada5c7de75cc9fb490cb64 Mon Sep 17 00:00:00 2001 From: SongZhang <2064194730@qq.com> Date: Fri, 26 Jul 2024 18:05:11 +0800 Subject: [PATCH 01/21] =?UTF-8?q?1.=E9=BB=98=E8=AE=A4=E4=B8=8A=E4=B8=8B?= =?UTF-8?q?=E6=9E=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/cn/ysk/cashier/pojo/product/TbProductSku.java | 2 +- .../cashier/service/impl/productimpl/TbProductServiceImpl.java | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/eladmin-system/src/main/java/cn/ysk/cashier/pojo/product/TbProductSku.java b/eladmin-system/src/main/java/cn/ysk/cashier/pojo/product/TbProductSku.java index b19fe427..a108fafc 100644 --- a/eladmin-system/src/main/java/cn/ysk/cashier/pojo/product/TbProductSku.java +++ b/eladmin-system/src/main/java/cn/ysk/cashier/pojo/product/TbProductSku.java @@ -129,7 +129,7 @@ public class TbProductSku implements Serializable { @Column(name = "`is_grounding`") @ApiModelProperty(value = "是否上架") - private Integer isGrounding = 0; + private Integer isGrounding = 1; public void setIsDel(Integer isDel) { if(isDel!=null){ diff --git a/eladmin-system/src/main/java/cn/ysk/cashier/service/impl/productimpl/TbProductServiceImpl.java b/eladmin-system/src/main/java/cn/ysk/cashier/service/impl/productimpl/TbProductServiceImpl.java index 489982b2..566b0e5b 100644 --- a/eladmin-system/src/main/java/cn/ysk/cashier/service/impl/productimpl/TbProductServiceImpl.java +++ b/eladmin-system/src/main/java/cn/ysk/cashier/service/impl/productimpl/TbProductServiceImpl.java @@ -387,6 +387,7 @@ public class TbProductServiceImpl implements TbProductService { sku.setShopId(save.getShopId()); sku.setCreatedAt(Instant.now().toEpochMilli()); sku.setUpdatedAt(Instant.now().toEpochMilli()); + sku.setIsGrounding(1); skuList.add(sku); } List tbProductSkus = tbProductSkuRepository.saveAll(skuList); From 6521464900c2abd5999ed7f2f4d03ed693df3630 Mon Sep 17 00:00:00 2001 From: SongZhang <2064194730@qq.com> Date: Fri, 26 Jul 2024 18:07:13 +0800 Subject: [PATCH 02/21] =?UTF-8?q?1.=E8=A7=84=E6=A0=BC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/cn/ysk/cashier/dto/product/StockCountDTO.java | 1 + .../cn/ysk/cashier/repository/order/StockCountRepository.java | 2 +- .../impl/productimpl/TbProductStockDetailServiceImpl.java | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/eladmin-system/src/main/java/cn/ysk/cashier/dto/product/StockCountDTO.java b/eladmin-system/src/main/java/cn/ysk/cashier/dto/product/StockCountDTO.java index c342314d..c27b489d 100644 --- a/eladmin-system/src/main/java/cn/ysk/cashier/dto/product/StockCountDTO.java +++ b/eladmin-system/src/main/java/cn/ysk/cashier/dto/product/StockCountDTO.java @@ -16,4 +16,5 @@ public class StockCountDTO { private String unitName; private Integer stockCount; private Integer stockNumber; + private String specSnap; } diff --git a/eladmin-system/src/main/java/cn/ysk/cashier/repository/order/StockCountRepository.java b/eladmin-system/src/main/java/cn/ysk/cashier/repository/order/StockCountRepository.java index 3db7a6d9..929bf2e0 100644 --- a/eladmin-system/src/main/java/cn/ysk/cashier/repository/order/StockCountRepository.java +++ b/eladmin-system/src/main/java/cn/ysk/cashier/repository/order/StockCountRepository.java @@ -45,7 +45,7 @@ public interface StockCountRepository extends JpaRepository Date: Mon, 29 Jul 2024 17:23:21 +0800 Subject: [PATCH 03/21] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E5=87=BA=E5=85=A5?= =?UTF-8?q?=E5=BA=93=E5=A4=87=E6=B3=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/cn/ysk/cashier/cons/domain/SuppFlow.java | 2 ++ .../cn/ysk/cashier/cons/service/impl/TbConsInfoServiceImpl.java | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/eladmin-system/src/main/java/cn/ysk/cashier/cons/domain/SuppFlow.java b/eladmin-system/src/main/java/cn/ysk/cashier/cons/domain/SuppFlow.java index e7f333fb..30993bbf 100644 --- a/eladmin-system/src/main/java/cn/ysk/cashier/cons/domain/SuppFlow.java +++ b/eladmin-system/src/main/java/cn/ysk/cashier/cons/domain/SuppFlow.java @@ -25,6 +25,8 @@ public class SuppFlow implements Serializable { private List list; + private String remark; + @Data diff --git a/eladmin-system/src/main/java/cn/ysk/cashier/cons/service/impl/TbConsInfoServiceImpl.java b/eladmin-system/src/main/java/cn/ysk/cashier/cons/service/impl/TbConsInfoServiceImpl.java index 8bd53ce1..8e22c2df 100644 --- a/eladmin-system/src/main/java/cn/ysk/cashier/cons/service/impl/TbConsInfoServiceImpl.java +++ b/eladmin-system/src/main/java/cn/ysk/cashier/cons/service/impl/TbConsInfoServiceImpl.java @@ -198,7 +198,7 @@ public class TbConsInfoServiceImpl implements TbConsInfoService { operatorSnapMap.put("account", tbShopInfo.getAccount()); stockOperate.setOperatorSnap(JSON.toJSONString(operatorSnapMap)); - stockOperate.setRemark(""); + stockOperate.setRemark(resources.getRemark()); stockOperate.setStockTime(System.currentTimeMillis()); stockOperate.setCreatedAt(System.currentTimeMillis()); stockOperate.setUpdatedAt(System.currentTimeMillis()); From 0aa0bcda771f698fa6ebf6db3cdc4dfa9cd4df53 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=89=9B=E5=8F=89=E9=97=AA=E9=97=AA?= <18322780655@163.com> Date: Mon, 29 Jul 2024 17:38:11 +0800 Subject: [PATCH 04/21] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E5=87=BA=E5=85=A5?= =?UTF-8?q?=E5=BA=93=E5=A4=87=E6=B3=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/cn/ysk/cashier/cons/rest/TbConsInfoController.java | 1 + .../cn/ysk/cashier/cons/service/impl/TbConsInfoServiceImpl.java | 1 + 2 files changed, 2 insertions(+) diff --git a/eladmin-system/src/main/java/cn/ysk/cashier/cons/rest/TbConsInfoController.java b/eladmin-system/src/main/java/cn/ysk/cashier/cons/rest/TbConsInfoController.java index 4c7a5062..01fa4199 100644 --- a/eladmin-system/src/main/java/cn/ysk/cashier/cons/rest/TbConsInfoController.java +++ b/eladmin-system/src/main/java/cn/ysk/cashier/cons/rest/TbConsInfoController.java @@ -75,6 +75,7 @@ public class TbConsInfoController { @Log("耗材出入库") @ApiOperation("耗材出入库") public ResponseEntity stockInOut(@Validated @RequestBody SuppFlow resources) throws Exception { + tbConsInfoService.stockInOut(resources); return new ResponseEntity<>(HttpStatus.NO_CONTENT); } diff --git a/eladmin-system/src/main/java/cn/ysk/cashier/cons/service/impl/TbConsInfoServiceImpl.java b/eladmin-system/src/main/java/cn/ysk/cashier/cons/service/impl/TbConsInfoServiceImpl.java index 8e22c2df..acdb3836 100644 --- a/eladmin-system/src/main/java/cn/ysk/cashier/cons/service/impl/TbConsInfoServiceImpl.java +++ b/eladmin-system/src/main/java/cn/ysk/cashier/cons/service/impl/TbConsInfoServiceImpl.java @@ -175,6 +175,7 @@ public class TbConsInfoServiceImpl implements TbConsInfoService { @Override @Transactional(rollbackFor = Exception.class) public void stockInOut(SuppFlow resources) throws Exception { + log.info("resources:{}",JSON.toJSONString(resources)); if (Objects.isNull(resources)) { throw new Exception("参数错误"); } From 820237d63e4e3390b668a46df5bd1f28821cc140 Mon Sep 17 00:00:00 2001 From: GYJ <1157756119@qq.com> Date: Tue, 30 Jul 2024 11:29:31 +0800 Subject: [PATCH 05/21] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E5=95=86=E5=93=81=20?= =?UTF-8?q?=E5=A1=AB=E5=85=85=E9=A2=84=E8=AD=A6=E5=80=BC=E5=AD=97=E6=AE=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../repository/product/TbProductRepository.java | 4 ++++ .../impl/productimpl/TbProductServiceImpl.java | 12 ++++++++++++ 2 files changed, 16 insertions(+) diff --git a/eladmin-system/src/main/java/cn/ysk/cashier/repository/product/TbProductRepository.java b/eladmin-system/src/main/java/cn/ysk/cashier/repository/product/TbProductRepository.java index aa50c29b..01e2ae64 100644 --- a/eladmin-system/src/main/java/cn/ysk/cashier/repository/product/TbProductRepository.java +++ b/eladmin-system/src/main/java/cn/ysk/cashier/repository/product/TbProductRepository.java @@ -58,4 +58,8 @@ public interface TbProductRepository extends JpaRepository, @Query("select product from TbProduct product where product.id=:id and product.shopId=:shopId") TbProduct selectByShopIdAndId(Integer id, String shopId); + + @Query("select product from TbProduct product where product.shopId=:shopId") + List selectByShopId(String shopId); + } diff --git a/eladmin-system/src/main/java/cn/ysk/cashier/service/impl/productimpl/TbProductServiceImpl.java b/eladmin-system/src/main/java/cn/ysk/cashier/service/impl/productimpl/TbProductServiceImpl.java index 566b0e5b..9e181f3d 100644 --- a/eladmin-system/src/main/java/cn/ysk/cashier/service/impl/productimpl/TbProductServiceImpl.java +++ b/eladmin-system/src/main/java/cn/ysk/cashier/service/impl/productimpl/TbProductServiceImpl.java @@ -373,6 +373,7 @@ public class TbProductServiceImpl implements TbProductService { } } } + TbProduct save = tbProductRepository.save(product); if (save.getId() == null) { throw new BadRequestException("添加商品失败"); @@ -381,6 +382,16 @@ public class TbProductServiceImpl implements TbProductService { tbProductRepository.save(save); //sku if (resources.getSkuList() != null) { + Integer warnLine = 0; + List productList = tbProductRepository.selectByShopId(resources.getShopId()); + if (!productList.isEmpty()) { + TbProduct p = productList.get(0); + List productSkus = tbProductSkuRepository.searchSku(p.getId().toString()); + if (!productSkus.isEmpty()) { + warnLine = productSkus.get(0).getWarnLine(); + } + } + List skuList = new ArrayList<>(); for (TbProductSku sku : resources.getSkuList()) { sku.setProductId(String.valueOf(save.getId())); @@ -388,6 +399,7 @@ public class TbProductServiceImpl implements TbProductService { sku.setCreatedAt(Instant.now().toEpochMilli()); sku.setUpdatedAt(Instant.now().toEpochMilli()); sku.setIsGrounding(1); + sku.setWarnLine(warnLine); skuList.add(sku); } List tbProductSkus = tbProductSkuRepository.saveAll(skuList); From f8e4834e6956918fd5abfa21a60a212415dca643 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=89=9B=E5=8F=89=E9=97=AA=E9=97=AA?= <18322780655@163.com> Date: Tue, 30 Jul 2024 14:39:00 +0800 Subject: [PATCH 06/21] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=96=B9=E6=B3=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../cn/ysk/cashier/cons/rest/TbHandoverController.java | 9 +-------- .../cons/service/dto/TbHandoverQueryCriteria.java | 4 ++-- 2 files changed, 3 insertions(+), 10 deletions(-) diff --git a/eladmin-system/src/main/java/cn/ysk/cashier/cons/rest/TbHandoverController.java b/eladmin-system/src/main/java/cn/ysk/cashier/cons/rest/TbHandoverController.java index baafaa7c..5db35100 100644 --- a/eladmin-system/src/main/java/cn/ysk/cashier/cons/rest/TbHandoverController.java +++ b/eladmin-system/src/main/java/cn/ysk/cashier/cons/rest/TbHandoverController.java @@ -33,20 +33,13 @@ public class TbHandoverController { tbHandoverService.download(tbHandoverService.queryAll(criteria), response); } - @GetMapping + @PostMapping @Log("查询查询交班记录") @ApiOperation("查询查询交班记录") public ResponseEntity queryTbHandover(TbHandoverQueryCriteria criteria, Pageable pageable){ return new ResponseEntity<>(tbHandoverService.queryAll(criteria,pageable),HttpStatus.OK); } - @PostMapping - @Log("新增查询交班记录") - @ApiOperation("新增查询交班记录") - public ResponseEntity createTbHandover(@Validated @RequestBody TbHandover resources){ - return new ResponseEntity<>(tbHandoverService.create(resources),HttpStatus.CREATED); - } - @PutMapping @Log("修改查询交班记录") @ApiOperation("修改查询交班记录") diff --git a/eladmin-system/src/main/java/cn/ysk/cashier/cons/service/dto/TbHandoverQueryCriteria.java b/eladmin-system/src/main/java/cn/ysk/cashier/cons/service/dto/TbHandoverQueryCriteria.java index aae144bb..d177bc98 100644 --- a/eladmin-system/src/main/java/cn/ysk/cashier/cons/service/dto/TbHandoverQueryCriteria.java +++ b/eladmin-system/src/main/java/cn/ysk/cashier/cons/service/dto/TbHandoverQueryCriteria.java @@ -12,8 +12,8 @@ import cn.ysk.cashier.annotation.Query; public class TbHandoverQueryCriteria{ /** 精确 */ - @Query - private String tradeDay; + @Query(type = Query.Type.BETWEEN) + private List tradeDay; /** 精确 */ @Query From 1d0e81a55a5e978692f90f5e218ae7d2161a07eb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=89=9B=E5=8F=89=E9=97=AA=E9=97=AA?= <18322780655@163.com> Date: Tue, 30 Jul 2024 14:51:36 +0800 Subject: [PATCH 07/21] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=96=B9=E6=B3=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ysk/cashier/config/security/config/SpringSecurityConfig.java | 1 + 1 file changed, 1 insertion(+) diff --git a/eladmin-system/src/main/java/cn/ysk/cashier/config/security/config/SpringSecurityConfig.java b/eladmin-system/src/main/java/cn/ysk/cashier/config/security/config/SpringSecurityConfig.java index 513949f0..7d9da724 100644 --- a/eladmin-system/src/main/java/cn/ysk/cashier/config/security/config/SpringSecurityConfig.java +++ b/eladmin-system/src/main/java/cn/ysk/cashier/config/security/config/SpringSecurityConfig.java @@ -137,6 +137,7 @@ public class SpringSecurityConfig extends WebSecurityConfigurerAdapter { // 所有类型的接口都放行 .antMatchers(anonymousUrls.get(RequestMethodEnum.ALL.getType()).toArray(new String[0])).permitAll() .antMatchers("/auth/appletsLogin").permitAll() + .antMatchers("/api/tbHandover").permitAll() // 所有请求都需要认证 .anyRequest().authenticated() .and().apply(securityConfigurerAdapter()); From 292d2325a30309ea01841c9c93ca8e17bec7b3d4 Mon Sep 17 00:00:00 2001 From: wangw <1594593906@qq.com> Date: Tue, 30 Jul 2024 14:53:14 +0800 Subject: [PATCH 08/21] =?UTF-8?q?=E6=8E=A5=E5=8F=A3=E6=9F=A5=E8=AF=A2=20?= =?UTF-8?q?=E4=B8=8D=E5=81=9A=E6=97=A5=E5=BF=97=E8=AE=B0=E5=BD=95=20?= =?UTF-8?q?=E6=97=A5=E5=BF=97=E8=AE=B0=E5=BD=95=E4=B8=BA=20=E5=91=98?= =?UTF-8?q?=E5=B7=A5=E5=90=8D=E7=A7=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/cn/ysk/cashier/aspect/LogAspect.java | 12 ++++++++---- .../ysk/cashier/cons/rest/TbConCheckController.java | 1 - .../ysk/cashier/cons/rest/TbConUnitController.java | 1 - .../ysk/cashier/cons/rest/TbConsInfoController.java | 1 - .../cashier/cons/rest/TbConsInfoFlowController.java | 1 - .../cashier/cons/rest/TbConsSuppFlowController.java | 1 - .../ysk/cashier/cons/rest/TbConsTypeController.java | 1 - .../ysk/cashier/cons/rest/TbProskuConController.java | 1 - .../cashier/cons/rest/ViewConInfoFlowController.java | 1 - .../ysk/cashier/cons/rest/ViewConSkuController.java | 1 - .../cons/rest/ViewConsSuppFlowController.java | 1 - .../cons/rest/ViewProductSkuShopController.java | 1 - .../controller/shop/TbCouponCategoryController.java | 1 - .../template/generator/admin/Controller.ftl | 1 - 14 files changed, 8 insertions(+), 17 deletions(-) diff --git a/eladmin-logging/src/main/java/cn/ysk/cashier/aspect/LogAspect.java b/eladmin-logging/src/main/java/cn/ysk/cashier/aspect/LogAspect.java index 5d0446e7..5c7bee77 100644 --- a/eladmin-logging/src/main/java/cn/ysk/cashier/aspect/LogAspect.java +++ b/eladmin-logging/src/main/java/cn/ysk/cashier/aspect/LogAspect.java @@ -78,12 +78,14 @@ public class LogAspect { Object o = redisUtils.get("online-token-"+getToken(request)); JSONObject jsonObject = null; Integer shopId = null; - if (o!= null){ + String nickName = ""; + if (o != null) { String jsonString = JSON.toJSONString(o); jsonObject = JSONObject.parseObject(jsonString); - shopId = (Integer)jsonObject.get("shopId"); + shopId = (Integer) jsonObject.get("shopId"); + nickName = jsonObject.get("nickName") == null ? "" : jsonObject.get("nickName").toString(); } - logService.save(getUsername(), StringUtils.getBrowser(request), StringUtils.getIp(request),joinPoint, log, shopId); + logService.save(nickName+":"+getUsername(), StringUtils.getBrowser(request), StringUtils.getIp(request),joinPoint, log, shopId); return result; } @@ -107,9 +109,10 @@ public class LogAspect { jsonObject = JSONObject.parseObject(jsonString); shopId = (Integer)jsonObject.get("shopId"); } - logService.save(getUsername(), StringUtils.getBrowser(request), StringUtils.getIp(request), (ProceedingJoinPoint)joinPoint, log, shopId); + logService.save(getUsername()+getUsername(), StringUtils.getBrowser(request), StringUtils.getIp(request), (ProceedingJoinPoint)joinPoint, log, shopId); } + public String getUsername() { try { return SecurityUtils.getCurrentUsername(); @@ -117,6 +120,7 @@ public class LogAspect { return ""; } } + public String getToken(HttpServletRequest request) { final String requestHeader = request.getHeader("Authorization"); if (requestHeader != null && requestHeader.startsWith("Bearer")) { diff --git a/eladmin-system/src/main/java/cn/ysk/cashier/cons/rest/TbConCheckController.java b/eladmin-system/src/main/java/cn/ysk/cashier/cons/rest/TbConCheckController.java index 106bc4a4..3c48f2db 100644 --- a/eladmin-system/src/main/java/cn/ysk/cashier/cons/rest/TbConCheckController.java +++ b/eladmin-system/src/main/java/cn/ysk/cashier/cons/rest/TbConCheckController.java @@ -34,7 +34,6 @@ public class TbConCheckController { } @GetMapping - @Log("查询盘点耗材") @ApiOperation("查询盘点耗材") public ResponseEntity queryTbConCheck(TbConCheckQueryCriteria criteria, Pageable pageable){ return new ResponseEntity<>(tbConCheckService.queryAll(criteria,pageable),HttpStatus.OK); diff --git a/eladmin-system/src/main/java/cn/ysk/cashier/cons/rest/TbConUnitController.java b/eladmin-system/src/main/java/cn/ysk/cashier/cons/rest/TbConUnitController.java index 4fef292f..1b572f8c 100644 --- a/eladmin-system/src/main/java/cn/ysk/cashier/cons/rest/TbConUnitController.java +++ b/eladmin-system/src/main/java/cn/ysk/cashier/cons/rest/TbConUnitController.java @@ -37,7 +37,6 @@ public class TbConUnitController { } @GetMapping - @Log("查询耗材单位添加") @ApiOperation("查询耗材单位添加") public ResponseEntity queryTbConUnit(TbConUnitQueryCriteria criteria, Pageable pageable){ return new ResponseEntity<>(tbConUnitService.queryAll(criteria,pageable),HttpStatus.OK); diff --git a/eladmin-system/src/main/java/cn/ysk/cashier/cons/rest/TbConsInfoController.java b/eladmin-system/src/main/java/cn/ysk/cashier/cons/rest/TbConsInfoController.java index 01fa4199..7c50ba9a 100644 --- a/eladmin-system/src/main/java/cn/ysk/cashier/cons/rest/TbConsInfoController.java +++ b/eladmin-system/src/main/java/cn/ysk/cashier/cons/rest/TbConsInfoController.java @@ -41,7 +41,6 @@ public class TbConsInfoController { } @GetMapping - @Log("查询耗材信息") @ApiOperation("查询耗材信息") public ResponseEntity queryTbConsInfo(TbConsInfoQueryCriteria criteria, Pageable pageable){ pageable = PageRequest.of(pageable.getPageNumber(), pageable.getPageSize(), Sort.by("createTime").descending()); diff --git a/eladmin-system/src/main/java/cn/ysk/cashier/cons/rest/TbConsInfoFlowController.java b/eladmin-system/src/main/java/cn/ysk/cashier/cons/rest/TbConsInfoFlowController.java index 7be90f0f..64acbc06 100644 --- a/eladmin-system/src/main/java/cn/ysk/cashier/cons/rest/TbConsInfoFlowController.java +++ b/eladmin-system/src/main/java/cn/ysk/cashier/cons/rest/TbConsInfoFlowController.java @@ -34,7 +34,6 @@ public class TbConsInfoFlowController { } @GetMapping - @Log("查询耗材流水") @ApiOperation("查询耗材流水") public ResponseEntity queryTbConsInfoFlow(TbConsInfoFlowQueryCriteria criteria, Pageable pageable){ return new ResponseEntity<>(tbConsInfoFlowService.queryAll(criteria,pageable),HttpStatus.OK); diff --git a/eladmin-system/src/main/java/cn/ysk/cashier/cons/rest/TbConsSuppFlowController.java b/eladmin-system/src/main/java/cn/ysk/cashier/cons/rest/TbConsSuppFlowController.java index c644ce8b..0403ad4b 100644 --- a/eladmin-system/src/main/java/cn/ysk/cashier/cons/rest/TbConsSuppFlowController.java +++ b/eladmin-system/src/main/java/cn/ysk/cashier/cons/rest/TbConsSuppFlowController.java @@ -34,7 +34,6 @@ public class TbConsSuppFlowController { } @GetMapping - @Log("查询入库记录") @ApiOperation("查询入库记录") public ResponseEntity queryTbConsSuppFlow(TbConsSuppFlowQueryCriteria criteria, Pageable pageable){ return new ResponseEntity<>(tbConsSuppFlowService.queryAll(criteria,pageable),HttpStatus.OK); diff --git a/eladmin-system/src/main/java/cn/ysk/cashier/cons/rest/TbConsTypeController.java b/eladmin-system/src/main/java/cn/ysk/cashier/cons/rest/TbConsTypeController.java index 425593e5..5b28b4b1 100644 --- a/eladmin-system/src/main/java/cn/ysk/cashier/cons/rest/TbConsTypeController.java +++ b/eladmin-system/src/main/java/cn/ysk/cashier/cons/rest/TbConsTypeController.java @@ -35,7 +35,6 @@ public class TbConsTypeController { } @GetMapping - @Log("查询耗材类型") @ApiOperation("查询耗材类型") public ResponseEntity queryTbConsType(TbConsTypeQueryCriteria criteria, Pageable pageable){ return new ResponseEntity<>(tbConsTypeService.queryAll(criteria,pageable),HttpStatus.OK); diff --git a/eladmin-system/src/main/java/cn/ysk/cashier/cons/rest/TbProskuConController.java b/eladmin-system/src/main/java/cn/ysk/cashier/cons/rest/TbProskuConController.java index 7311119b..c4a46071 100644 --- a/eladmin-system/src/main/java/cn/ysk/cashier/cons/rest/TbProskuConController.java +++ b/eladmin-system/src/main/java/cn/ysk/cashier/cons/rest/TbProskuConController.java @@ -37,7 +37,6 @@ public class TbProskuConController { } @GetMapping - @Log("查询商品规格耗材信息") @ApiOperation("查询商品规格耗材信息") public ResponseEntity queryTbProskuCon(TbProskuConQueryCriteria criteria, Pageable pageable){ return new ResponseEntity<>(tbProskuConService.queryAll(criteria,pageable),HttpStatus.OK); diff --git a/eladmin-system/src/main/java/cn/ysk/cashier/cons/rest/ViewConInfoFlowController.java b/eladmin-system/src/main/java/cn/ysk/cashier/cons/rest/ViewConInfoFlowController.java index e5558da6..8de657ce 100644 --- a/eladmin-system/src/main/java/cn/ysk/cashier/cons/rest/ViewConInfoFlowController.java +++ b/eladmin-system/src/main/java/cn/ysk/cashier/cons/rest/ViewConInfoFlowController.java @@ -34,7 +34,6 @@ public class ViewConInfoFlowController { } @GetMapping - @Log("查询获取耗材流水信息") @ApiOperation("查询获取耗材流水信息") public ResponseEntity queryViewConInfoFlow(ViewConInfoFlowQueryCriteria criteria, Pageable pageable){ return new ResponseEntity<>(viewConInfoFlowService.queryAll(criteria,pageable),HttpStatus.OK); diff --git a/eladmin-system/src/main/java/cn/ysk/cashier/cons/rest/ViewConSkuController.java b/eladmin-system/src/main/java/cn/ysk/cashier/cons/rest/ViewConSkuController.java index 276aa1cd..473a08de 100644 --- a/eladmin-system/src/main/java/cn/ysk/cashier/cons/rest/ViewConSkuController.java +++ b/eladmin-system/src/main/java/cn/ysk/cashier/cons/rest/ViewConSkuController.java @@ -34,7 +34,6 @@ public class ViewConSkuController { } @GetMapping - @Log("查询查询耗材规格信息") @ApiOperation("查询查询耗材规格信息") public ResponseEntity queryViewConSku(ViewConSkuQueryCriteria criteria, Pageable pageable){ return new ResponseEntity<>(viewConSkuService.queryAll(criteria,pageable),HttpStatus.OK); diff --git a/eladmin-system/src/main/java/cn/ysk/cashier/cons/rest/ViewConsSuppFlowController.java b/eladmin-system/src/main/java/cn/ysk/cashier/cons/rest/ViewConsSuppFlowController.java index b1c72be8..2c51372b 100644 --- a/eladmin-system/src/main/java/cn/ysk/cashier/cons/rest/ViewConsSuppFlowController.java +++ b/eladmin-system/src/main/java/cn/ysk/cashier/cons/rest/ViewConsSuppFlowController.java @@ -34,7 +34,6 @@ public class ViewConsSuppFlowController { } @GetMapping - @Log("查询出入库记录") @ApiOperation("查询出入库记录") public ResponseEntity queryViewConsSuppFlow(ViewConsSuppFlowQueryCriteria criteria, Pageable pageable){ return new ResponseEntity<>(viewConsSuppFlowService.queryAll(criteria,pageable),HttpStatus.OK); diff --git a/eladmin-system/src/main/java/cn/ysk/cashier/cons/rest/ViewProductSkuShopController.java b/eladmin-system/src/main/java/cn/ysk/cashier/cons/rest/ViewProductSkuShopController.java index a3ed039c..862f8f6b 100644 --- a/eladmin-system/src/main/java/cn/ysk/cashier/cons/rest/ViewProductSkuShopController.java +++ b/eladmin-system/src/main/java/cn/ysk/cashier/cons/rest/ViewProductSkuShopController.java @@ -34,7 +34,6 @@ public class ViewProductSkuShopController { } @GetMapping - @Log("查询商品规格信息查询") @ApiOperation("查询商品规格信息查询") public ResponseEntity queryViewProductSkuShop(ViewProductSkuShopQueryCriteria criteria, Pageable pageable){ return new ResponseEntity<>(viewProductSkuShopService.queryAll(criteria,pageable),HttpStatus.OK); diff --git a/eladmin-system/src/main/java/cn/ysk/cashier/controller/shop/TbCouponCategoryController.java b/eladmin-system/src/main/java/cn/ysk/cashier/controller/shop/TbCouponCategoryController.java index a6fc4257..8a33c94a 100644 --- a/eladmin-system/src/main/java/cn/ysk/cashier/controller/shop/TbCouponCategoryController.java +++ b/eladmin-system/src/main/java/cn/ysk/cashier/controller/shop/TbCouponCategoryController.java @@ -26,7 +26,6 @@ public class TbCouponCategoryController { private final TbCouponCategoryService tbCouponCategoryService; @GetMapping - @Log("查询团购卷类别") @ApiOperation("查询团购卷类别") public ResponseEntity queryTbCouponCategory(TbCouponCategoryQueryCriteria criteria, Pageable pageable){ return new ResponseEntity<>(tbCouponCategoryService.queryAll(criteria,pageable),HttpStatus.OK); diff --git a/eladmin-system/src/main/resources/template/generator/admin/Controller.ftl b/eladmin-system/src/main/resources/template/generator/admin/Controller.ftl index 8b863d9f..ada29d7f 100644 --- a/eladmin-system/src/main/resources/template/generator/admin/Controller.ftl +++ b/eladmin-system/src/main/resources/template/generator/admin/Controller.ftl @@ -34,7 +34,6 @@ public class ${className}Controller { } @GetMapping - @Log("查询${apiAlias}") @ApiOperation("查询${apiAlias}") public ResponseEntity query${className}(${className}QueryCriteria criteria, Pageable pageable){ return new ResponseEntity<>(${changeClassName}Service.queryAll(criteria,pageable),HttpStatus.OK); From d68de077289238a041fbe532cae025c991eefceb Mon Sep 17 00:00:00 2001 From: SongZhang <2064194730@qq.com> Date: Tue, 30 Jul 2024 15:08:11 +0800 Subject: [PATCH 09/21] =?UTF-8?q?1.=E5=BA=93=E5=AD=98=E8=AE=B0=E5=BD=95?= =?UTF-8?q?=E9=94=99=E8=AF=AFsql=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../cn/ysk/cashier/repository/order/StockCountRepository.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eladmin-system/src/main/java/cn/ysk/cashier/repository/order/StockCountRepository.java b/eladmin-system/src/main/java/cn/ysk/cashier/repository/order/StockCountRepository.java index 929bf2e0..29816d1a 100644 --- a/eladmin-system/src/main/java/cn/ysk/cashier/repository/order/StockCountRepository.java +++ b/eladmin-system/src/main/java/cn/ysk/cashier/repository/order/StockCountRepository.java @@ -45,7 +45,7 @@ public interface StockCountRepository extends JpaRepository Date: Tue, 30 Jul 2024 15:13:40 +0800 Subject: [PATCH 10/21] =?UTF-8?q?1.=E5=BA=93=E5=AD=98=E8=AE=B0=E5=BD=95?= =?UTF-8?q?=E9=94=99=E8=AF=AFsql=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../cn/ysk/cashier/repository/order/StockCountRepository.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eladmin-system/src/main/java/cn/ysk/cashier/repository/order/StockCountRepository.java b/eladmin-system/src/main/java/cn/ysk/cashier/repository/order/StockCountRepository.java index 29816d1a..ce71131c 100644 --- a/eladmin-system/src/main/java/cn/ysk/cashier/repository/order/StockCountRepository.java +++ b/eladmin-system/src/main/java/cn/ysk/cashier/repository/order/StockCountRepository.java @@ -45,7 +45,7 @@ public interface StockCountRepository extends JpaRepository Date: Tue, 30 Jul 2024 15:14:19 +0800 Subject: [PATCH 11/21] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=96=B9=E6=B3=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/cn/ysk/cashier/cons/rest/TbHandoverController.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eladmin-system/src/main/java/cn/ysk/cashier/cons/rest/TbHandoverController.java b/eladmin-system/src/main/java/cn/ysk/cashier/cons/rest/TbHandoverController.java index 5db35100..599caa5f 100644 --- a/eladmin-system/src/main/java/cn/ysk/cashier/cons/rest/TbHandoverController.java +++ b/eladmin-system/src/main/java/cn/ysk/cashier/cons/rest/TbHandoverController.java @@ -33,7 +33,7 @@ public class TbHandoverController { tbHandoverService.download(tbHandoverService.queryAll(criteria), response); } - @PostMapping + @GetMapping @Log("查询查询交班记录") @ApiOperation("查询查询交班记录") public ResponseEntity queryTbHandover(TbHandoverQueryCriteria criteria, Pageable pageable){ From 84802d508f7d14d55ad1121629dcd292c45dc4d9 Mon Sep 17 00:00:00 2001 From: GYJ <1157756119@qq.com> Date: Tue, 30 Jul 2024 15:14:51 +0800 Subject: [PATCH 12/21] =?UTF-8?q?=E4=B8=8D=E5=90=8C=E5=BA=97=E9=93=BA?= =?UTF-8?q?=E4=B9=8B=E9=97=B4=E5=91=98=E5=B7=A5=E8=B4=A6=E6=88=B7=E5=8F=AF?= =?UTF-8?q?=E9=87=8D=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../rest/AuthorizationController.java | 20 +++++++++++++++++++ .../security/service/dto/AuthUserDto.java | 4 ++++ .../shopimpl/TbPlussShopStaffServiceImpl.java | 2 ++ 3 files changed, 26 insertions(+) diff --git a/eladmin-system/src/main/java/cn/ysk/cashier/config/security/rest/AuthorizationController.java b/eladmin-system/src/main/java/cn/ysk/cashier/config/security/rest/AuthorizationController.java index 3080fe98..5030dcd1 100644 --- a/eladmin-system/src/main/java/cn/ysk/cashier/config/security/rest/AuthorizationController.java +++ b/eladmin-system/src/main/java/cn/ysk/cashier/config/security/rest/AuthorizationController.java @@ -16,9 +16,12 @@ package cn.ysk.cashier.config.security.rest; import cn.hutool.core.util.IdUtil; +import cn.hutool.core.util.StrUtil; import cn.ysk.cashier.config.security.config.bean.LoginCodeEnum; import cn.ysk.cashier.config.security.security.TokenProvider; +import cn.ysk.cashier.pojo.shop.TbMerchantAccount; import cn.ysk.cashier.pojo.shop.TbPlussShopStaff; +import cn.ysk.cashier.repository.shop.TbMerchantAccountRepository; import cn.ysk.cashier.repository.shop.TbPlussShopStaffRepository; import cn.ysk.cashier.utils.*; import com.wf.captcha.base.Captcha; @@ -75,6 +78,8 @@ public class AuthorizationController { private final AuthenticationManagerBuilder authenticationManagerBuilder; private final TbShopInfoRepository tbShopInfoRepository; private final TbPlussShopStaffRepository staffRepository; + private final TbMerchantAccountRepository tbMerchantAccountRepository; + @Resource private LoginProperties loginProperties; @@ -93,6 +98,21 @@ public class AuthorizationController { if (authUser.isChecked() && StringUtils.isBlank(authUser.getCode()) || authUser.isChecked() && !authUser.getCode().equalsIgnoreCase(code)) { throw new BadRequestException("验证码错误"); } + + // 判断是否是员工登录 + if (authUser.getLoginType() != null && "staff".equals(authUser.getLoginType())) { + if (StrUtil.isBlank(authUser.getMerchantName())) { + throw new BadRequestException("商户名称不能为空"); + } + + TbMerchantAccount merchant = tbMerchantAccountRepository.findByAccount(authUser.getMerchantName()); + if (merchant == null) { + throw new BadRequestException("商户不存在"); + } + + authUser.setUsername(merchant.getShopId() + "@" + authUser.getUsername()); + } + //生成token UsernamePasswordAuthenticationToken authenticationToken = new UsernamePasswordAuthenticationToken(authUser.getUsername(), password); diff --git a/eladmin-system/src/main/java/cn/ysk/cashier/config/security/service/dto/AuthUserDto.java b/eladmin-system/src/main/java/cn/ysk/cashier/config/security/service/dto/AuthUserDto.java index 147abc97..305d7e60 100644 --- a/eladmin-system/src/main/java/cn/ysk/cashier/config/security/service/dto/AuthUserDto.java +++ b/eladmin-system/src/main/java/cn/ysk/cashier/config/security/service/dto/AuthUserDto.java @@ -33,6 +33,10 @@ public class AuthUserDto { @NotBlank private String password; + private String merchantName; + + private String loginType = "merchant"; + private String code; private String uuid = ""; diff --git a/eladmin-system/src/main/java/cn/ysk/cashier/service/impl/shopimpl/TbPlussShopStaffServiceImpl.java b/eladmin-system/src/main/java/cn/ysk/cashier/service/impl/shopimpl/TbPlussShopStaffServiceImpl.java index 1691e564..be5d3cc9 100644 --- a/eladmin-system/src/main/java/cn/ysk/cashier/service/impl/shopimpl/TbPlussShopStaffServiceImpl.java +++ b/eladmin-system/src/main/java/cn/ysk/cashier/service/impl/shopimpl/TbPlussShopStaffServiceImpl.java @@ -116,6 +116,8 @@ public class TbPlussShopStaffServiceImpl implements TbPlussShopStaffService { throw new BadRequestException("最大优惠金额过大"); } + resources.setAccount(resources.getShopId() + "@" + resources.getAccount()); + resources.setCreatedAt(Instant.now().toEpochMilli()); //添加收银系统后台账号 From 407f58ea3723065ac6af73e0d52e7b1ccd42f234 Mon Sep 17 00:00:00 2001 From: wangw <1594593906@qq.com> Date: Tue, 30 Jul 2024 15:15:32 +0800 Subject: [PATCH 13/21] =?UTF-8?q?=E5=88=9B=E5=BB=BA=E5=BA=97=E9=93=BA=20?= =?UTF-8?q?=E5=90=8C=E6=AD=A5=E5=88=9B=E5=BB=BA=E7=AE=A1=E7=90=86=E8=B4=A6?= =?UTF-8?q?=E5=8F=B7=20=E6=98=B5=E7=A7=B0=E4=B8=BA=E5=BA=97=E9=93=BA?= =?UTF-8?q?=E5=90=8D=E7=A7=B0=20=E4=BF=AE=E6=94=B9=E5=BA=97=E9=93=BA=20?= =?UTF-8?q?=E5=A6=82=E6=9E=9C=E4=BF=AE=E6=94=B9=E5=90=8D=E7=A7=B0=20?= =?UTF-8?q?=E6=98=B5=E7=A7=B0=E5=90=8C=E6=AD=A5=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../cashier/service/impl/shopimpl/TbShopInfoServiceImpl.java | 2 ++ .../java/cn/ysk/cashier/system/repository/UserRepository.java | 4 ++++ 2 files changed, 6 insertions(+) diff --git a/eladmin-system/src/main/java/cn/ysk/cashier/service/impl/shopimpl/TbShopInfoServiceImpl.java b/eladmin-system/src/main/java/cn/ysk/cashier/service/impl/shopimpl/TbShopInfoServiceImpl.java index 59f2e184..0fad205e 100644 --- a/eladmin-system/src/main/java/cn/ysk/cashier/service/impl/shopimpl/TbShopInfoServiceImpl.java +++ b/eladmin-system/src/main/java/cn/ysk/cashier/service/impl/shopimpl/TbShopInfoServiceImpl.java @@ -178,6 +178,7 @@ public class TbShopInfoServiceImpl implements TbShopInfoService { User user = new User(); user.setPassword(passwordEncoder.encode(resources.getPassword())); user.setUsername(resources.getAccount()); + user.setNickName(resources.getShopName()); user.setPhone(resources.getPhone()); user.setCreateBy("admin"); user.setEnabled(true); @@ -240,6 +241,7 @@ public class TbShopInfoServiceImpl implements TbShopInfoService { TbShopInfo tbShopInfo = tbShopInfoRepository.findById(resources.getId()).orElseGet(TbShopInfo::new); if (!resources.getShopName().equals(tbShopInfo.getShopName())) { shopStaffRepository.updateNameById(resources.getShopName(),resources.getId().toString()); + userRepository.updateNickName(resources.getAccount(),resources.getShopName()); } ValidationUtil.isNull( tbShopInfo.getId(),"TbShopInfo","id",resources.getId()); tbShopInfo.copy(resources); diff --git a/eladmin-system/src/main/java/cn/ysk/cashier/system/repository/UserRepository.java b/eladmin-system/src/main/java/cn/ysk/cashier/system/repository/UserRepository.java index 5d5afe4b..779fa5af 100644 --- a/eladmin-system/src/main/java/cn/ysk/cashier/system/repository/UserRepository.java +++ b/eladmin-system/src/main/java/cn/ysk/cashier/system/repository/UserRepository.java @@ -65,6 +65,10 @@ public interface UserRepository extends JpaRepository, JpaSpecificat @Query(value = "update sys_user set enabled = 0 where username = ?1",nativeQuery = true) void upEnableByusername(String username); + @Modifying + @Query(value = "update sys_user set nick_name = ?2 where username = ?1",nativeQuery = true) + void updateNickName(String username, String nickName); + /** * 修改邮箱 * @param username 用户名 From 4655786218282da5c6c335875443a81039f1f723 Mon Sep 17 00:00:00 2001 From: wangw <1594593906@qq.com> Date: Tue, 30 Jul 2024 15:20:37 +0800 Subject: [PATCH 14/21] =?UTF-8?q?=E6=9F=A5=E8=AF=A2=E6=8E=A5=E5=8F=A3?= =?UTF-8?q?=E4=B8=8D=E5=81=9A=E8=AE=B0=E5=BD=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/cn/ysk/cashier/aspect/LogAspect.java | 2 +- .../java/cn/ysk/cashier/cons/rest/TbHandoverController.java | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/eladmin-logging/src/main/java/cn/ysk/cashier/aspect/LogAspect.java b/eladmin-logging/src/main/java/cn/ysk/cashier/aspect/LogAspect.java index 5c7bee77..75813f21 100644 --- a/eladmin-logging/src/main/java/cn/ysk/cashier/aspect/LogAspect.java +++ b/eladmin-logging/src/main/java/cn/ysk/cashier/aspect/LogAspect.java @@ -109,7 +109,7 @@ public class LogAspect { jsonObject = JSONObject.parseObject(jsonString); shopId = (Integer)jsonObject.get("shopId"); } - logService.save(getUsername()+getUsername(), StringUtils.getBrowser(request), StringUtils.getIp(request), (ProceedingJoinPoint)joinPoint, log, shopId); + logService.save(getUsername(), StringUtils.getBrowser(request), StringUtils.getIp(request), (ProceedingJoinPoint)joinPoint, log, shopId); } diff --git a/eladmin-system/src/main/java/cn/ysk/cashier/cons/rest/TbHandoverController.java b/eladmin-system/src/main/java/cn/ysk/cashier/cons/rest/TbHandoverController.java index 599caa5f..453d4789 100644 --- a/eladmin-system/src/main/java/cn/ysk/cashier/cons/rest/TbHandoverController.java +++ b/eladmin-system/src/main/java/cn/ysk/cashier/cons/rest/TbHandoverController.java @@ -34,7 +34,6 @@ public class TbHandoverController { } @GetMapping - @Log("查询查询交班记录") @ApiOperation("查询查询交班记录") public ResponseEntity queryTbHandover(TbHandoverQueryCriteria criteria, Pageable pageable){ return new ResponseEntity<>(tbHandoverService.queryAll(criteria,pageable),HttpStatus.OK); From a2844da331efd2d4159df659a097d865b828bb0d Mon Sep 17 00:00:00 2001 From: wangw <1594593906@qq.com> Date: Tue, 30 Jul 2024 15:29:19 +0800 Subject: [PATCH 15/21] =?UTF-8?q?=E5=91=98=E5=B7=A5=E8=B4=A6=E5=8F=B7=20?= =?UTF-8?q?=E5=94=AF=E4=B8=80=E9=97=AE=E9=A2=98=20=E7=99=BB=E5=BD=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../config/security/rest/AuthorizationController.java | 7 +++---- .../impl/shopimpl/TbPlussShopStaffServiceImpl.java | 9 +++------ 2 files changed, 6 insertions(+), 10 deletions(-) diff --git a/eladmin-system/src/main/java/cn/ysk/cashier/config/security/rest/AuthorizationController.java b/eladmin-system/src/main/java/cn/ysk/cashier/config/security/rest/AuthorizationController.java index 5030dcd1..6e65a744 100644 --- a/eladmin-system/src/main/java/cn/ysk/cashier/config/security/rest/AuthorizationController.java +++ b/eladmin-system/src/main/java/cn/ysk/cashier/config/security/rest/AuthorizationController.java @@ -98,7 +98,7 @@ public class AuthorizationController { if (authUser.isChecked() && StringUtils.isBlank(authUser.getCode()) || authUser.isChecked() && !authUser.getCode().equalsIgnoreCase(code)) { throw new BadRequestException("验证码错误"); } - + String loginpre=""; // 判断是否是员工登录 if (authUser.getLoginType() != null && "staff".equals(authUser.getLoginType())) { if (StrUtil.isBlank(authUser.getMerchantName())) { @@ -109,13 +109,12 @@ public class AuthorizationController { if (merchant == null) { throw new BadRequestException("商户不存在"); } - - authUser.setUsername(merchant.getShopId() + "@" + authUser.getUsername()); + loginpre=merchant.getShopId() + "@"; } //生成token UsernamePasswordAuthenticationToken authenticationToken = - new UsernamePasswordAuthenticationToken(authUser.getUsername(), password); + new UsernamePasswordAuthenticationToken(loginpre+authUser.getUsername(), password); Authentication authentication = authenticationManagerBuilder.getObject().authenticate(authenticationToken); SecurityContextHolder.getContext().setAuthentication(authentication); // 生成令牌与第三方系统获取令牌方式 diff --git a/eladmin-system/src/main/java/cn/ysk/cashier/service/impl/shopimpl/TbPlussShopStaffServiceImpl.java b/eladmin-system/src/main/java/cn/ysk/cashier/service/impl/shopimpl/TbPlussShopStaffServiceImpl.java index be5d3cc9..929f3717 100644 --- a/eladmin-system/src/main/java/cn/ysk/cashier/service/impl/shopimpl/TbPlussShopStaffServiceImpl.java +++ b/eladmin-system/src/main/java/cn/ysk/cashier/service/impl/shopimpl/TbPlussShopStaffServiceImpl.java @@ -115,9 +115,6 @@ public class TbPlussShopStaffServiceImpl implements TbPlussShopStaffService { if (resources.getMaxDiscountAmount().compareTo(new BigDecimal(100000000L)) > 0) { throw new BadRequestException("最大优惠金额过大"); } - - resources.setAccount(resources.getShopId() + "@" + resources.getAccount()); - resources.setCreatedAt(Instant.now().toEpochMilli()); //添加收银系统后台账号 @@ -129,7 +126,7 @@ public class TbPlussShopStaffServiceImpl implements TbPlussShopStaffService { user.setPassword(passwordEncoder.encode(resources.getPassword())); resources.setPassword(MD5Utils.md5(resources.getPassword())); } - user.setUsername(resources.getAccount()); + user.setUsername(resources.getShopId() + "@" +resources.getAccount()); user.setNickName(resources.getName()); user.setPhone(resources.getPhone()); user.setEnabled(true); @@ -164,7 +161,7 @@ public class TbPlussShopStaffServiceImpl implements TbPlussShopStaffService { throw new BadRequestException("员工编号不能包含中文"); } TbPlussShopStaff tbPlussShopStaff = tbPlussShopStaffRepository.findById(resources.getId()).orElseGet(TbPlussShopStaff::new); - User sysUser = userRepository.findByUsername(tbPlussShopStaff.getAccount()); + User sysUser = userRepository.findByUsername(resources.getShopId()+"@"+tbPlussShopStaff.getAccount()); if(!tbPlussShopStaff.getAccount().equals(resources.getAccount())){ if (userRepository.findByUsername(resources.getAccount()) != null) { throw new BadRequestException("员工账号不可重复"); @@ -182,7 +179,7 @@ public class TbPlussShopStaffServiceImpl implements TbPlussShopStaffService { Role role = new Role(); role.setId(resources.getRoleId()); roles.add(role); - sysUser.setUsername(resources.getAccount()); + sysUser.setUsername(resources.getShopId()+"@"+resources.getAccount()); sysUser.setRoles(roles); sysUser.setNickName(resources.getName()); if (StringUtils.isNotBlank(resources.getPassword())) { From 762e5a9f36289b880248bd516bb499466f9bec6d Mon Sep 17 00:00:00 2001 From: wangw <1594593906@qq.com> Date: Tue, 30 Jul 2024 16:50:59 +0800 Subject: [PATCH 16/21] =?UTF-8?q?=E7=99=BB=E5=BD=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../cashier/config/security/rest/AuthorizationController.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eladmin-system/src/main/java/cn/ysk/cashier/config/security/rest/AuthorizationController.java b/eladmin-system/src/main/java/cn/ysk/cashier/config/security/rest/AuthorizationController.java index 6e65a744..f5ab968d 100644 --- a/eladmin-system/src/main/java/cn/ysk/cashier/config/security/rest/AuthorizationController.java +++ b/eladmin-system/src/main/java/cn/ysk/cashier/config/security/rest/AuthorizationController.java @@ -123,7 +123,7 @@ public class AuthorizationController { // SecurityContextHolder.getContext().setAuthentication(authentication); final JwtUserDto jwtUserDto = (JwtUserDto) authentication.getPrincipal(); // TbShopInfo byAccount = tbShopInfoRepository.findByAccount(jwtUserDto.getUsername()); - TbPlussShopStaff tbPlussShopStaff = staffRepository.queryByAccount(jwtUserDto.getUsername()); + TbPlussShopStaff tbPlussShopStaff = staffRepository.queryByAccount(authUser.getUsername()); if (tbPlussShopStaff != null && tbPlussShopStaff.getType().equals("staff")) { Integer isManage = tbPlussShopStaff.getIsManage(); if (isManage != null && isManage != 1) { From 498de25b9be86b73881a9153095b0278157728b5 Mon Sep 17 00:00:00 2001 From: wangw <1594593906@qq.com> Date: Wed, 31 Jul 2024 15:31:11 +0800 Subject: [PATCH 17/21] =?UTF-8?q?=E9=80=80=E5=8D=95=E6=98=BE=E7=A4=BA?= =?UTF-8?q?=E8=B4=9F=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../cashier/service/impl/order/TbOrderInfoServiceImpl.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/eladmin-system/src/main/java/cn/ysk/cashier/service/impl/order/TbOrderInfoServiceImpl.java b/eladmin-system/src/main/java/cn/ysk/cashier/service/impl/order/TbOrderInfoServiceImpl.java index 95aebda8..1fbab89b 100644 --- a/eladmin-system/src/main/java/cn/ysk/cashier/service/impl/order/TbOrderInfoServiceImpl.java +++ b/eladmin-system/src/main/java/cn/ysk/cashier/service/impl/order/TbOrderInfoServiceImpl.java @@ -409,7 +409,7 @@ public class TbOrderInfoServiceImpl implements TbOrderInfoService { case "offline": tbOrderInfo.setOrderType("线下"); break; - case "return ": + case "return": tbOrderInfo.setOrderType("退单"); break; default: @@ -466,7 +466,6 @@ public class TbOrderInfoServiceImpl implements TbOrderInfoService { map.put("支付类型", tbOrderInfo.getPayType()); map.put("订单金额", tbOrderInfo.getOrderAmount()); - map.put("退单金额", tbOrderInfo.getRefundAmount()); map.put("支付金额", tbOrderInfo.getPayAmount()); switch (tbOrderInfo.getStatus()) { case "unpaid": @@ -485,6 +484,7 @@ public class TbOrderInfoServiceImpl implements TbOrderInfoService { tbOrderInfo.setStatus("申请退单中"); break; case "refund": + map.put("支付金额", "-"+tbOrderInfo.getPayAmount()); tbOrderInfo.setStatus("退单完成"); break; case "cancelled": From b7453e1123e57760bca9db8dbf432ac83af9bca9 Mon Sep 17 00:00:00 2001 From: GYJ <1157756119@qq.com> Date: Thu, 1 Aug 2024 10:43:11 +0800 Subject: [PATCH 18/21] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E6=97=A5=E5=BF=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../cn/ysk/cashier/controller/product/StockController.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/eladmin-system/src/main/java/cn/ysk/cashier/controller/product/StockController.java b/eladmin-system/src/main/java/cn/ysk/cashier/controller/product/StockController.java index dbf8901f..bebca5c4 100644 --- a/eladmin-system/src/main/java/cn/ysk/cashier/controller/product/StockController.java +++ b/eladmin-system/src/main/java/cn/ysk/cashier/controller/product/StockController.java @@ -113,7 +113,8 @@ public class StockController { return new ResponseEntity<>(dataMap, HttpStatus.OK); } - @AnonymousAccess + + @Log("商品库存:上下架商品") @PutMapping("/grounding") @ApiOperation("上下架商品") public ResponseEntity grounding( @@ -140,6 +141,7 @@ public class StockController { return new ResponseEntity<>(HttpStatus.OK); } + @Log("商品库存:修改商品状态") @PutMapping("productStatus") public ResponseEntity updateProductStatus(@RequestBody StockUpdateValueVO updateValueVO) { stockService.updateProductStatus(updateValueVO); From ccba29361bd1b8bec5bf985301a28d99bacccf7f Mon Sep 17 00:00:00 2001 From: SongZhang <2064194730@qq.com> Date: Thu, 1 Aug 2024 14:22:33 +0800 Subject: [PATCH 19/21] =?UTF-8?q?1.=E7=BC=96=E8=BE=91=E5=95=86=E5=93=81?= =?UTF-8?q?=E4=B8=8D=E5=BD=B1=E5=93=8D=E4=B8=8A=E4=B8=8B=E6=9E=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../cashier/pojo/product/TbProductSku.java | 2 +- .../productimpl/TbProductServiceImpl.java | 23 ++++++++++++++++--- 2 files changed, 21 insertions(+), 4 deletions(-) diff --git a/eladmin-system/src/main/java/cn/ysk/cashier/pojo/product/TbProductSku.java b/eladmin-system/src/main/java/cn/ysk/cashier/pojo/product/TbProductSku.java index a108fafc..4c66cfcf 100644 --- a/eladmin-system/src/main/java/cn/ysk/cashier/pojo/product/TbProductSku.java +++ b/eladmin-system/src/main/java/cn/ysk/cashier/pojo/product/TbProductSku.java @@ -129,7 +129,7 @@ public class TbProductSku implements Serializable { @Column(name = "`is_grounding`") @ApiModelProperty(value = "是否上架") - private Integer isGrounding = 1; + private Integer isGrounding; public void setIsDel(Integer isDel) { if(isDel!=null){ diff --git a/eladmin-system/src/main/java/cn/ysk/cashier/service/impl/productimpl/TbProductServiceImpl.java b/eladmin-system/src/main/java/cn/ysk/cashier/service/impl/productimpl/TbProductServiceImpl.java index 9e181f3d..7d6993f6 100644 --- a/eladmin-system/src/main/java/cn/ysk/cashier/service/impl/productimpl/TbProductServiceImpl.java +++ b/eladmin-system/src/main/java/cn/ysk/cashier/service/impl/productimpl/TbProductServiceImpl.java @@ -374,6 +374,8 @@ public class TbProductServiceImpl implements TbProductService { } } + // 默认开启共享库存和库存 +// product.setIsDistribute(1); TbProduct save = tbProductRepository.save(product); if (save.getId() == null) { throw new BadRequestException("添加商品失败"); @@ -489,13 +491,28 @@ public class TbProductServiceImpl implements TbProductService { // } // } if ("sku".equals(save.getTypeEnum())) { - List collect = resources.getSkuList().stream().map(TbProductSku::getId).collect(Collectors.toList()); +// List collect = resources.getSkuList().stream().map(TbProductSku::getId).collect(Collectors.toList()); List tbProductSkus = tbProductSkuRepository.searchSku(resources.getId().toString()); + List collect = tbProductSkus.stream().map(TbProductSku::getId).collect(Collectors.toList()); + HashMap skuInfo = new HashMap<>(); for (TbProductSku productSkus : tbProductSkus) { - if (!collect.contains(productSkus.getId())) { - tbProductSkuRepository.deleteBySkuId(productSkus.getId()); + skuInfo.put(productSkus.getId().toString(), productSkus); + } + for (TbProductSku tbProductSku : resources.getSkuList()) { + if (!collect.contains(tbProductSku.getId())) { + tbProductSkuRepository.deleteBySkuId(tbProductSku.getId()); + }else { + TbProductSku productSku = skuInfo.get(tbProductSku.getId().toString()); + if (productSku != null) { + tbProductSku.setIsGrounding(productSku.getIsGrounding()); + } } } +// for (TbProductSku productSkus : tbProductSkus) { +// if (!collect.contains(productSkus.getId())) { +// tbProductSkuRepository.deleteBySkuId(productSkus.getId()); +// } +// } } tbProductSkuRepository.saveAll(resources.getSkuList()); } From c219d322597f7cb80ae3e5e4667cc9b679fb2303 Mon Sep 17 00:00:00 2001 From: wangw <1594593906@qq.com> Date: Thu, 1 Aug 2024 17:26:32 +0800 Subject: [PATCH 20/21] =?UTF-8?q?=E5=91=98=E5=B7=A5=E8=AF=A6=E6=83=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/impl/shopimpl/TbPlussShopStaffServiceImpl.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eladmin-system/src/main/java/cn/ysk/cashier/service/impl/shopimpl/TbPlussShopStaffServiceImpl.java b/eladmin-system/src/main/java/cn/ysk/cashier/service/impl/shopimpl/TbPlussShopStaffServiceImpl.java index 929f3717..8ad53775 100644 --- a/eladmin-system/src/main/java/cn/ysk/cashier/service/impl/shopimpl/TbPlussShopStaffServiceImpl.java +++ b/eladmin-system/src/main/java/cn/ysk/cashier/service/impl/shopimpl/TbPlussShopStaffServiceImpl.java @@ -84,7 +84,7 @@ public class TbPlussShopStaffServiceImpl implements TbPlussShopStaffService { TbPlussShopStaff tbPlussShopStaff = tbPlussShopStaffRepository.findById(id).orElseGet(TbPlussShopStaff::new); ValidationUtil.isNull(tbPlussShopStaff.getId(),"TbPlussShopStaff","id",id); TbPlussShopStaffDto dto = tbPlussShopStaffMapper.toDto(tbPlussShopStaff); - UserDto userDto = userService.findByName(tbPlussShopStaff.getAccount()); + UserDto userDto = userService.findByName(tbPlussShopStaff.getShopId()+"@"+tbPlussShopStaff.getAccount()); // dto.setUser(userDto); if(!CollectionUtils.isEmpty(userDto.getRoles())){ dto.setRoleId(userDto.getRoles().stream().findFirst().get().getId()); From 25b4a4ca2f92fc157a685da9c7552213279de063 Mon Sep 17 00:00:00 2001 From: wangw <1594593906@qq.com> Date: Thu, 1 Aug 2024 17:34:21 +0800 Subject: [PATCH 21/21] =?UTF-8?q?=E9=87=8D=E5=A4=8D=E8=B4=A6=E5=8F=B7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/impl/shopimpl/TbPlussShopStaffServiceImpl.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eladmin-system/src/main/java/cn/ysk/cashier/service/impl/shopimpl/TbPlussShopStaffServiceImpl.java b/eladmin-system/src/main/java/cn/ysk/cashier/service/impl/shopimpl/TbPlussShopStaffServiceImpl.java index 8ad53775..187f2411 100644 --- a/eladmin-system/src/main/java/cn/ysk/cashier/service/impl/shopimpl/TbPlussShopStaffServiceImpl.java +++ b/eladmin-system/src/main/java/cn/ysk/cashier/service/impl/shopimpl/TbPlussShopStaffServiceImpl.java @@ -163,7 +163,7 @@ public class TbPlussShopStaffServiceImpl implements TbPlussShopStaffService { TbPlussShopStaff tbPlussShopStaff = tbPlussShopStaffRepository.findById(resources.getId()).orElseGet(TbPlussShopStaff::new); User sysUser = userRepository.findByUsername(resources.getShopId()+"@"+tbPlussShopStaff.getAccount()); if(!tbPlussShopStaff.getAccount().equals(resources.getAccount())){ - if (userRepository.findByUsername(resources.getAccount()) != null) { + if (userRepository.findByUsername(resources.getShopId()+"@"+resources.getAccount()) != null) { throw new BadRequestException("员工账号不可重复"); } }