From aff8f909fbdd357e2a00be4cf6acf063cdf8aed7 Mon Sep 17 00:00:00 2001 From: wangw <1594593906@qq.com> Date: Wed, 3 Apr 2024 10:28:30 +0800 Subject: [PATCH] =?UTF-8?q?PC=E7=AB=AF=E6=B7=BB=E5=8A=A0=E6=9C=AC=E5=9C=B0?= =?UTF-8?q?=E6=89=93=E5=8D=B0=E6=9C=BA=20=E8=A1=A8=E7=A4=BA=E4=B8=BAlocal?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../cashierservice/service/TbPrintPCMachineService.java | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/main/java/com/chaozhanggui/system/cashierservice/service/TbPrintPCMachineService.java b/src/main/java/com/chaozhanggui/system/cashierservice/service/TbPrintPCMachineService.java index f451227..6c2ebb9 100644 --- a/src/main/java/com/chaozhanggui/system/cashierservice/service/TbPrintPCMachineService.java +++ b/src/main/java/com/chaozhanggui/system/cashierservice/service/TbPrintPCMachineService.java @@ -11,6 +11,7 @@ import com.chaozhanggui.system.cashierservice.util.JSONUtil; import com.github.pagehelper.PageHelper; import com.github.pagehelper.PageInfo; import lombok.extern.slf4j.Slf4j; +import org.apache.commons.collections.CollectionUtils; import org.apache.commons.lang3.StringUtils; import org.springframework.beans.BeanUtils; import org.springframework.beans.factory.annotation.Autowired; @@ -59,6 +60,7 @@ public class TbPrintPCMachineService { */ public Result queryByPage(TbPrintPCMachine tbPrintMachine) { PageHelper.startPage(tbPrintMachine.getPage(), tbPrintMachine.getPageSize()); + tbPrintMachine.setContentType("local"); List tbPrintMachines = this.tbPrintMachineMapper.queryAll(tbPrintMachine); PageInfo pageInfo=new PageInfo(tbPrintMachines); return Result.success(CodeEnum.SUCCESS,pageInfo); @@ -73,7 +75,11 @@ public class TbPrintPCMachineService { public Result insert(PrintMachineDto resources) { TbPrintPCMachine tbPrintMachine = new TbPrintPCMachine(); tbPrintMachine.setCreatedAt(Instant.now().toEpochMilli()); + tbPrintMachine.setContentType("local"); if (resources.getConfig() != null){ + if(CollectionUtils.isEmpty(resources.getConfig().getCategoryList())){ + resources.getConfig().setCategoryList(null); + } tbPrintMachine.setConfig(JSONUtil.toJSONString(resources.getConfig(),true)); } BeanUtils.copyProperties(resources,tbPrintMachine);