From cee6945ed257d618d2b50f28c9f43b2fd0d7ba1b Mon Sep 17 00:00:00 2001 From: x_z Date: Wed, 26 Apr 2023 10:07:10 +0800 Subject: [PATCH 01/10] =?UTF-8?q?1.=E4=BF=AE=E5=A4=8D=E5=BA=93=E5=AD=98?= =?UTF-8?q?=E7=BB=9F=E8=AE=A1=E6=B2=A1=E6=9C=89=E6=8C=89=E7=85=A7=E4=BE=9B?= =?UTF-8?q?=E5=BA=94=E5=95=86ID=E5=88=86=E7=BB=84=E5=AF=BC=E8=87=B4?= =?UTF-8?q?=E6=95=B0=E6=8D=AE=E8=A2=AB=E5=90=88=E5=B9=B6=E9=94=99=E8=AF=AF?= =?UTF-8?q?=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/resources/mybatis/mapper/inv/invProductDao.xml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/main/resources/mybatis/mapper/inv/invProductDao.xml b/src/main/resources/mybatis/mapper/inv/invProductDao.xml index 8b42ac88..ce1911a6 100644 --- a/src/main/resources/mybatis/mapper/inv/invProductDao.xml +++ b/src/main/resources/mybatis/mapper/inv/invProductDao.xml @@ -26,14 +26,14 @@ auth_warehouse.name invName, ip.deptCode, ip.invCode, - as.name spaceName + s.name spaceName from inv_product ip inner join basic_udirel on ip.relIdFk = basic_udirel.id inner join basic_products bp on basic_udirel.uuid = bp.uuid left join basic_corp on ip.supId = basic_corp.erpId left join auth_dept on auth_dept.code = ip.deptCode left join auth_warehouse on auth_warehouse.code = ip.invCode - left join auth_space `as` on ip.invSpaceCode = `as`.code + left join auth_space s on ip.invSpaceCode = s.code bp.diType = 1 @@ -85,7 +85,7 @@ - GROUP BY ip.relIdFk, ip.batchNo + GROUP BY ip.relIdFk, ip.batchNo, ip.supId order by ip.updateTime desc From 6b2aa0eff36dc5d7e7d14c4342f9d47957b1721b Mon Sep 17 00:00:00 2001 From: wangwei <1610949092@qq.com> Date: Wed, 26 Apr 2023 11:15:25 +0800 Subject: [PATCH 02/10] =?UTF-8?q?=E4=BF=AE=E6=94=B9=20=E8=B5=84=E8=B4=A8?= =?UTF-8?q?=E9=A2=84=E8=AD=A6=E6=90=9C=E7=B4=A2=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../purchase/FilterCertRemindMsgRequest.java | 3 +++ .../mapper/purchase/SupCertRemindMsgDao.xml | 18 +++++++++++++++++- 2 files changed, 20 insertions(+), 1 deletion(-) diff --git a/src/main/java/com/glxp/api/req/purchase/FilterCertRemindMsgRequest.java b/src/main/java/com/glxp/api/req/purchase/FilterCertRemindMsgRequest.java index 03ed8c42..b5d8a522 100644 --- a/src/main/java/com/glxp/api/req/purchase/FilterCertRemindMsgRequest.java +++ b/src/main/java/com/glxp/api/req/purchase/FilterCertRemindMsgRequest.java @@ -34,4 +34,7 @@ public class FilterCertRemindMsgRequest extends ListPageRequest { */ private Integer ignoreStatus; + // 证书名称 + private String certName; + } diff --git a/src/main/resources/mybatis/mapper/purchase/SupCertRemindMsgDao.xml b/src/main/resources/mybatis/mapper/purchase/SupCertRemindMsgDao.xml index 325cf6f0..ad8d712d 100644 --- a/src/main/resources/mybatis/mapper/purchase/SupCertRemindMsgDao.xml +++ b/src/main/resources/mybatis/mapper/purchase/SupCertRemindMsgDao.xml @@ -7,6 +7,8 @@ (select `name` from sup_cert s where s.code = m.code and s.CustomerId = m.idFk) certName from sup_cert_remind_msg m left join sup_company c on m.idFk = c.customerId + left join sup_cert bc on bc.code = m.code + AND m.idFk = #{supId} @@ -23,6 +25,10 @@ AND m.type = #{type} + + AND bc.name like concat('%', #{certName}, '%') + + order by m.updateTime desc @@ -33,6 +39,7 @@ (select `name` from sup_cert s where s.code = m.code and s.manufacturerIdFk = m.idFk) certName from sup_cert_remind_msg m left join sup_manufacturer c on m.idFk = c.customerId + left join sup_cert bc on bc.code = m.code AND c.customerId = #{supId} @@ -49,6 +56,10 @@ AND m.type = #{type} + + AND bc.name like concat('%', #{certName}, '%') + + order by m.updateTime desc @@ -59,6 +70,8 @@ (select `name` from sup_cert s where s.code = m.code and s.productIdFk = m.idFk) certName from sup_cert_remind_msg m left join sup_product c on m.idFk = c.productId + left join sup_cert bc on bc.code = m.code + AND c.customerId = #{supId} @@ -75,7 +88,10 @@ AND m.type = #{type} + + AND bc.name like concat('%', #{certName}, '%') + order by m.updateTime desc - \ No newline at end of file + From 8977d1b23e64856ec831328d4dedaae12cc7fadd Mon Sep 17 00:00:00 2001 From: wangwei <1610949092@qq.com> Date: Wed, 26 Apr 2023 11:55:49 +0800 Subject: [PATCH 03/10] =?UTF-8?q?=E4=BF=AE=E6=94=B9=20=E5=AD=97=E5=85=B8?= =?UTF-8?q?=E5=AF=BC=E5=85=A5=20=E6=9F=A5=E8=AF=A2=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../resources/mybatis/mapper/basic/BasicCorpImportLogDao.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/resources/mybatis/mapper/basic/BasicCorpImportLogDao.xml b/src/main/resources/mybatis/mapper/basic/BasicCorpImportLogDao.xml index f40a7e64..a8363166 100644 --- a/src/main/resources/mybatis/mapper/basic/BasicCorpImportLogDao.xml +++ b/src/main/resources/mybatis/mapper/basic/BasicCorpImportLogDao.xml @@ -13,7 +13,7 @@ AND id = #{id} - + AND status = #{status} @@ -50,4 +50,4 @@ WHERE genKey = #{genKey} - \ No newline at end of file + From b7c2690d56873722089d40f813ed2738691054ae Mon Sep 17 00:00:00 2001 From: anthonywj Date: Thu, 27 Apr 2023 14:32:56 +0800 Subject: [PATCH 04/10] =?UTF-8?q?bug=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../api/constant/BasicExportTypeEnum.java | 2 +- .../glxp/api/constant/BasicProcessStatus.java | 2 +- .../sync/SpsSyncDownloadController.java | 4 +- .../api/dao/system/SystemPDFTemplateDao.java | 6 +- .../system/SystemPDFTemplateEntity.java | 21 +++++- .../glxp/api/res/sync/BaseSyncResponse.java | 2 +- .../service/sync/SpsSyncDownloadService.java | 17 ++++- .../impl/SystemPDFTemplateServiceImpl.java | 2 +- .../mapper/system/SystemPDFTemplateDao.xml | 72 +------------------ 9 files changed, 42 insertions(+), 86 deletions(-) diff --git a/src/main/java/com/glxp/api/constant/BasicExportTypeEnum.java b/src/main/java/com/glxp/api/constant/BasicExportTypeEnum.java index 7dedff99..d8f662fc 100644 --- a/src/main/java/com/glxp/api/constant/BasicExportTypeEnum.java +++ b/src/main/java/com/glxp/api/constant/BasicExportTypeEnum.java @@ -19,7 +19,7 @@ public enum BasicExportTypeEnum { /** * 国家库DI数据 */ - COUNTRY_DI_DATA("country_di_data", "国家库DI数据"), +// COUNTRY_DI_DATA("country_di_data", "国家库DI数据"), /** * 单据类型 diff --git a/src/main/java/com/glxp/api/constant/BasicProcessStatus.java b/src/main/java/com/glxp/api/constant/BasicProcessStatus.java index 38029eb6..2db63ac3 100644 --- a/src/main/java/com/glxp/api/constant/BasicProcessStatus.java +++ b/src/main/java/com/glxp/api/constant/BasicProcessStatus.java @@ -29,7 +29,7 @@ public class BasicProcessStatus { public static final String NEW_ALL_BUS = "8"; public static final String NEW_ALL_ORDER = "出入库扫码单据"; public static final String NEW_ALL_BUS_ORDER = "业务单据"; - public static final String NEW_ALL_DI = "10"; + public static final String NEW_ALL_UDIS = "国家库数据"; public static final String NEW_ALL_THR_DATA = "12"; //所有第三方基础数据 public static final String NEW_ALL_THR_PRODUCTS = "13"; //所有第三方产品数据 diff --git a/src/main/java/com/glxp/api/controller/sync/SpsSyncDownloadController.java b/src/main/java/com/glxp/api/controller/sync/SpsSyncDownloadController.java index b90b85b0..d62a333c 100644 --- a/src/main/java/com/glxp/api/controller/sync/SpsSyncDownloadController.java +++ b/src/main/java/com/glxp/api/controller/sync/SpsSyncDownloadController.java @@ -352,7 +352,6 @@ public class SpsSyncDownloadController { case SYS_SET_DATA: saveUploadSysSettingData(JSONUtil.toBean(obj, SpsSyncSysSettingResponse.class)); break; - case COUNTRY_DI_DATA: } String taskId = obj.getStr("taskId"); BasicDownloadStatusEntity downloadStatus = BasicDownloadStatusEntity.builder() @@ -422,7 +421,8 @@ public class SpsSyncDownloadController { systemPDFModuleDao.insertOrUpdateBatch(bean.getSystemPDFModuleEntities()); } if (CollectionUtil.isNotEmpty(bean.getSystemPDFTemplateEntities())) { - systemPDFTemplateDao.insertOrUpdateBatch(bean.getSystemPDFTemplateEntities()); + for (SystemPDFTemplateEntity systemPDFTemplateEntity : bean.getSystemPDFTemplateEntities()) + systemPDFTemplateDao.insertOrUpdate(systemPDFTemplateEntity); } if (CollectionUtil.isNotEmpty(bean.getSysPdfTemplateRelevanceCodeEntities())) { sysPdfTemplateRelevanceCodeDao.insertOrUpdateBatch(bean.getSysPdfTemplateRelevanceCodeEntities()); diff --git a/src/main/java/com/glxp/api/dao/system/SystemPDFTemplateDao.java b/src/main/java/com/glxp/api/dao/system/SystemPDFTemplateDao.java index 7be977ac..9e93b3f3 100644 --- a/src/main/java/com/glxp/api/dao/system/SystemPDFTemplateDao.java +++ b/src/main/java/com/glxp/api/dao/system/SystemPDFTemplateDao.java @@ -9,7 +9,7 @@ import org.apache.ibatis.annotations.Mapper; import java.util.List; @Mapper -public interface SystemPDFTemplateDao extends BaseMapperPlus { +public interface SystemPDFTemplateDao extends BaseMapperPlus { List queryPage(FilterPdfTemplateRequest filterPdfTemplateRequest); @@ -17,13 +17,11 @@ public interface SystemPDFTemplateDao extends BaseMapperPlus files; + private List syncFiles; private String updateTime; } diff --git a/src/main/java/com/glxp/api/service/sync/SpsSyncDownloadService.java b/src/main/java/com/glxp/api/service/sync/SpsSyncDownloadService.java index eefa3c08..5a948f45 100644 --- a/src/main/java/com/glxp/api/service/sync/SpsSyncDownloadService.java +++ b/src/main/java/com/glxp/api/service/sync/SpsSyncDownloadService.java @@ -47,6 +47,8 @@ import java.io.IOException; import java.util.*; import java.util.function.Function; +import static com.glxp.api.constant.BasicProcessStatus.NEW_ALL_UDIS; + @Slf4j @Service @RequiredArgsConstructor @@ -111,7 +113,7 @@ public class SpsSyncDownloadService { public void syncDiProductsTask() { BasicExportStatusEntity exportStatus = basicExportService.getOne(Wrappers.lambdaQuery(BasicExportStatusEntity.class) - .eq(BasicExportStatusEntity::getType, BasicExportTypeEnum.COUNTRY_DI_DATA.getRemark()) + .eq(BasicExportStatusEntity::getType, NEW_ALL_UDIS) .orderByDesc(BasicExportStatusEntity::getStartTime) .last("limit 1") ); @@ -126,7 +128,7 @@ public class SpsSyncDownloadService { BasicExportStatusEntity basicExportStatusEntity = new BasicExportStatusEntity(); basicExportStatusEntity.setId(CustomUtil.getId()); basicExportStatusEntity.setIdDatas(ConstantStatus.SYNC_DI_PRODUCTS); - basicExportStatusEntity.setType(BasicExportTypeEnum.COUNTRY_DI_DATA.getRemark()); + basicExportStatusEntity.setType(NEW_ALL_UDIS); basicExportStatusEntity.setUpdateTime(new Date()); basicExportStatusEntity.setStartTime(new Date()); basicExportStatusEntity.setStatus(BasicExportStatusEnum.WAIT_TRIGGERED.getCode()); @@ -310,6 +312,7 @@ public class SpsSyncDownloadService { BasicExportTypeEnum exportType = BasicExportTypeEnum.BASIC_DATA; //文件数据 Map jsonMap = new WeakHashMap<>(4); + List syncFiles = new ArrayList<>(); Map> totalTimeMap = new WeakHashMap<>(10); try { //确认有开启物资字典由外向内同步 @@ -375,6 +378,14 @@ public class SpsSyncDownloadService { ); if (CollectionUtil.isNotEmpty(supCertList)) { jsonMap.put(SupCertEntity.class.getSimpleName(), supCertList); + for (SupCertEntity supCertEntity : supCertList) { + if (StrUtil.isNotEmpty(supCertEntity.getFilePath())) { + syncFiles.add(supCertEntity.getFilePath()); + } + } + if (CollUtil.isNotEmpty(syncFiles)) { + jsonMap.put("syncFiles", syncFiles); + } } List supCertSetList = supCertSetService.list(Wrappers.lambdaQuery(SupCertSetEntity.class) .le((boolean) map.get("isNew"), SupCertSetEntity::getUpdateTime, now) @@ -825,7 +836,7 @@ public class SpsSyncDownloadService { } } - syncOrderResponse.setFiles(syncFiles); + syncOrderResponse.setSyncFiles(syncFiles); syncOrderResponse.setCodeEntities(codeEntities); syncOrderResponse.setOrderDetailBizEntities(orderDetailBizEntities); syncOrderResponse.setOrderDetailCodeEntities(orderDetailCodeEntities); diff --git a/src/main/java/com/glxp/api/service/system/impl/SystemPDFTemplateServiceImpl.java b/src/main/java/com/glxp/api/service/system/impl/SystemPDFTemplateServiceImpl.java index 78941721..cf3ed39c 100644 --- a/src/main/java/com/glxp/api/service/system/impl/SystemPDFTemplateServiceImpl.java +++ b/src/main/java/com/glxp/api/service/system/impl/SystemPDFTemplateServiceImpl.java @@ -50,7 +50,7 @@ public class SystemPDFTemplateServiceImpl extends ServiceImpl - - - + UPDATE sys_pdf_template @@ -117,65 +110,4 @@ from sys_pdf_template where id = #{id} - - - insert into sys_pdf_template - - - id, - - `name`, - `type`, - `module`, - param, - `path`, - `rowCount`, - qrcodeCount, - remark, - create_time, - update_time, - jrxmlPath, - bussinessType, - bussinessStatus, - - values - - - #{id,jdbcType=INTEGER}, - - #{name,jdbcType=VARCHAR}, - #{type,jdbcType=INTEGER}, - #{module,jdbcType=INTEGER}, - #{param,jdbcType=VARCHAR}, - #{path,jdbcType=VARCHAR}, - #{rowCount,jdbcType=INTEGER}, - #{qrcodeCount,jdbcType=INTEGER}, - #{remark,jdbcType=VARCHAR}, - #{create_time,jdbcType=TIMESTAMP}, - #{update_time,jdbcType=TIMESTAMP}, - #{jrxmlPath,jdbcType=VARCHAR}, - #{bussinessType,jdbcType=VARCHAR}, - #{bussinessStatus,jdbcType=VARCHAR}, - - on duplicate key update - - - id = #{id,jdbcType=INTEGER}, - - `name` = #{name,jdbcType=VARCHAR}, - `type` = #{type,jdbcType=INTEGER}, - `module` = #{module,jdbcType=INTEGER}, - param = #{param,jdbcType=VARCHAR}, - `path` = #{path,jdbcType=VARCHAR}, - `rowCount` = #{rowCount,jdbcType=INTEGER}, - qrcodeCount = #{qrcodeCount,jdbcType=INTEGER}, - remark = #{remark,jdbcType=VARCHAR}, - create_time = #{create_time,jdbcType=TIMESTAMP}, - update_time = #{update_time,jdbcType=TIMESTAMP}, - jrxmlPath = #{jrxmlPath,jdbcType=VARCHAR}, - bussinessType = #{bussinessType,jdbcType=VARCHAR}, - bussinessStatus = #{bussinessStatus,jdbcType=VARCHAR}, - - - \ No newline at end of file + From fe092c66a30125a491a9be59c531d32cfdc9dec2 Mon Sep 17 00:00:00 2001 From: wj <1285151836@qq.com> Date: Thu, 27 Apr 2023 15:45:07 +0800 Subject: [PATCH 05/10] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E4=B8=8B=E8=BD=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/glxp/api/constant/StatusEnum.java | 25 +++++++ .../sync/SpsSyncDownloadController.java | 69 +++++++++++++++++-- .../glxp/api/dao/sync/BasicDownloadDao.java | 3 +- .../service/sync/BasicDownloadService.java | 3 +- .../sync/impl/BasicDownloadServiceImpl.java | 3 +- 5 files changed, 95 insertions(+), 8 deletions(-) create mode 100644 src/main/java/com/glxp/api/constant/StatusEnum.java diff --git a/src/main/java/com/glxp/api/constant/StatusEnum.java b/src/main/java/com/glxp/api/constant/StatusEnum.java new file mode 100644 index 00000000..f0419a24 --- /dev/null +++ b/src/main/java/com/glxp/api/constant/StatusEnum.java @@ -0,0 +1,25 @@ +package com.glxp.api.constant; + +import com.baomidou.mybatisplus.annotation.EnumValue; +import lombok.AllArgsConstructor; +import lombok.Getter; + +@Getter +@AllArgsConstructor +public enum StatusEnum { + + /** + * 失败 + */ + FAILED(1, "失败"), + + /** + * 成功 + */ + SUCCESS(2, "成功"), + ; + @EnumValue + private Integer code; + + private String remark; +} diff --git a/src/main/java/com/glxp/api/controller/sync/SpsSyncDownloadController.java b/src/main/java/com/glxp/api/controller/sync/SpsSyncDownloadController.java index d62a333c..bda287de 100644 --- a/src/main/java/com/glxp/api/controller/sync/SpsSyncDownloadController.java +++ b/src/main/java/com/glxp/api/controller/sync/SpsSyncDownloadController.java @@ -12,10 +12,7 @@ import com.glxp.api.annotation.AuthRuleAnnotation; import com.glxp.api.common.enums.ResultEnum; import com.glxp.api.common.res.BaseResponse; import com.glxp.api.common.util.ResultVOUtils; -import com.glxp.api.constant.BasicExportStatusEnum; -import com.glxp.api.constant.BasicExportTypeEnum; -import com.glxp.api.constant.BasicProcessStatus; -import com.glxp.api.constant.ConstantStatus; +import com.glxp.api.constant.*; import com.glxp.api.dao.auth.*; import com.glxp.api.dao.basic.*; import com.glxp.api.dao.inout.*; @@ -62,8 +59,12 @@ import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RestController; import javax.annotation.Resource; +import javax.servlet.ServletOutputStream; +import javax.servlet.http.HttpServletResponse; import javax.validation.Valid; import java.io.*; +import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; import java.util.Date; import java.util.List; @@ -359,7 +360,7 @@ public class SpsSyncDownloadController { .taskId(taskId) .startTime(new Date()) .endTime(new Date()) - .status(1) + .status(StatusEnum.SUCCESS.getCode()) .updateTime(new Date()) .type(upLoadRequest.getExportType().getRemark()) .idDatas(upLoadRequest.getExportType().getKey()) @@ -1142,5 +1143,63 @@ public class SpsSyncDownloadController { return ResultVOUtils.success("上传成功"); } + @GetMapping("/sps/sync/download/info/file") + public void downloadFile(HttpServletResponse response,String id){ + if (StrUtil.isBlank(id)) { + throw new RuntimeException("缺少唯一标识"); + } + BasicDownloadStatusEntity info = basicDownloadService.getById(id); + if (info == null) { + throw new RuntimeException("数据不存在"); + } + if (StrUtil.isBlank(info.getCacheFilePath())) { + throw new RuntimeException("文件未生成"); + } + File file = new File(info.getCacheFilePath()); + if (!file.exists()) { + throw new RuntimeException("文件丢失"); + } + String[] split = info.getCacheFilePath().split("/"); + String enFileName = URLEncoder.encode(split[split.length - 1], StandardCharsets.UTF_8); + // 设值返回文件属性,浏览器会根据属性调用下载文件方法 + response.addHeader("Content-Disposition", "attachment;filename=" + enFileName); + // 前端获取文件名,需要解码 + response.addHeader("downLoadName", enFileName); + // 定义输出流 + ServletOutputStream outputStream = null; + FileInputStream fileInputStream = null; + try { + outputStream = response.getOutputStream(); + // 定义输出类型为二进制流输出 + response.setContentType("application/octet-stream"); + fileInputStream = new FileInputStream(file); + byte[] bytes = new byte[fileInputStream.available()]; + fileInputStream.read(bytes); + // 把流写入response + outputStream.write(bytes); + // flush落盘 + outputStream.flush(); + // 关闭输出流 + outputStream.close(); + } catch (IOException e) { + throw new RuntimeException(e); + } finally { + if (outputStream != null) { + try { + outputStream.close(); + } catch (IOException e) { + throw new RuntimeException(e); + } + } + if (fileInputStream != null) { + try { + fileInputStream.close(); + } catch (IOException e) { + throw new RuntimeException(e); + } + } + } + } + } diff --git a/src/main/java/com/glxp/api/dao/sync/BasicDownloadDao.java b/src/main/java/com/glxp/api/dao/sync/BasicDownloadDao.java index 2e0184ff..f6f98834 100644 --- a/src/main/java/com/glxp/api/dao/sync/BasicDownloadDao.java +++ b/src/main/java/com/glxp/api/dao/sync/BasicDownloadDao.java @@ -1,5 +1,6 @@ package com.glxp.api.dao.sync; +import com.glxp.api.dao.BaseMapperPlus; import com.glxp.api.entity.sync.BasicDownloadStatusEntity; import com.glxp.api.req.sync.BasicDownloadRequest; import org.apache.ibatis.annotations.Mapper; @@ -8,7 +9,7 @@ import org.apache.ibatis.annotations.Param; import java.util.List; @Mapper -public interface BasicDownloadDao { +public interface BasicDownloadDao extends BaseMapperPlus { List filterDownloadStatus(BasicDownloadRequest basicDownloadRequest); diff --git a/src/main/java/com/glxp/api/service/sync/BasicDownloadService.java b/src/main/java/com/glxp/api/service/sync/BasicDownloadService.java index ea56fd84..fe5b7bcd 100644 --- a/src/main/java/com/glxp/api/service/sync/BasicDownloadService.java +++ b/src/main/java/com/glxp/api/service/sync/BasicDownloadService.java @@ -1,12 +1,13 @@ package com.glxp.api.service.sync; +import com.baomidou.mybatisplus.extension.service.IService; import com.glxp.api.entity.sync.BasicDownloadStatusEntity; import com.glxp.api.req.sync.BasicDownloadRequest; import java.util.List; -public interface BasicDownloadService { +public interface BasicDownloadService extends IService { BasicDownloadStatusEntity findByData(String idDatas, Integer status); diff --git a/src/main/java/com/glxp/api/service/sync/impl/BasicDownloadServiceImpl.java b/src/main/java/com/glxp/api/service/sync/impl/BasicDownloadServiceImpl.java index 5fe827dc..6b8185d4 100644 --- a/src/main/java/com/glxp/api/service/sync/impl/BasicDownloadServiceImpl.java +++ b/src/main/java/com/glxp/api/service/sync/impl/BasicDownloadServiceImpl.java @@ -1,6 +1,7 @@ package com.glxp.api.service.sync.impl; import cn.hutool.core.collection.CollUtil; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.github.pagehelper.PageHelper; import com.glxp.api.dao.sync.BasicDownloadDao; import com.glxp.api.entity.sync.BasicDownloadStatusEntity; @@ -15,7 +16,7 @@ import java.util.List; @Service @Transactional(rollbackFor = Exception.class) -public class BasicDownloadServiceImpl implements BasicDownloadService { +public class BasicDownloadServiceImpl extends ServiceImpl implements BasicDownloadService { @Resource BasicDownloadDao basicDownloadDao; From f54cfe91d502a3d5f9de9443f3c8156cf14caeee Mon Sep 17 00:00:00 2001 From: anthonywj Date: Thu, 27 Apr 2023 17:02:12 +0800 Subject: [PATCH 06/10] =?UTF-8?q?=E5=A4=87=E4=BB=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/resources/application-test.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/main/resources/application-test.yml b/src/main/resources/application-test.yml index 9d9c8060..8c5a7fb5 100644 --- a/src/main/resources/application-test.yml +++ b/src/main/resources/application-test.yml @@ -3,7 +3,7 @@ server: spring: datasource: driver-class-name: com.mysql.cj.jdbc.Driver - jdbc-url: jdbc:mysql://192.168.0.66:3364/udi_spms_px?allowMultiQueries=true&serverTimezone=Asia/Shanghai&useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=false&allowPublicKeyRetrieval=true + jdbc-url: jdbc:mysql://192.168.0.66:3364/udi_wms_wmd?allowMultiQueries=true&serverTimezone=Asia/Shanghai&useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=false&allowPublicKeyRetrieval=true username: root password: Glxp@6066 hikari: @@ -43,8 +43,8 @@ logging: level: com.glxp.api.dao: debug -file_path: /udi/udiwms/udiwmsfile/ -back_file_path: /share/udisps/back/ +file_path: D:/udi/udiwms/udiwmsfile/ +back_file_path: D:/share/udisps/back/ UDI_KEY: 6b137c66-6286-46c6-8efa-c2f5dd9237df UDI_SERVER_URL: https://www.udims.com/UDI_DL_Server_test SPMS_KEY: lCOdWCBKS6Kw45wdnnqUTELXyuSKnXEs From 9f0fca9d73264d81eb366cf117b21adc18033a90 Mon Sep 17 00:00:00 2001 From: wangwei <1610949092@qq.com> Date: Thu, 27 Apr 2023 17:10:17 +0800 Subject: [PATCH 07/10] =?UTF-8?q?=E5=90=8C=E6=AD=A5=20=E9=83=A8=E9=97=A8?= =?UTF-8?q?=E4=BB=93=E5=BA=93=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../auth/InvWarehouseController.java | 24 ++++++++++++------- .../controller/auth/SysUserController.java | 2 ++ .../mybatis/mapper/auth/DeptUserDao.xml | 2 +- 3 files changed, 18 insertions(+), 10 deletions(-) diff --git a/src/main/java/com/glxp/api/controller/auth/InvWarehouseController.java b/src/main/java/com/glxp/api/controller/auth/InvWarehouseController.java index e8a5614d..37a1ee93 100644 --- a/src/main/java/com/glxp/api/controller/auth/InvWarehouseController.java +++ b/src/main/java/com/glxp/api/controller/auth/InvWarehouseController.java @@ -242,19 +242,25 @@ public class InvWarehouseController extends BaseController { return ResultVOUtils.error(500, "修改失败,请先移除该仓库关联用户!"); } + // 先判断是否有相同名字的仓库 + boolean checkResult = invWarehouseService.checkDuplicateName(invWarehouseEntity.getParentId(), invWarehouseEntity.getName()); + if (checkResult) { + return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL, "仓库名称重复!"); + } + //更新仓库信息 invWarehouseEntity.setUpdateTime(new Date()); boolean b = invWarehouseService.updateInvSubWarehouse(invWarehouseEntity); - //如果要是一级仓库就吧全部子集都刷成一样的寄售仓库 - if (StrUtil.isBlank(invWarehouseEntity.getParentCode())) { - List invWarehouseEntityList = invWarehouseService.selectLowWarehouseAll(invWarehouseEntity.getCode()); - for (InvWarehouseEntity obj : invWarehouseEntityList) { - obj.setAdvanceType(invWarehouseEntity.getAdvanceType()); - obj.setUpdateTime(new Date()); - invWarehouseService.updateInvSubWarehouse(obj); - } - } +// //如果要是一级仓库就吧全部子集都刷成一样的寄售仓库 +// if (StrUtil.isBlank(invWarehouseEntity.getParentCode())) { +// List invWarehouseEntityList = invWarehouseService.selectLowWarehouseAll(invWarehouseEntity.getCode()); +// for (InvWarehouseEntity obj : invWarehouseEntityList) { +// obj.setAdvanceType(invWarehouseEntity.getAdvanceType()); +// obj.setUpdateTime(new Date()); +// invWarehouseService.updateInvSubWarehouse(obj); +// } +// } //更新部门信息 diff --git a/src/main/java/com/glxp/api/controller/auth/SysUserController.java b/src/main/java/com/glxp/api/controller/auth/SysUserController.java index 39bc4950..3beeeb25 100644 --- a/src/main/java/com/glxp/api/controller/auth/SysUserController.java +++ b/src/main/java/com/glxp/api/controller/auth/SysUserController.java @@ -309,6 +309,8 @@ public class SysUserController extends BaseController { for (DeptUserEntity deptUserEntity : deptUserEntities) { if(deptUserEntity.getDeptId() == 1){ checkDeptId=true; + }else{ + deptCodeList.add(deptUserEntity.getDeptId()); } } if(checkDeptId==false){ diff --git a/src/main/resources/mybatis/mapper/auth/DeptUserDao.xml b/src/main/resources/mybatis/mapper/auth/DeptUserDao.xml index 953f1165..e938ce0a 100644 --- a/src/main/resources/mybatis/mapper/auth/DeptUserDao.xml +++ b/src/main/resources/mybatis/mapper/auth/DeptUserDao.xml @@ -79,7 +79,7 @@ delete from auth_dept_user - where userId = #{userId} + where userId = #{userId} and deptId != 1 delete From ed08f88bf55c9e57b13f54be7ea989e7741cd7e1 Mon Sep 17 00:00:00 2001 From: anthonywj Date: Fri, 28 Apr 2023 09:22:56 +0800 Subject: [PATCH 08/10] =?UTF-8?q?=E5=8D=95=E6=8D=AE=E7=B1=BB=E5=9E=8B?= =?UTF-8?q?=E4=BF=9D=E5=AD=98=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../basic/BasicBussinessTypeController.java | 2 +- .../basic/IBasicBussinessTypeService.java | 2 +- .../impl/BasicBussinessTypeServiceImpl.java | 4 +- .../mybatis/mapper/basic/BasicCorpDao.xml | 2 +- .../mapper/basic/BasicUnitMaintainDao.xml | 155 ++++++++++++------ 5 files changed, 108 insertions(+), 57 deletions(-) diff --git a/src/main/java/com/glxp/api/controller/basic/BasicBussinessTypeController.java b/src/main/java/com/glxp/api/controller/basic/BasicBussinessTypeController.java index 8e18c612..c2d5ce70 100644 --- a/src/main/java/com/glxp/api/controller/basic/BasicBussinessTypeController.java +++ b/src/main/java/com/glxp/api/controller/basic/BasicBussinessTypeController.java @@ -173,7 +173,7 @@ public class BasicBussinessTypeController extends BaseController { } if (bussinessTypeSaveRequest != null) { - boolean exists = basicBussinessTypeService.checkBusTypeNameExists(bussinessTypeSaveRequest.getName(), bussinessTypeSaveRequest.getId().intValue()); + boolean exists = basicBussinessTypeService.checkBusTypeNameExists(bussinessTypeSaveRequest.getName(), bussinessTypeSaveRequest.getId().longValue()); if (exists) { return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL, "单据类型名称重复!"); } diff --git a/src/main/java/com/glxp/api/service/basic/IBasicBussinessTypeService.java b/src/main/java/com/glxp/api/service/basic/IBasicBussinessTypeService.java index e2f43b65..77b26a5d 100644 --- a/src/main/java/com/glxp/api/service/basic/IBasicBussinessTypeService.java +++ b/src/main/java/com/glxp/api/service/basic/IBasicBussinessTypeService.java @@ -111,7 +111,7 @@ public interface IBasicBussinessTypeService extends IService selectIgnoreSelf(String action); diff --git a/src/main/java/com/glxp/api/service/basic/impl/BasicBussinessTypeServiceImpl.java b/src/main/java/com/glxp/api/service/basic/impl/BasicBussinessTypeServiceImpl.java index e994ac3b..2d8a6d7b 100644 --- a/src/main/java/com/glxp/api/service/basic/impl/BasicBussinessTypeServiceImpl.java +++ b/src/main/java/com/glxp/api/service/basic/impl/BasicBussinessTypeServiceImpl.java @@ -28,7 +28,7 @@ import java.util.stream.Collectors; @Slf4j @Service @Transactional(rollbackFor = Exception.class) -public class BasicBussinessTypeServiceImpl extends ServiceImpl implements IBasicBussinessTypeService { +public class BasicBussinessTypeServiceImpl extends ServiceImpl implements IBasicBussinessTypeService { @Resource private CustomerService customerService; @@ -175,7 +175,7 @@ public class BasicBussinessTypeServiceImpl extends ServiceImpl list = basicBussinessTypeDao.selectList(new QueryWrapper().select("name", "id").eq("name", name)); if (CollUtil.isEmpty(list)) { return false; diff --git a/src/main/resources/mybatis/mapper/basic/BasicCorpDao.xml b/src/main/resources/mybatis/mapper/basic/BasicCorpDao.xml index 1d8a7465..00cd539e 100644 --- a/src/main/resources/mybatis/mapper/basic/BasicCorpDao.xml +++ b/src/main/resources/mybatis/mapper/basic/BasicCorpDao.xml @@ -244,7 +244,7 @@ WHERE (name = #{name}) limit 1 - + REPLACE INTO basic_corp ( thirdId, erpId, `name`, spell, diff --git a/src/main/resources/mybatis/mapper/basic/BasicUnitMaintainDao.xml b/src/main/resources/mybatis/mapper/basic/BasicUnitMaintainDao.xml index b58bd21a..eba53e4c 100644 --- a/src/main/resources/mybatis/mapper/basic/BasicUnitMaintainDao.xml +++ b/src/main/resources/mybatis/mapper/basic/BasicUnitMaintainDao.xml @@ -2,12 +2,11 @@ - - + replace INTO basic_corp - ( thirdId, erpId, `name`, spell, - addr, status, `type`, creditNo, contact, mobile, thirdId1, thirdId2, thirdId3, thirdId4, - thirdName, thirdName1, thirdName2, thirdName3, thirdName4, updateTime, corpType,outType) + ( thirdId, erpId, `name`, spell, + addr, status, `type`, creditNo, contact, mobile, thirdId1, thirdId2, thirdId3, thirdId4, + thirdName, thirdName1, thirdName2, thirdName3, thirdName4, updateTime, corpType,outType) values ( #{thirdId}, #{erpId}, From 009d0f0a39fc84468b323433e2093fc877322bdb Mon Sep 17 00:00:00 2001 From: anthonywj Date: Fri, 28 Apr 2023 11:58:45 +0800 Subject: [PATCH 09/10] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E7=B3=BB=E7=BB=9F?= =?UTF-8?q?=E7=B9=81=E5=BF=99=E9=97=AE=E9=A2=98=EF=BC=8C=E6=96=B0=E5=A2=9E?= =?UTF-8?q?=E9=A2=84=E9=AA=8C=E6=94=B6=E6=8C=89=E8=B4=A7=E4=BD=8D=E9=80=80?= =?UTF-8?q?=E5=9B=9E?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../api/controller/auth/DeptController.java | 2 + .../controller/auth/DeptUserController.java | 19 +- .../controller/auth/InvBusUserController.java | 6 +- .../controller/auth/SysUserController.java | 46 ++-- .../basic/UdiRelevanceController.java | 2 - .../dao/auth/WarehouseBussinessTypeDao.java | 1 - .../glxp/api/entity/inout/IoOrderEntity.java | 8 + .../res/basic/BasicBussinessTypeResponse.java | 2 +- .../WarehouseBussinessTypeServiceImpl.java | 2 +- .../impl/BasicBussinessTypeServiceImpl.java | 3 +- .../mybatis/mapper/auth/AuthAdminDao.xml | 31 +-- .../resources/mybatis/mapper/auth/DeptDao.xml | 220 +++++++++++------- .../mybatis/mapper/auth/InvBusUserDao.xml | 79 ++++--- .../mapper/auth/WarehouseBussinessTypeDao.xml | 9 - .../mybatis/mapper/thrsys/ThrDeptDao.xml | 2 +- src/main/resources/schemas/schema_v2.1.sql | 6 +- 16 files changed, 242 insertions(+), 196 deletions(-) diff --git a/src/main/java/com/glxp/api/controller/auth/DeptController.java b/src/main/java/com/glxp/api/controller/auth/DeptController.java index 15391122..294806ed 100644 --- a/src/main/java/com/glxp/api/controller/auth/DeptController.java +++ b/src/main/java/com/glxp/api/controller/auth/DeptController.java @@ -1,6 +1,7 @@ package com.glxp.api.controller.auth; import cn.hutool.core.collection.CollUtil; +import cn.hutool.core.util.IdUtil; import cn.hutool.core.util.StrUtil; import com.github.pagehelper.PageInfo; import com.glxp.api.annotation.AuthRuleAnnotation; @@ -228,6 +229,7 @@ public class DeptController extends BaseController { deptEntity.setPcode(deptEntity.getPcode()); } deptEntity.setUpdateTime(new Date()); + deptEntity.setId(IdUtil.getSnowflakeNextId()); boolean b = deptService.insertInvWarehouse(deptEntity); if (!b) { return ResultVOUtils.error(ResultEnum.NOT_NETWORK); diff --git a/src/main/java/com/glxp/api/controller/auth/DeptUserController.java b/src/main/java/com/glxp/api/controller/auth/DeptUserController.java index 3110a227..62115df1 100644 --- a/src/main/java/com/glxp/api/controller/auth/DeptUserController.java +++ b/src/main/java/com/glxp/api/controller/auth/DeptUserController.java @@ -64,23 +64,28 @@ public class DeptUserController { @PostMapping("udi/auth/dept/user/delete") @Log(title = "用户管理", businessType = BusinessType.DELETE) public BaseResponse delete(@RequestBody DeptUserEntity deptUserEntity) { - // 判断此用户是否创建单据 + // 判断此用户是否创建单据 List ioOrderEntities = ioOrderService.selectList(deptUserEntity.getUserId()); - if( ioOrderEntities != null && ioOrderEntities.size() != 0 ){ - return ResultVOUtils.error(500,"该用户已创建单据,不能移除!"); + if (ioOrderEntities != null && ioOrderEntities.size() != 0) { + return ResultVOUtils.error(500, "该用户已创建单据,不能移除!"); } //判断此用户是否与仓库有关联 List listWareHouse = warehouseUserService.selectCodeByUser(deptUserEntity.getUserId() + ""); - if( listWareHouse != null && listWareHouse.size() != 0){ - return ResultVOUtils.error(500,"该用户已绑定仓库,不能移除!"); + if (listWareHouse != null && listWareHouse.size() != 0) { + return ResultVOUtils.error(500, "该用户已绑定仓库,不能移除!"); } //判断此用户是否与除一级部门 还绑定其他部门 FilterDeptUserReqeust filterDeptUserReqeust = new FilterDeptUserReqeust(); filterDeptUserReqeust.setUserId(deptUserEntity.getUserId()); List deptUserEntities = deptUserService.selectDeptUser(filterDeptUserReqeust); - if( deptUserEntities != null && deptUserEntities.size()>1){ - return ResultVOUtils.error(500,"该用户已绑定多个部门,不能移除!"); + for (int i = 0; i < deptUserEntities.size(); i++) { + if (deptUserEntities.get(i).getDeptId() == 1) { + deptUserEntities.remove(deptUserEntities.get(i)); + } + } + if (deptUserEntities != null && deptUserEntities.size() > 1) { + return ResultVOUtils.error(500, "该用户已绑定多个部门,不能移除!"); } diff --git a/src/main/java/com/glxp/api/controller/auth/InvBusUserController.java b/src/main/java/com/glxp/api/controller/auth/InvBusUserController.java index 53c6c52f..c0c5fad0 100644 --- a/src/main/java/com/glxp/api/controller/auth/InvBusUserController.java +++ b/src/main/java/com/glxp/api/controller/auth/InvBusUserController.java @@ -1,6 +1,7 @@ package com.glxp.api.controller.auth; import cn.hutool.core.collection.CollUtil; +import cn.hutool.core.util.IdUtil; import com.github.pagehelper.PageInfo; import com.glxp.api.annotation.AuthRuleAnnotation; import com.glxp.api.annotation.Log; @@ -131,15 +132,16 @@ public class InvBusUserController { @PostMapping("/spms/bus/user/warehouse/post") @Log(title = "用户管理", businessType = BusinessType.INSERT) public BaseResponse postRes(@RequestBody UpdateUserRelBusRequset relBusRequset) { - boolean b = invBusUserService.deleteByUnion(relBusRequset.getUserId(), relBusRequset.getSubInvCode()); if (CollUtil.isNotEmpty(relBusRequset.getSelectActions())) { + invBusUserService.deleteByUnion(relBusRequset.getUserId(), relBusRequset.getSubInvCode()); relBusRequset.getSelectActions().forEach(action -> { InvBusUserEntity invBusUserEntity = new InvBusUserEntity(); invBusUserEntity.setUserId(relBusRequset.getUserId()); invBusUserEntity.setSubInvCode(relBusRequset.getSubInvCode()); invBusUserEntity.setScAction(action); - invBusUserService.insertInvBusUser(invBusUserEntity); + invBusUserEntity.setId(IdUtil.getSnowflakeNextId()); + invBusUserService.save(invBusUserEntity); }); } InvBusUserEntity invBusUserEntity = new InvBusUserEntity(); diff --git a/src/main/java/com/glxp/api/controller/auth/SysUserController.java b/src/main/java/com/glxp/api/controller/auth/SysUserController.java index 3beeeb25..f064d3f4 100644 --- a/src/main/java/com/glxp/api/controller/auth/SysUserController.java +++ b/src/main/java/com/glxp/api/controller/auth/SysUserController.java @@ -3,6 +3,7 @@ package com.glxp.api.controller.auth; import cn.dev33.satoken.annotation.SaCheckPermission; import cn.hutool.core.collection.CollUtil; +import cn.hutool.core.util.IdUtil; import cn.hutool.core.util.ObjectUtil; import com.github.pagehelper.PageInfo; import com.glxp.api.annotation.Log; @@ -73,24 +74,24 @@ public class SysUserController extends BaseController { AuthAdminResponse authAdminResponse = new AuthAdminResponse(); BeanUtils.copyProperties(item, authAdminResponse); List roles = sysRoleService.selectRoleListByUserId(authAdminResponse.getId()); - List deptUserResponses=null; - if("key".equals(filterAuthUserRequest.getKey())){ - deptUserResponses = deptUserService.selectByUserIdKey(authAdminResponse.getId()); - }else{ - deptUserResponses = deptUserService.selectByUserId(authAdminResponse.getId()); + List deptUserResponses = null; + if ("key".equals(filterAuthUserRequest.getKey())) { + deptUserResponses = deptUserService.selectByUserIdKey(authAdminResponse.getId()); + } else { + deptUserResponses = deptUserService.selectByUserId(authAdminResponse.getId()); } if (CollUtil.isNotEmpty(deptUserResponses)) { List depts = new ArrayList<>(); String deptName = ""; for (DeptUserResponse deptUserResponse : deptUserResponses) { - if(deptUserResponse.getDeptId()!=1){ + if (deptUserResponse.getDeptId() != 1) { depts.add(deptUserResponse.getDeptId()); deptName = deptName + "," + deptUserResponse.getDeptName(); } } - if(deptName.length()!=0){ + if (deptName.length() != 0) { authAdminResponse.setDeptName(deptName.substring(1)); - }else{ + } else { authAdminResponse.setDeptName(deptName); } authAdminResponse.setDepts(depts); @@ -194,7 +195,7 @@ public class SysUserController extends BaseController { String pid = invWarehouseService.selectParentIdByCode(authUserSaveRequest.getLocInvCode()); authAdmin.setLocDeptCode(pid); authAdmin.setLocInvCode(authUserSaveRequest.getLocInvCode()); - + authAdmin.setId(IdUtil.getSnowflakeNextId()); boolean b = userService.insertAuthAdmin(authAdmin); authAdmin = userService.findByUserName(authAdmin.getUserName()); if (!b) { @@ -212,15 +213,14 @@ public class SysUserController extends BaseController { // sysUserRole.setRoleId(sysUserRole1.getRoleId()); // userService.insertUserAuth1(sysUserRole); //默认插入第一部门 - List deptCodeList=authUserSaveRequest.getDepts(); - if(deptCodeList == null){ - deptCodeList=new ArrayList<>(); + List deptCodeList = authUserSaveRequest.getDepts(); + if (deptCodeList == null) { + deptCodeList = new ArrayList<>(); } deptCodeList.add(1L); authUserSaveRequest.setDepts(deptCodeList); - //插入部门 if (CollUtil.isNotEmpty(authUserSaveRequest.getDepts())) { List list = new ArrayList<>(); @@ -296,24 +296,24 @@ public class SysUserController extends BaseController { userService.updateAuthAdmin(authAdmin); - //默认插入第一部门 + //默认插入第一部门 ArrayList deptCodeList = new ArrayList<>(); FilterDeptUserReqeust filterDeptUserReqeust = new FilterDeptUserReqeust(); filterDeptUserReqeust.setUserId(authUserSaveRequest.getId()); List deptUserEntities = deptUserService.selectDeptUser(filterDeptUserReqeust); - if(deptUserEntities == null){ - deptCodeList.add(1L); - authUserSaveRequest.setDepts(deptCodeList); - }else{ - Boolean checkDeptId=false; + if (deptUserEntities == null) { + deptCodeList.add(1L); + authUserSaveRequest.setDepts(deptCodeList); + } else { + Boolean checkDeptId = false; for (DeptUserEntity deptUserEntity : deptUserEntities) { - if(deptUserEntity.getDeptId() == 1){ - checkDeptId=true; - }else{ + if (deptUserEntity.getDeptId() == 1) { + checkDeptId = true; + } else { deptCodeList.add(deptUserEntity.getDeptId()); } } - if(checkDeptId==false){ + if (checkDeptId == false) { deptCodeList.add(1L); authUserSaveRequest.setDepts(deptCodeList); } diff --git a/src/main/java/com/glxp/api/controller/basic/UdiRelevanceController.java b/src/main/java/com/glxp/api/controller/basic/UdiRelevanceController.java index 4e227480..46ba0cb8 100644 --- a/src/main/java/com/glxp/api/controller/basic/UdiRelevanceController.java +++ b/src/main/java/com/glxp/api/controller/basic/UdiRelevanceController.java @@ -379,12 +379,10 @@ public class UdiRelevanceController extends BaseController { //新增或修改关联 @AuthRuleAnnotation("") @PostMapping("/udi/udirel/check/udi") - public BaseResponse checkUdi(@RequestBody UdiCombineRequest udiCombineRequest) { List keys = udiCombineRequest.getKeys(); if (keys != null && keys.size() > 0) { - List datas = udiRelevanceService.batchSelectByUuid(keys); if (datas.isEmpty()) { return ResultVOUtils.success("无被选入!"); diff --git a/src/main/java/com/glxp/api/dao/auth/WarehouseBussinessTypeDao.java b/src/main/java/com/glxp/api/dao/auth/WarehouseBussinessTypeDao.java index bad14a81..c6fa891c 100644 --- a/src/main/java/com/glxp/api/dao/auth/WarehouseBussinessTypeDao.java +++ b/src/main/java/com/glxp/api/dao/auth/WarehouseBussinessTypeDao.java @@ -27,7 +27,6 @@ public interface WarehouseBussinessTypeDao extends BaseMapperPlus list); - int batchInsert(@Param("list") List list); List selectListByCode(@Param("code") String code); diff --git a/src/main/java/com/glxp/api/entity/inout/IoOrderEntity.java b/src/main/java/com/glxp/api/entity/inout/IoOrderEntity.java index b6b8fd5c..b8fbae06 100644 --- a/src/main/java/com/glxp/api/entity/inout/IoOrderEntity.java +++ b/src/main/java/com/glxp/api/entity/inout/IoOrderEntity.java @@ -243,5 +243,13 @@ public class IoOrderEntity { @TableField(value = "checkPreInOrders") private String checkPreInOrders; + + // 预验收按货位出库,退货 + @TableField(value = "checkPreInInvCode") + private String checkPreInInvCode; + + // 预验收按货位出库,退货 + @TableField(value = "checkPreInSpaceCode") + private String checkPreInSpaceCode; } diff --git a/src/main/java/com/glxp/api/res/basic/BasicBussinessTypeResponse.java b/src/main/java/com/glxp/api/res/basic/BasicBussinessTypeResponse.java index 027a6590..f1a5e85c 100644 --- a/src/main/java/com/glxp/api/res/basic/BasicBussinessTypeResponse.java +++ b/src/main/java/com/glxp/api/res/basic/BasicBussinessTypeResponse.java @@ -12,7 +12,7 @@ public class BasicBussinessTypeResponse { /** * 单据类型ID */ - private Integer id; + private Long id; /** * 单据类型编码 diff --git a/src/main/java/com/glxp/api/service/auth/impl/WarehouseBussinessTypeServiceImpl.java b/src/main/java/com/glxp/api/service/auth/impl/WarehouseBussinessTypeServiceImpl.java index a7bbb12e..2a1624b4 100644 --- a/src/main/java/com/glxp/api/service/auth/impl/WarehouseBussinessTypeServiceImpl.java +++ b/src/main/java/com/glxp/api/service/auth/impl/WarehouseBussinessTypeServiceImpl.java @@ -68,7 +68,7 @@ public class WarehouseBussinessTypeServiceImpl implements WarehouseBussinessType }); //加入新数据 - warehouseBussinessTypeDao.batchInsert(warehouseBussinessTypeEntities); + warehouseBussinessTypeDao.insertBatch(warehouseBussinessTypeEntities); } } diff --git a/src/main/java/com/glxp/api/service/basic/impl/BasicBussinessTypeServiceImpl.java b/src/main/java/com/glxp/api/service/basic/impl/BasicBussinessTypeServiceImpl.java index 2d8a6d7b..cf64ea84 100644 --- a/src/main/java/com/glxp/api/service/basic/impl/BasicBussinessTypeServiceImpl.java +++ b/src/main/java/com/glxp/api/service/basic/impl/BasicBussinessTypeServiceImpl.java @@ -84,7 +84,8 @@ public class BasicBussinessTypeServiceImpl extends ServiceImpl().eq(basicBussinessTypeEntity.getId() != null, "id", basicBussinessTypeEntity.getId())); + if (null == basicBussinessTypeEntity.getId() || !isExit) { //处理添加新单据类型时的平衡补单逻辑 if (StrUtil.isNotBlank(basicBussinessTypeEntity.getSupplementOrderType())) { //查询平衡补单的单据类型数据是否存在 diff --git a/src/main/resources/mybatis/mapper/auth/AuthAdminDao.xml b/src/main/resources/mybatis/mapper/auth/AuthAdminDao.xml index cfa6f2ca..ca9ebd5b 100644 --- a/src/main/resources/mybatis/mapper/auth/AuthAdminDao.xml +++ b/src/main/resources/mybatis/mapper/auth/AuthAdminDao.xml @@ -6,8 +6,8 @@ resultType="com.glxp.api.entity.auth.AuthAdmin"> SELECT auth_user.*, auth_dept.name deptName, auth_warehouse.name warehouseName FROM auth_user - left join auth_dept on auth_user.locDeptCode = auth_dept.code - LEFT JOIN auth_warehouse on auth_user.locInvCode = auth_warehouse.code + left join auth_dept on auth_user.locDeptCode = auth_dept.code + LEFT JOIN auth_warehouse on auth_user.locInvCode = auth_warehouse.code AND id IN @@ -27,8 +27,8 @@ = DATE_FORMAT(#{lastUpdateTime} - , '%Y-%m-%d %H:%i:%S') + , '%Y-%m-%d %H:%i:%S') >= DATE_FORMAT(#{lastUpdateTime} + , '%Y-%m-%d %H:%i:%S') ]]> @@ -77,10 +77,10 @@ - INSERT INTO auth_user( userName, passWord, lastLoginIp, lastLoginTime, createTime, userFlag + INSERT INTO auth_user( id, userName, passWord, lastLoginIp, lastLoginTime, createTime, userFlag , employeeName, CustomerId, lastModifyTime, locDeptCode, locInvCode, comments) - values - (#{userName}, + values + (#{id}, #{userName}, #{passWord}, @@ -118,9 +118,10 @@ replace - INTO auth_user(id, userName, passWord, lastLoginIp, - lastLoginTime, createTime, userFlag, lastModifyTime, employeeName, CustomerId, locDeptCode, - locInvCode, comments) + INTO auth_user(id, userName, passWord, lastLoginIp, + lastLoginTime, createTime, userFlag, lastModifyTime, employeeName, CustomerId, + locDeptCode, + locInvCode, comments) values (#{id}, #{userName}, #{passWord}, @@ -189,7 +190,7 @@ - select * ,(select name from auth_dept WHERE a.pcode = code) pName + select *, (select name from auth_dept WHERE a.pcode = code) pName FROM auth_dept a @@ -18,7 +17,7 @@ AND a.code = #{code} - AND a.name like concat('%',#{name},'%') + AND a.name like concat('%', #{name}, '%') AND a.advanceType = #{advanceType} @@ -38,15 +37,14 @@ AND a.spUse = #{spUse} - - @@ -93,7 +90,6 @@ SELECT * FROM auth_dept WHERE id = #{id} - + UPDATE auth_dept - pid=#{pid}, - name=#{name}, - code=#{code}, - advanceType=#{advanceType}, - isDefault=#{isDefault}, - status=#{status}, - updateTime=#{updateTime}, - remark=#{remark}, - level=#{level}, - pcode=#{pcode}, - remark=#{thirdId}, - remark=#{thirdId1}, - remark=#{thirdId2}, - remark=#{thirdId3}, - remark=#{thirdId4}, - spUse=#{spUse}, - - + + pid=#{pid}, + + + name=#{name}, + + + code=#{code}, + + + advanceType=#{advanceType}, + + + isDefault=#{isDefault}, + + + status=#{status}, + + + updateTime=#{updateTime}, + + + remark=#{remark}, + + + level=#{level}, + + + pcode=#{pcode}, + + + remark=#{thirdId}, + + + remark=#{thirdId1}, + + + remark=#{thirdId2}, + + + remark=#{thirdId3}, + + + remark=#{thirdId4}, + + + spUse=#{spUse}, + WHERE id = #{id} replace into auth_dept (id, pid, code, `name`, advanceType, isDefault, status, - updateTime, remark, `level`, pcode, thirdId, thirdId1, thirdId2, thirdId3, - thirdId4,spUse) values + updateTime, remark, `level`, pcode, thirdId, thirdId1, thirdId2, thirdId3, + thirdId4, spUse) values (#{item.id}, - #{item.pid}, - #{item.code}, - #{item.name}, - #{item.advanceType}, - #{item.isDefault}, - #{item.status}, - #{item.updateTime}, - #{item.remark}, #{item.level}, - #{item.pcode}, #{item.thirdId}, - #{item.thirdId1}, #{item.thirdId2}, - #{item.thirdId3}, #{item.thirdId4},#{item.spUse}) + #{item.pid}, + #{item.code}, + #{item.name}, + #{item.advanceType}, + #{item.isDefault}, + #{item.status}, + #{item.updateTime}, + #{item.remark}, #{item.level}, + #{item.pcode}, #{item.thirdId}, + #{item.thirdId1}, #{item.thirdId2}, + #{item.thirdId3}, #{item.thirdId4}, #{item.spUse}) @@ -308,28 +334,42 @@ diff --git a/src/main/resources/mybatis/mapper/auth/InvBusUserDao.xml b/src/main/resources/mybatis/mapper/auth/InvBusUserDao.xml index 897eb5cf..d12c5d48 100644 --- a/src/main/resources/mybatis/mapper/auth/InvBusUserDao.xml +++ b/src/main/resources/mybatis/mapper/auth/InvBusUserDao.xml @@ -2,7 +2,6 @@ - - replace - INTO auth_user_bustype - (userId, `subInvCode`, scAction, remark) - values ( - #{userId}, - #{subInvCode}, - #{scAction}, - #{remark} - ) + INTO auth_user_bustype + (userId, `subInvCode`, scAction, remark) + values (#{userId}, + #{subInvCode}, + #{scAction}, + #{remark}) @@ -103,27 +95,34 @@ DELETE FROM auth_user_bustype - - - AND subInvCode = #{subInvCode} - - - and scAction in - - #{item} - - - + + + AND subInvCode = #{subInvCode} + + + and scAction in + + #{item} + + + UPDATE auth_user_bustype - userId=#{userId}, - subInvCode=#{subInvCode}, - scAction=#{scAction}, - remark=#{remark}, + + userId=#{userId}, + + + subInvCode=#{subInvCode}, + + + scAction=#{scAction}, + + + remark=#{remark}, + WHERE id = #{id} - diff --git a/src/main/resources/mybatis/mapper/auth/WarehouseBussinessTypeDao.xml b/src/main/resources/mybatis/mapper/auth/WarehouseBussinessTypeDao.xml index 775664cf..54ee44bc 100644 --- a/src/main/resources/mybatis/mapper/auth/WarehouseBussinessTypeDao.xml +++ b/src/main/resources/mybatis/mapper/auth/WarehouseBussinessTypeDao.xml @@ -135,15 +135,6 @@ #{item.id,jdbcType=INTEGER} - - - insert into auth_warehouse_bustype - (code, `action`, `name`) - values - - (#{item.code,jdbcType=VARCHAR}, #{item.action,jdbcType=VARCHAR}, #{item.name,jdbcType=VARCHAR}) - -