From bd64696c00e0f78d5ae162ac9990d0a1124e05fd Mon Sep 17 00:00:00 2001 From: zds <2388969634@qq.com> Date: Tue, 15 Oct 2024 10:30:13 +0800 Subject: [PATCH] =?UTF-8?q?opt:=E5=AE=A2=E6=88=B7=E5=8A=9F=E8=83=BDwql?= =?UTF-8?q?=E6=94=B9=E6=88=90mybatis=20plus?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../impl/PrintTableTwoServiceImpl.java | 18 +- .../controller}/CustomerbaseController.java | 28 +-- .../customer/service/CustomerbaseService.java | 46 ++++ .../customer/service/dao/Customerbase.java | 68 ++++++ .../service/dao/CustomerbaseProc.java | 61 +++++ .../dao/mapper/CustomerbaseMapper.java | 13 ++ .../service/dao/mapper/CustomerbaseMapper.xml | 5 + .../dao/mapper/CustomerbaseProcMapper.java | 14 ++ .../dao/mapper/CustomerbaseProcMapper.xml | 5 + .../service/dto/CustomerbaseQuery.java | 18 ++ .../service/impl/CustomerbaseServiceImpl.java | 111 +++++++++ .../controller/FaultDeviceController.java | 1 - .../service/FaultDeviceService.java | 3 - .../master/service/CustomerbaseService.java | 70 ------ .../master/service/dto/CustomerbaseDto.java | 212 ------------------ .../service/impl/CustomerbaseServiceImpl.java | 155 ------------- .../acs/service/impl/AcsToWmsServiceImpl.java | 16 +- .../crm/service/impl/CrmToLmsServiceImpl.java | 93 ++++---- .../mes/service/impl/MesToLmsServiceImpl.java | 18 +- .../pda/st/service/impl/PrintServiceImpl.java | 35 ++- .../service/impl/ChangeServiceImpl.java | 16 +- .../service/impl/CheckOutBillServiceImpl.java | 17 +- .../wms/basedata/master/customer/index.vue | 208 ++++++----------- 23 files changed, 545 insertions(+), 686 deletions(-) rename lms/nladmin-system/src/main/java/org/nl/wms/basedata/master/{rest => customer/controller}/CustomerbaseController.java (64%) create mode 100644 lms/nladmin-system/src/main/java/org/nl/wms/basedata/master/customer/service/CustomerbaseService.java create mode 100644 lms/nladmin-system/src/main/java/org/nl/wms/basedata/master/customer/service/dao/Customerbase.java create mode 100644 lms/nladmin-system/src/main/java/org/nl/wms/basedata/master/customer/service/dao/CustomerbaseProc.java create mode 100644 lms/nladmin-system/src/main/java/org/nl/wms/basedata/master/customer/service/dao/mapper/CustomerbaseMapper.java create mode 100644 lms/nladmin-system/src/main/java/org/nl/wms/basedata/master/customer/service/dao/mapper/CustomerbaseMapper.xml create mode 100644 lms/nladmin-system/src/main/java/org/nl/wms/basedata/master/customer/service/dao/mapper/CustomerbaseProcMapper.java create mode 100644 lms/nladmin-system/src/main/java/org/nl/wms/basedata/master/customer/service/dao/mapper/CustomerbaseProcMapper.xml create mode 100644 lms/nladmin-system/src/main/java/org/nl/wms/basedata/master/customer/service/dto/CustomerbaseQuery.java create mode 100644 lms/nladmin-system/src/main/java/org/nl/wms/basedata/master/customer/service/impl/CustomerbaseServiceImpl.java delete mode 100644 lms/nladmin-system/src/main/java/org/nl/wms/basedata/master/service/CustomerbaseService.java delete mode 100644 lms/nladmin-system/src/main/java/org/nl/wms/basedata/master/service/dto/CustomerbaseDto.java delete mode 100644 lms/nladmin-system/src/main/java/org/nl/wms/basedata/master/service/impl/CustomerbaseServiceImpl.java diff --git a/lms/nladmin-system/src/main/java/org/nl/b_lms/pda/service/impl/PrintTableTwoServiceImpl.java b/lms/nladmin-system/src/main/java/org/nl/b_lms/pda/service/impl/PrintTableTwoServiceImpl.java index cfb7075..88386ab 100644 --- a/lms/nladmin-system/src/main/java/org/nl/b_lms/pda/service/impl/PrintTableTwoServiceImpl.java +++ b/lms/nladmin-system/src/main/java/org/nl/b_lms/pda/service/impl/PrintTableTwoServiceImpl.java @@ -4,6 +4,7 @@ import cn.hutool.core.util.NumberUtil; import cn.hutool.core.util.ObjectUtil; import com.alibaba.fastjson.JSONArray; import com.alibaba.fastjson.JSONObject; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import org.nl.b_lms.pda.service.PrintTableTwoService; import org.nl.b_lms.pdm.info.dao.PdmBiContainerinfo; @@ -15,6 +16,8 @@ import org.nl.modules.common.exception.BadRequestException; import org.nl.modules.wql.core.bean.WQLObject; import org.nl.modules.wql.util.SpringContextHolder; import org.nl.system.service.param.impl.SysParamServiceImpl; +import org.nl.wms.basedata.master.customer.service.dao.Customerbase; +import org.nl.wms.basedata.master.customer.service.dao.mapper.CustomerbaseMapper; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; @@ -36,6 +39,9 @@ public class PrintTableTwoServiceImpl implements PrintTableTwoService { @Autowired private IPdmBiOrderbominfoService iPdmBiOrderbominfoService; + @Autowired + private CustomerbaseMapper customerbaseMapper; + @Override @Transactional(rollbackFor = Exception.class) public JSONObject withinTable(JSONObject whereJson) { @@ -101,14 +107,18 @@ public class PrintTableTwoServiceImpl implements PrintTableTwoService { // 抬头 String BTW = "%BTW% /AF=" + LocationOfBTW + "/R=3 /PRN=" + "\"" + jsonPrint.getString("print_floder") + "\"" + " /D /P /C=1"; // 标签类型: 查询客户信息中配置的打印模版,根据模版找到字典配置的参数 - JSONObject jsonCust = WQLObject.getWQLObject("md_cs_customerbase") - .query("cust_code = '" + subDao.getCustomer_name() + "' AND is_delete = '0' AND is_used = '1'") - .uniqueResult(0); + LambdaQueryWrapper lam = new LambdaQueryWrapper(); + lam.eq(Customerbase::getCust_code,subDao.getCustomer_name()); + lam.eq(Customerbase::getIs_delete,"0"); + lam.eq(Customerbase::getIs_used,"1"); + Customerbase jsonCust = customerbaseMapper.selectOne(lam); + + if (ObjectUtil.isEmpty(jsonCust)) { throw new BadRequestException("客户【"+subDao.getCustomer_description()+"】不存在或未启用!"); } JSONObject jsonDict = WQLObject.getWQLObject("sys_dict") - .query("code = 'two_print_temple' AND value = '" + jsonCust.getString("bz_print_within") + "'") + .query("code = 'two_print_temple' AND value = '" + jsonCust.getBz_print_within() + "'") .uniqueResult(0); if (ObjectUtil.isEmpty(jsonDict)) { throw new BadRequestException("客户【"+subDao.getCustomer_description()+"】未找到对应的打印模版,请检查是否在客户信息中配置!"); diff --git a/lms/nladmin-system/src/main/java/org/nl/wms/basedata/master/rest/CustomerbaseController.java b/lms/nladmin-system/src/main/java/org/nl/wms/basedata/master/customer/controller/CustomerbaseController.java similarity index 64% rename from lms/nladmin-system/src/main/java/org/nl/wms/basedata/master/rest/CustomerbaseController.java rename to lms/nladmin-system/src/main/java/org/nl/wms/basedata/master/customer/controller/CustomerbaseController.java index 54fe7ff..4f81c8e 100644 --- a/lms/nladmin-system/src/main/java/org/nl/wms/basedata/master/rest/CustomerbaseController.java +++ b/lms/nladmin-system/src/main/java/org/nl/wms/basedata/master/customer/controller/CustomerbaseController.java @@ -1,18 +1,19 @@ -package org.nl.wms.basedata.master.rest; +package org.nl.wms.basedata.master.customer.controller; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; +import org.nl.common.TableDataInfo; +import org.nl.common.domain.query.PageQuery; import org.nl.modules.logging.annotation.Log; -import org.nl.wms.basedata.master.service.CustomerbaseService; -import org.nl.wms.basedata.master.service.dto.CustomerbaseDto; -import org.springframework.data.domain.Pageable; +import org.nl.wms.basedata.master.customer.service.CustomerbaseService; +import org.nl.wms.basedata.master.customer.service.dao.Customerbase; +import org.nl.wms.basedata.master.customer.service.dto.CustomerbaseQuery; import org.springframework.http.HttpStatus; import org.springframework.http.ResponseEntity; import org.springframework.validation.annotation.Validated; import org.springframework.web.bind.annotation.*; -import java.util.Map; /** * @author ldjun @@ -20,7 +21,6 @@ import java.util.Map; **/ @RestController @RequiredArgsConstructor - @RequestMapping("/api/customerbase") @Slf4j public class CustomerbaseController { @@ -29,33 +29,25 @@ public class CustomerbaseController { @GetMapping @Log("查询客户基础表") - - //@PreAuthorize("@el.check('customerbase:list')") - public ResponseEntity query(@RequestParam Map whereJson, Pageable page) { - return new ResponseEntity<>(customerbaseService.queryAll(whereJson, page), HttpStatus.OK); + public ResponseEntity query(CustomerbaseQuery whereJson, PageQuery page) { + return new ResponseEntity<>(TableDataInfo.build(customerbaseService.queryAll(whereJson, page)), HttpStatus.OK); } @PostMapping @Log("新增客户基础表") - - //@PreAuthorize("@el.check('customerbase:add')") - public ResponseEntity create(@Validated @RequestBody CustomerbaseDto dto) { + public ResponseEntity create(@Validated @RequestBody Customerbase dto) { customerbaseService.create(dto); return new ResponseEntity<>(HttpStatus.CREATED); } @PutMapping @Log("修改客户基础表") - - //@PreAuthorize("@el.check('customerbase:edit')") - public ResponseEntity update(@Validated @RequestBody CustomerbaseDto dto) { + public ResponseEntity update(@Validated @RequestBody Customerbase dto) { customerbaseService.update(dto); return new ResponseEntity<>(HttpStatus.NO_CONTENT); } @Log("删除客户基础表") - - //@PreAuthorize("@el.check('customerbase:del')") @DeleteMapping public ResponseEntity delete(@RequestBody Long[] ids) { customerbaseService.deleteAll(ids); diff --git a/lms/nladmin-system/src/main/java/org/nl/wms/basedata/master/customer/service/CustomerbaseService.java b/lms/nladmin-system/src/main/java/org/nl/wms/basedata/master/customer/service/CustomerbaseService.java new file mode 100644 index 0000000..e728fce --- /dev/null +++ b/lms/nladmin-system/src/main/java/org/nl/wms/basedata/master/customer/service/CustomerbaseService.java @@ -0,0 +1,46 @@ +package org.nl.wms.basedata.master.customer.service; + +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.service.IService; +import org.nl.common.domain.query.PageQuery; +import org.nl.wms.basedata.master.customer.service.dao.Customerbase; +import org.nl.wms.basedata.master.customer.service.dto.CustomerbaseQuery; + + +/** + * @author ldjun + * @description 服务接口 + * @date 2021-12-06 + **/ +public interface CustomerbaseService extends IService { + + /** + * 查询数据分页 + * + * @param whereJson 条件 + * @param page 分页参数 + * @return Map + */ + IPage queryAll(CustomerbaseQuery whereJson, PageQuery page); + + /** + * 创建 + * + * @param dto / + */ + void create(Customerbase dto); + + /** + * 编辑 + * + * @param dto / + */ + void update(Customerbase dto); + + /** + * 多选删除 + * + * @param ids / + */ + void deleteAll(Long[] ids); +} diff --git a/lms/nladmin-system/src/main/java/org/nl/wms/basedata/master/customer/service/dao/Customerbase.java b/lms/nladmin-system/src/main/java/org/nl/wms/basedata/master/customer/service/dao/Customerbase.java new file mode 100644 index 0000000..ab8d02a --- /dev/null +++ b/lms/nladmin-system/src/main/java/org/nl/wms/basedata/master/customer/service/dao/Customerbase.java @@ -0,0 +1,68 @@ +package org.nl.wms.basedata.master.customer.service.dao; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.io.Serializable; + +/** + * @author: zds + * @date: 2024-09-27 + * @description: + */ +@Data +@EqualsAndHashCode(callSuper = false) +@TableName("md_cs_customerbase") +public class Customerbase implements Serializable { + + private static final long serialVersionUID = 1L; + + @TableId(value = "cust_id", type = IdType.NONE) + private String cust_id; + //客户编码 + private String cust_code; + //客户名称 + private String cust_name; + //客户简称 + private String cust_simple_name; + //公司电话 + private String corp_tele_no; + //公司地址 + private String corp_address; + //业务员 + private String sales_owner; + //创建人 + private String create_id; + //创建人姓名 + private String create_name; + //创建时间 + private String create_time; + //修改人 + private String update_id; + //修改人姓名 + private String update_name; + //修改时间 + private String update_time; + //是否启用 + private String is_used; + //是否删除 + private String is_delete; + //备注 + private String remark; + //子卷打印模板号 + private String zj_print_no; + //包装打印模板号 + private String bz_print_no; + //送货单打印模板号 + private String shd_print_no; + //送货单明细数 + private Integer shd_dtl_num; + //是否自动贴标 + private String is_auto_table; + //内标打印模版 + private String bz_print_within; + +} diff --git a/lms/nladmin-system/src/main/java/org/nl/wms/basedata/master/customer/service/dao/CustomerbaseProc.java b/lms/nladmin-system/src/main/java/org/nl/wms/basedata/master/customer/service/dao/CustomerbaseProc.java new file mode 100644 index 0000000..5c4b3d7 --- /dev/null +++ b/lms/nladmin-system/src/main/java/org/nl/wms/basedata/master/customer/service/dao/CustomerbaseProc.java @@ -0,0 +1,61 @@ +package org.nl.wms.basedata.master.customer.service.dao; + +import cn.hutool.core.bean.BeanUtil; +import cn.hutool.core.bean.copier.CopyOptions; +import com.alibaba.fastjson.JSONObject; +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.io.Serializable; + +/** + * @author: zds + * @date: 2024-09-27 + * @description: + */ +@Data +@EqualsAndHashCode(callSuper = false) +@TableName("md_cs_customerbaseproc") +public class CustomerbaseProc implements Serializable { + + private static final long serialVersionUID = 1L; + + @TableId(value = "id", type = IdType.NONE) + private String id; + //客户code + private String customer_name; + //客户名称 + private String description; + //客户简称 + private String company; + //国家 + private String country; + //省份/州 + private String state; + //城市 + private String city; + //客户地址/街道 + private String address_line1; + //邮编 + private String zip_code; + //手机号 + private String phone_number; + //传真 + private String fax_number; + //邮箱 + private String web_site; + //备注 + private String notes; + //业务员 + private String sales_owner; + //新增时间 + private String create_time; + + public void copyFrom(JSONObject source){ + BeanUtil.copyProperties(source,this, CopyOptions.create().setIgnoreNullValue(true)); + } + +} diff --git a/lms/nladmin-system/src/main/java/org/nl/wms/basedata/master/customer/service/dao/mapper/CustomerbaseMapper.java b/lms/nladmin-system/src/main/java/org/nl/wms/basedata/master/customer/service/dao/mapper/CustomerbaseMapper.java new file mode 100644 index 0000000..4abe456 --- /dev/null +++ b/lms/nladmin-system/src/main/java/org/nl/wms/basedata/master/customer/service/dao/mapper/CustomerbaseMapper.java @@ -0,0 +1,13 @@ +package org.nl.wms.basedata.master.customer.service.dao.mapper; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import org.nl.wms.basedata.master.customer.service.dao.Customerbase; + +/** + * @author: zds + * @date: 2024-09-27 + * @description: + */ +public interface CustomerbaseMapper extends BaseMapper { + +} diff --git a/lms/nladmin-system/src/main/java/org/nl/wms/basedata/master/customer/service/dao/mapper/CustomerbaseMapper.xml b/lms/nladmin-system/src/main/java/org/nl/wms/basedata/master/customer/service/dao/mapper/CustomerbaseMapper.xml new file mode 100644 index 0000000..d1df625 --- /dev/null +++ b/lms/nladmin-system/src/main/java/org/nl/wms/basedata/master/customer/service/dao/mapper/CustomerbaseMapper.xml @@ -0,0 +1,5 @@ + + + + + diff --git a/lms/nladmin-system/src/main/java/org/nl/wms/basedata/master/customer/service/dao/mapper/CustomerbaseProcMapper.java b/lms/nladmin-system/src/main/java/org/nl/wms/basedata/master/customer/service/dao/mapper/CustomerbaseProcMapper.java new file mode 100644 index 0000000..c34de75 --- /dev/null +++ b/lms/nladmin-system/src/main/java/org/nl/wms/basedata/master/customer/service/dao/mapper/CustomerbaseProcMapper.java @@ -0,0 +1,14 @@ +package org.nl.wms.basedata.master.customer.service.dao.mapper; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import org.nl.wms.basedata.master.customer.service.dao.Customerbase; +import org.nl.wms.basedata.master.customer.service.dao.CustomerbaseProc; + +/** + * @author: zds + * @date: 2024-09-27 + * @description: + */ +public interface CustomerbaseProcMapper extends BaseMapper { + +} diff --git a/lms/nladmin-system/src/main/java/org/nl/wms/basedata/master/customer/service/dao/mapper/CustomerbaseProcMapper.xml b/lms/nladmin-system/src/main/java/org/nl/wms/basedata/master/customer/service/dao/mapper/CustomerbaseProcMapper.xml new file mode 100644 index 0000000..b34572a --- /dev/null +++ b/lms/nladmin-system/src/main/java/org/nl/wms/basedata/master/customer/service/dao/mapper/CustomerbaseProcMapper.xml @@ -0,0 +1,5 @@ + + + + + diff --git a/lms/nladmin-system/src/main/java/org/nl/wms/basedata/master/customer/service/dto/CustomerbaseQuery.java b/lms/nladmin-system/src/main/java/org/nl/wms/basedata/master/customer/service/dto/CustomerbaseQuery.java new file mode 100644 index 0000000..5dc53dc --- /dev/null +++ b/lms/nladmin-system/src/main/java/org/nl/wms/basedata/master/customer/service/dto/CustomerbaseQuery.java @@ -0,0 +1,18 @@ +package org.nl.wms.basedata.master.customer.service.dto; + +import lombok.Data; + +import java.io.Serializable; + +/** + * @author: zds + * @date: 2024-09-27 + * @description: + */ +@Data +public class CustomerbaseQuery implements Serializable { + //编码或名称 + private String search; + //是否启用 + private String is_used; +} diff --git a/lms/nladmin-system/src/main/java/org/nl/wms/basedata/master/customer/service/impl/CustomerbaseServiceImpl.java b/lms/nladmin-system/src/main/java/org/nl/wms/basedata/master/customer/service/impl/CustomerbaseServiceImpl.java new file mode 100644 index 0000000..d0eaf94 --- /dev/null +++ b/lms/nladmin-system/src/main/java/org/nl/wms/basedata/master/customer/service/impl/CustomerbaseServiceImpl.java @@ -0,0 +1,111 @@ +package org.nl.wms.basedata.master.customer.service.impl; + + +import cn.hutool.core.date.DateUtil; +import cn.hutool.core.util.IdUtil; +import cn.hutool.core.util.ObjectUtil; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import lombok.extern.slf4j.Slf4j; +import org.nl.common.domain.query.PageQuery; +import org.nl.common.utils.SecurityUtils; +import org.nl.modules.common.exception.BadRequestException; +import org.nl.wms.basedata.master.customer.service.CustomerbaseService; +import org.nl.wms.basedata.master.customer.service.dao.Customerbase; +import org.nl.wms.basedata.master.customer.service.dao.mapper.CustomerbaseMapper; +import org.nl.wms.basedata.master.customer.service.dto.CustomerbaseQuery; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + + +/** + * @author ldjun + * @description 服务实现 + * @date 2021-12-06 + **/ +@Service +@Slf4j +public class CustomerbaseServiceImpl extends ServiceImpl implements CustomerbaseService { + + @Autowired + private CustomerbaseMapper customerbaseMapper; + + @Override + public IPage queryAll(CustomerbaseQuery whereJson, PageQuery page) { + IPage pages = new Page<>(page.getPage() + 1, page.getSize()); + LambdaQueryWrapper lam = new LambdaQueryWrapper(); + + lam.eq(ObjectUtil.isNotEmpty(whereJson.getIs_used()), Customerbase::getIs_used, whereJson.getIs_used()) + .and(ObjectUtil.isNotEmpty(whereJson.getSearch()),blam -> blam.like(Customerbase::getCust_name, whereJson.getSearch()).or() + .like(Customerbase::getCust_code, whereJson.getSearch())) + .orderByDesc(Customerbase::getCust_code); + customerbaseMapper.selectPage(pages, lam); + return pages; + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void create(Customerbase dto) { + LambdaQueryWrapper lam = new LambdaQueryWrapper(); + lam.eq(Customerbase::getCust_code,dto.getCust_code()); + lam.eq(Customerbase::getIs_delete,"0"); + Customerbase customer = customerbaseMapper.selectOne(lam); + if (ObjectUtil.isNotEmpty(customer)) { + throw new BadRequestException("已存在相同的客户编号!"); + } + + String currentUserId = SecurityUtils.getCurrentUserId(); + String nickName = SecurityUtils.getCurrentNickName(); + String now = DateUtil.now(); + + dto.setCust_id(IdUtil.getSnowflake(1, 1).nextId()+""); + dto.setCreate_id(currentUserId); + dto.setCreate_name(nickName); + dto.setCreate_time(now); + customerbaseMapper.insert(dto); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(Customerbase dto) { + LambdaQueryWrapper lam = new LambdaQueryWrapper(); + lam.eq(Customerbase::getCust_code,dto.getCust_code()); + lam.eq(Customerbase::getIs_delete,"0"); + lam.ne(Customerbase::getCust_id,dto.getCust_id()); + Customerbase customer = customerbaseMapper.selectOne(lam); + if (ObjectUtil.isNotEmpty(customer)) { + throw new BadRequestException("已存在相同的客户编号!"); + } + + String currentUserId = SecurityUtils.getCurrentUserId(); + String nickName = SecurityUtils.getCurrentNickName(); + String now = DateUtil.now(); + + dto.setUpdate_time(now); + dto.setUpdate_id(currentUserId); + dto.setUpdate_name(nickName); + customerbaseMapper.updateById(dto); + + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void deleteAll(Long[] ids) { + String currentUserId = SecurityUtils.getCurrentUserId(); + String nickName = SecurityUtils.getCurrentNickName(); + String now = DateUtil.now(); + //设置更新条件 + LambdaUpdateWrapper lam = new LambdaUpdateWrapper(); + lam.in(Customerbase::getCust_id,ids); + + lam.set(Customerbase::getIs_delete, "1"); + lam.set(Customerbase::getUpdate_id, currentUserId); + lam.set(Customerbase::getUpdate_name, nickName); + lam.set(Customerbase::getUpdate_time, now); + customerbaseMapper.update(null,lam); + } +} diff --git a/lms/nladmin-system/src/main/java/org/nl/wms/basedata/master/faultdevice/controller/FaultDeviceController.java b/lms/nladmin-system/src/main/java/org/nl/wms/basedata/master/faultdevice/controller/FaultDeviceController.java index 8bfadb4..746ca13 100644 --- a/lms/nladmin-system/src/main/java/org/nl/wms/basedata/master/faultdevice/controller/FaultDeviceController.java +++ b/lms/nladmin-system/src/main/java/org/nl/wms/basedata/master/faultdevice/controller/FaultDeviceController.java @@ -1,7 +1,6 @@ package org.nl.wms.basedata.master.faultdevice.controller; -import com.alibaba.fastjson.JSONObject; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; import org.nl.common.TableDataInfo; diff --git a/lms/nladmin-system/src/main/java/org/nl/wms/basedata/master/faultdevice/service/FaultDeviceService.java b/lms/nladmin-system/src/main/java/org/nl/wms/basedata/master/faultdevice/service/FaultDeviceService.java index 5de4290..cb7d6f2 100644 --- a/lms/nladmin-system/src/main/java/org/nl/wms/basedata/master/faultdevice/service/FaultDeviceService.java +++ b/lms/nladmin-system/src/main/java/org/nl/wms/basedata/master/faultdevice/service/FaultDeviceService.java @@ -1,15 +1,12 @@ package org.nl.wms.basedata.master.faultdevice.service; -import com.alibaba.fastjson.JSONObject; import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.extension.service.IService; import org.nl.common.domain.query.PageQuery; import org.nl.wms.basedata.master.faultdevice.service.dao.FaultDevice; import org.nl.wms.basedata.master.faultdevice.service.dto.FaultQuery; -import org.nl.wms.basedata.master.service.dto.CustomerbaseDto; import org.springframework.data.domain.Pageable; -import java.util.List; import java.util.Map; /** diff --git a/lms/nladmin-system/src/main/java/org/nl/wms/basedata/master/service/CustomerbaseService.java b/lms/nladmin-system/src/main/java/org/nl/wms/basedata/master/service/CustomerbaseService.java deleted file mode 100644 index 3173188..0000000 --- a/lms/nladmin-system/src/main/java/org/nl/wms/basedata/master/service/CustomerbaseService.java +++ /dev/null @@ -1,70 +0,0 @@ -package org.nl.wms.basedata.master.service; - -import org.nl.wms.basedata.master.service.dto.CustomerbaseDto; -import org.springframework.data.domain.Pageable; - -import java.util.List; -import java.util.Map; - -/** - * @author ldjun - * @description 服务接口 - * @date 2021-12-06 - **/ -public interface CustomerbaseService { - - /** - * 查询数据分页 - * - * @param whereJson 条件 - * @param page 分页参数 - * @return Map - */ - Map queryAll(Map whereJson, Pageable page); - - /** - * 查询所有数据不分页 - * - * @param whereJson 条件参数 - * @return List - */ - List queryAll(Map whereJson); - - /** - * 根据ID查询 - * - * @param cust_id ID - * @return Customerbase - */ - CustomerbaseDto findById(Long cust_id); - - /** - * 根据编码查询 - * - * @param code code - * @return Customerbase - */ - CustomerbaseDto findByCode(String code); - - - /** - * 创建 - * - * @param dto / - */ - void create(CustomerbaseDto dto); - - /** - * 编辑 - * - * @param dto / - */ - void update(CustomerbaseDto dto); - - /** - * 多选删除 - * - * @param ids / - */ - void deleteAll(Long[] ids); -} diff --git a/lms/nladmin-system/src/main/java/org/nl/wms/basedata/master/service/dto/CustomerbaseDto.java b/lms/nladmin-system/src/main/java/org/nl/wms/basedata/master/service/dto/CustomerbaseDto.java deleted file mode 100644 index eef63eb..0000000 --- a/lms/nladmin-system/src/main/java/org/nl/wms/basedata/master/service/dto/CustomerbaseDto.java +++ /dev/null @@ -1,212 +0,0 @@ -package org.nl.wms.basedata.master.service.dto; - -import com.fasterxml.jackson.databind.annotation.JsonSerialize; -import com.fasterxml.jackson.databind.ser.std.ToStringSerializer; -import lombok.Data; - -import java.io.Serializable; - -/** - * @author ldjun - * @description / - * @date 2021-12-06 - **/ -@Data -public class CustomerbaseDto implements Serializable { - /** 客户标识 */ - /** - * 防止精度丢失 - */ - @JsonSerialize(using = ToStringSerializer.class) - private Long cust_id; - - /** - * 客户编码 - */ - private String cust_code; - - /** - * 客户名称 - */ - private String cust_name; - - /** - * 业务员 - */ - private String sales_owner; - - /** - * 客户简称 - */ - private String cust_simple_name; - - /** - * 国家 - */ - private String country; - - /** - * 省份 - */ - private String state; - - /** - * 城市 - */ - private String city; - - /** - * 传真 - */ - private String faxnumber; - - /** - * 邮箱 - */ - private String webSite; - - /** - * 法人代表 - */ - private String jurid_name; - - /** - * 税务登记号 - */ - private String tax_no; - - /** - * 工商注册号 - */ - private String register_no; - - /** - * 经营许可证号 - */ - private String manage_lice_no; - - /** - * 营业执照 - */ - private String busi_char_name; - - /** - * 行政区划 - */ - private Long area_id; - - /** - * 邮政编码 - */ - private String zip_code; - - /** - * 公司电话 - */ - private String corp_tele_no; - - /** - * 公司地址 - */ - private String corp_address; - - /** - * 创建人 - */ - private String create_id; - - /** - * 创建人姓名 - */ - private String create_name; - - /** - * 创建时间 - */ - private String create_time; - - /** - * 修改人 - */ - private String update_optid; - - /** - * 修改人姓名 - */ - private String update_optname; - - /** - * 修改时间 - */ - private String update_time; - - /** - * 启用时间 - */ - private String is_used_time; - - /** - * 是否启用 - */ - private String is_used; - - /** - * 是否删除 - */ - private String is_delete; - - /** - * 外部标识 - */ - private String ext_id; - - /** - * 备注 - */ - private String remark; - - /** - * 分类标识 - */ - private Long class_id; - - /** - * 分类编码 - */ - private String class_code; - - /** - * 分类名称 - */ - private String class_name; - - /** - * 子卷打印模板号 - */ - private String zj_print_no; - - /** - * 包装打印模板号 - */ - private String bz_print_no; - - /** - * 送货单打印模板号 - */ - private String shd_print_no; - - /** - * 送货单明细数 - */ - private String shd_dtl_num; - - /** - * 是否自动贴标 - */ - private String is_auto_table; - - /** - * 内标打印模版 - */ - private String bz_print_within; -} diff --git a/lms/nladmin-system/src/main/java/org/nl/wms/basedata/master/service/impl/CustomerbaseServiceImpl.java b/lms/nladmin-system/src/main/java/org/nl/wms/basedata/master/service/impl/CustomerbaseServiceImpl.java deleted file mode 100644 index 03f1aab..0000000 --- a/lms/nladmin-system/src/main/java/org/nl/wms/basedata/master/service/impl/CustomerbaseServiceImpl.java +++ /dev/null @@ -1,155 +0,0 @@ -package org.nl.wms.basedata.master.service.impl; - - -import cn.hutool.core.date.DateUtil; -import cn.hutool.core.util.IdUtil; -import cn.hutool.core.util.ObjectUtil; -import cn.hutool.core.util.StrUtil; -import com.alibaba.fastjson.JSON; -import com.alibaba.fastjson.JSONArray; -import com.alibaba.fastjson.JSONObject; -import lombok.RequiredArgsConstructor; -import lombok.extern.slf4j.Slf4j; -import org.nl.common.utils.SecurityUtils; -import org.nl.modules.common.exception.BadRequestException; -import org.nl.modules.wql.core.bean.ResultBean; -import org.nl.modules.wql.core.bean.WQLObject; -import org.nl.modules.wql.util.WqlUtil; -import org.nl.wms.basedata.master.service.ClassstandardService; -import org.nl.wms.basedata.master.service.CustomerbaseService; -import org.nl.wms.basedata.master.service.dto.CustomerbaseDto; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.data.domain.Pageable; -import org.springframework.stereotype.Service; -import org.springframework.transaction.annotation.Transactional; - -import java.util.List; -import java.util.Map; - -/** - * @author ldjun - * @description 服务实现 - * @date 2021-12-06 - **/ -@Service -@RequiredArgsConstructor -@Slf4j -public class CustomerbaseServiceImpl implements CustomerbaseService { - @Autowired - private ClassstandardService classstandardService; - - @Override - public Map queryAll(Map whereJson, Pageable page) { - String where = ""; - WQLObject wo = WQLObject.getWQLObject("md_cs_customerbase"); - String search = (String) whereJson.get("search"); - if (!StrUtil.isEmpty(search)) { - where = "AND (cust_code like '%" + search + "%' OR cust_name like '%" + search + "%')"; - } - ResultBean rb = wo.pagequery(WqlUtil.getHttpContext(page), "is_delete = '0'" + where, "update_time desc"); - final JSONObject json = rb.pageResult(); - return json; - } - - @Override - public List queryAll(Map whereJson) { - WQLObject wo = WQLObject.getWQLObject("md_cs_customerbase"); - JSONArray arr = wo.query().getResultJSONArray(0); - List list = arr.toJavaList(CustomerbaseDto.class); - return list; - } - - @Override - public CustomerbaseDto findById(Long cust_id) { - WQLObject wo = WQLObject.getWQLObject("md_cs_customerbase"); - JSONObject json = wo.query("cust_id =" + cust_id + "").uniqueResult(0); - if (ObjectUtil.isEmpty(json)) { - return null; - } - final CustomerbaseDto obj = json.toJavaObject(CustomerbaseDto.class); - return obj; - } - - @Override - public CustomerbaseDto findByCode(String code) { - WQLObject wo = WQLObject.getWQLObject("md_cs_customerbase"); - JSONObject json = wo.query("cust_code ='" + code + "'").uniqueResult(0); - if (ObjectUtil.isEmpty(json)) { - return null; - } - final CustomerbaseDto obj = json.toJavaObject(CustomerbaseDto.class); - return obj; - } - - @Override - @Transactional(rollbackFor = Exception.class) - public void create(CustomerbaseDto dto) { - String cust_code = dto.getCust_code(); - CustomerbaseDto customerbaseDto = this.findByCode(cust_code); - if (customerbaseDto != null && "0".equals(customerbaseDto.getIs_delete())) { - throw new BadRequestException("存在相同的客户编号"); - } - - String currentUserId = SecurityUtils.getCurrentUserId(); - String nickName = SecurityUtils.getCurrentNickName(); - String now = DateUtil.now(); - - dto.setCust_id(IdUtil.getSnowflake(1, 1).nextId()); - dto.setCreate_id(currentUserId); - dto.setCreate_name(nickName); - dto.setUpdate_optid(currentUserId); - dto.setUpdate_optname(nickName); - dto.setUpdate_time(now); - dto.setCreate_time(now); - - WQLObject wo = WQLObject.getWQLObject("md_cs_customerbase"); - JSONObject json = JSONObject.parseObject(JSON.toJSONString(dto)); - wo.insert(json); - } - - @Override - @Transactional(rollbackFor = Exception.class) - public void update(CustomerbaseDto dto) { - CustomerbaseDto entity = this.findById(dto.getCust_id()); - if (entity == null) { - throw new BadRequestException("被删除或无权限,操作失败!"); - } - - String cust_code = dto.getCust_code(); - CustomerbaseDto customerbaseDto = this.findByCode(cust_code); - if (customerbaseDto != null && !customerbaseDto.getCust_id().equals(dto.getCust_id()) && "0".equals(customerbaseDto.getIs_delete())) { - throw new BadRequestException("存在相同的客户编号"); - } - - String currentUserId = SecurityUtils.getCurrentUserId(); - String nickName = SecurityUtils.getCurrentNickName(); - - String now = DateUtil.now(); - dto.setUpdate_time(now); - dto.setUpdate_optid(currentUserId); - dto.setUpdate_optname(nickName); - - WQLObject wo = WQLObject.getWQLObject("md_cs_customerbase"); - JSONObject json = JSONObject.parseObject(JSON.toJSONString(dto)); - wo.update(json); - } - - @Override - @Transactional(rollbackFor = Exception.class) - public void deleteAll(Long[] ids) { - String currentUserId = SecurityUtils.getCurrentUserId(); - String nickName = SecurityUtils.getCurrentNickName(); - String now = DateUtil.now(); - - WQLObject wo = WQLObject.getWQLObject("md_cs_customerbase"); - for (Long cust_id : ids) { - JSONObject param = new JSONObject(); - param.put("cust_id", String.valueOf(cust_id)); - param.put("is_delete", "1"); - param.put("update_optid", currentUserId); - param.put("update_optname", nickName); - param.put("update_time", now); - wo.update(param); - } - } -} diff --git a/lms/nladmin-system/src/main/java/org/nl/wms/ext/acs/service/impl/AcsToWmsServiceImpl.java b/lms/nladmin-system/src/main/java/org/nl/wms/ext/acs/service/impl/AcsToWmsServiceImpl.java index 3341c27..62234e9 100644 --- a/lms/nladmin-system/src/main/java/org/nl/wms/ext/acs/service/impl/AcsToWmsServiceImpl.java +++ b/lms/nladmin-system/src/main/java/org/nl/wms/ext/acs/service/impl/AcsToWmsServiceImpl.java @@ -44,6 +44,8 @@ import org.nl.modules.wql.util.SpringContextHolder; import org.nl.system.service.notice.ISysNoticeService; import org.nl.system.service.param.ISysParamService; import org.nl.system.service.param.impl.SysParamServiceImpl; +import org.nl.wms.basedata.master.customer.service.dao.Customerbase; +import org.nl.wms.basedata.master.customer.service.dao.mapper.CustomerbaseMapper; import org.nl.wms.ext.acs.service.AcsToWmsService; import org.nl.wms.pda.mps.eum.RegionTypeEnum; import org.nl.wms.pda.mps.service.CasingService; @@ -96,6 +98,9 @@ public class AcsToWmsServiceImpl implements AcsToWmsService { private final ISysNoticeService noticeService; + @Autowired + private CustomerbaseMapper customerbaseMapper; + /** * 入库处理类服务 */ @@ -788,12 +793,15 @@ public class AcsToWmsServiceImpl implements AcsToWmsService { * 判断此客户是否是自动贴标 */ // 查询客户 - JSONObject jsonCust = WQLObject.getWQLObject("md_cs_customerbase").query("cust_code = '" + sub_jo.getString("customer_name") + "'").uniqueResult(0); - if (ObjectUtil.isEmpty(jsonCust)) { + LambdaQueryWrapper lam = new LambdaQueryWrapper(); + lam.eq(Customerbase::getCust_code,sub_jo.getString("customer_name")); + lam.eq(Customerbase::getIs_delete,"0"); + Customerbase customer = customerbaseMapper.selectOne(lam); + if (ObjectUtil.isEmpty(customer)) { throw new BadRequestException("客户不存在请检查!"); } JSONObject data = new JSONObject(); - data.put("is_auto_table", jsonCust.getString("is_auto_table")); + data.put("is_auto_table", customer.getIs_auto_table()); //判断系统参数是否贴标 String is_labeling = SpringContextHolder.getBean(SysParamServiceImpl.class).findByCode("is_labeling").getValue(); @@ -808,7 +816,7 @@ public class AcsToWmsServiceImpl implements AcsToWmsService { } // 判断是否贴标 - if (!StrUtil.equals(jsonCust.getString("is_auto_table"), "1")) { + if (!StrUtil.equals(customer.getIs_auto_table(), "1")) { result.put("data", data); return result; } diff --git a/lms/nladmin-system/src/main/java/org/nl/wms/ext/crm/service/impl/CrmToLmsServiceImpl.java b/lms/nladmin-system/src/main/java/org/nl/wms/ext/crm/service/impl/CrmToLmsServiceImpl.java index 3ffda61..dec7a62 100644 --- a/lms/nladmin-system/src/main/java/org/nl/wms/ext/crm/service/impl/CrmToLmsServiceImpl.java +++ b/lms/nladmin-system/src/main/java/org/nl/wms/ext/crm/service/impl/CrmToLmsServiceImpl.java @@ -6,12 +6,17 @@ import cn.hutool.core.util.ObjectUtil; import cn.hutool.core.util.StrUtil; import com.alibaba.fastjson.JSONArray; import com.alibaba.fastjson.JSONObject; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; import org.nl.common.utils.SecurityUtils; import org.nl.modules.wql.WQL; -import org.nl.modules.wql.core.bean.WQLObject; +import org.nl.wms.basedata.master.customer.service.dao.Customerbase; +import org.nl.wms.basedata.master.customer.service.dao.CustomerbaseProc; +import org.nl.wms.basedata.master.customer.service.dao.mapper.CustomerbaseMapper; +import org.nl.wms.basedata.master.customer.service.dao.mapper.CustomerbaseProcMapper; import org.nl.wms.ext.crm.service.CrmToLmsService; +import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import java.util.HashMap; @@ -20,69 +25,59 @@ import java.util.HashMap; @RequiredArgsConstructor @Slf4j public class CrmToLmsServiceImpl implements CrmToLmsService { + + @Autowired + private CustomerbaseMapper customerbaseMapper; + + @Autowired + private CustomerbaseProcMapper customerbaseProcMapper; @Override public JSONObject getCustomerInfo(JSONObject row) { String customer_name = row.getString("CustomerName"); String description = row.getString("Description"); String company = row.getString("Company"); - String country = row.getString("Country"); - String state = row.getString("State"); - String city = row.getString("City"); - String address_line1 = row.getString("AddressLine1"); - String zip_code = row.getString("ZipCode"); - String phone_number = row.getString("PhoneNumber"); - String fax_number = row.getString("FaxNumber"); - String web_site = row.getString("WebSite"); - String notes = row.getString("Notes"); String sales_owner = row.getString("SalesOwner"); - JSONObject jo = new JSONObject(); - jo.put("id", IdUtil.getSnowflake(1, 1).nextId()); - jo.put("customer_name", customer_name); - jo.put("description", description); - jo.put("company", company); - jo.put("country", country); - jo.put("state", state); - jo.put("city", city); - jo.put("address_line1", address_line1); - jo.put("zip_code", zip_code); - jo.put("phone_number", phone_number); - jo.put("fax_number", fax_number); - jo.put("web_site", web_site); - jo.put("notes", notes); - jo.put("sales_owner", sales_owner); - WQLObject.getWQLObject("MD_CS_CustomerBaseProc").insert(jo); - log.info(jo.toString()); //插入客户表 String currentUserId = SecurityUtils.getCurrentUserId(); String nickName = SecurityUtils.getCurrentNickName(); String now = DateUtil.now(); - JSONObject customer_jo = WQLObject.getWQLObject("md_cs_customerbase").query("cust_code = '" + customer_name + "'").uniqueResult(0); - if (ObjectUtil.isEmpty(customer_jo)) { - customer_jo = new JSONObject(); - customer_jo.put("cust_id", IdUtil.getSnowflake(1, 1).nextId()); - customer_jo.put("cust_code", customer_name); - customer_jo.put("cust_name", description); - customer_jo.put("cust_simple_name", company); - customer_jo.put("sales_owner", sales_owner); - customer_jo.put("create_id", currentUserId); - customer_jo.put("create_name", nickName); - customer_jo.put("create_time", now); - customer_jo.put("update_optid", currentUserId); - customer_jo.put("update_optname", nickName); - customer_jo.put("update_time", now); - WQLObject.getWQLObject("md_cs_customerbase").insert(customer_jo); + CustomerbaseProc customerbaseProc = new CustomerbaseProc(); + customerbaseProc.copyFrom(row); + JSONObject jo = new JSONObject(); + customerbaseProc.setId(IdUtil.getSnowflake(1, 1).nextId()+""); + customerbaseProc.setCreate_time(now); + customerbaseProcMapper.insert(customerbaseProc); + log.info(customerbaseProc.toString()); + + + LambdaQueryWrapper lam = new LambdaQueryWrapper(); + lam.eq(Customerbase::getCust_code,customer_name); + lam.eq(Customerbase::getIs_delete,"0"); + Customerbase customer = customerbaseMapper.selectOne(lam); + + if (ObjectUtil.isEmpty(customer)) { + customer = new Customerbase(); + customer.setCust_id(IdUtil.getSnowflake(1, 1).nextId()+""); + customer.setCust_code(customer_name); + customer.setCust_name(description); + customer.setCust_simple_name(company); + customer.setSales_owner(sales_owner); + customer.setCreate_id(currentUserId); + customer.setCreate_name(nickName); + customer.setCreate_time(now); + customerbaseMapper.insert(customer); } else { - customer_jo.put("cust_name", description); - customer_jo.put("cust_simple_name", company); - customer_jo.put("sales_owner", sales_owner); - customer_jo.put("update_optid", currentUserId); - customer_jo.put("update_optname", nickName); - customer_jo.put("update_time", now); - WQLObject.getWQLObject("md_cs_customerbase").update(customer_jo); + customer.setCust_name(description); + customer.setCust_simple_name(company); + customer.setSales_owner(sales_owner); + customer.setUpdate_id(currentUserId); + customer.setUpdate_name(nickName); + customer.setUpdate_time(now); + customerbaseMapper.updateById(customer); } diff --git a/lms/nladmin-system/src/main/java/org/nl/wms/ext/mes/service/impl/MesToLmsServiceImpl.java b/lms/nladmin-system/src/main/java/org/nl/wms/ext/mes/service/impl/MesToLmsServiceImpl.java index fa7be64..4d101eb 100644 --- a/lms/nladmin-system/src/main/java/org/nl/wms/ext/mes/service/impl/MesToLmsServiceImpl.java +++ b/lms/nladmin-system/src/main/java/org/nl/wms/ext/mes/service/impl/MesToLmsServiceImpl.java @@ -26,7 +26,6 @@ import org.nl.b_lms.pdm.info.dao.PdmBiContainerinfo; import org.nl.b_lms.pdm.info.dao.PdmBiOrderbominfo; import org.nl.b_lms.pdm.info.service.IPdmBiContainerinfoService; import org.nl.b_lms.pdm.info.service.IPdmBiOrderbominfoService; -import org.nl.b_lms.pdm.subpackagerelation.dao.PdmBiSubpackagerelation; import org.nl.b_lms.pdm.subpackagerelation.service.IpdmBiSubpackagerelationService; import org.nl.b_lms.sch.point.dao.BstIvtPackageinfoivt; import org.nl.b_lms.sch.point.service.IbstIvtPackageinfoivtService; @@ -44,12 +43,13 @@ import org.nl.modules.wql.WQL; import org.nl.modules.wql.core.bean.WQLObject; import org.nl.modules.wql.util.SpringContextHolder; import org.nl.system.service.param.impl.SysParamServiceImpl; +import org.nl.wms.basedata.master.customer.service.dao.Customerbase; +import org.nl.wms.basedata.master.customer.service.dao.mapper.CustomerbaseMapper; import org.nl.wms.ext.acs.service.WmsToAcsService; import org.nl.wms.ext.mes.service.MesToLmsService; import org.nl.wms.pda.mps.service.InService; import org.nl.wms.pda.mps.service.OutService; import org.nl.wms.pda.mps.service.impl.BakingServiceImpl; -import org.nl.wms.pdm.bi.service.dto.SubpackagerelationDto; import org.nl.wms.sch.manage.AbstractAcsTask; import org.nl.wms.sch.tasks.CoolCutTask; import org.nl.wms.st.inbill.service.CheckOutBillService; @@ -96,10 +96,10 @@ public class MesToLmsServiceImpl implements MesToLmsService { private IbstIvtPackageinfoivtService packageinfoivtService; @Autowired - private IpdmBiSubpackagerelationService subpackagerelationService; + private SlitterService slitterService; @Autowired - private SlitterService slitterService; + private CustomerbaseMapper customerbaseMapper; /** @@ -1502,11 +1502,15 @@ public class MesToLmsServiceImpl implements MesToLmsService { change_jo.put("demand_date", DemandDate); change_jo.put("customer_name", CustomerName); //查询对应的客户 - JSONObject customer_jo = WQLObject.getWQLObject("md_cs_customerbase").query("cust_code = '" + CustomerName + "'").uniqueResult(0); - if (ObjectUtil.isEmpty(customer_jo)) { + LambdaQueryWrapper lam = new LambdaQueryWrapper(); + lam.eq(Customerbase::getCust_code,CustomerName); + lam.eq(Customerbase::getIs_delete,"0"); + Customerbase customer = customerbaseMapper.selectOne(lam); + + if (ObjectUtil.isEmpty(customer)) { throw new BadRequestException("客户不存在:" + CustomerName); } - change_jo.put("customer_description", customer_jo.getString("cust_name")); + change_jo.put("customer_description", customer.getCust_name()); change_jo.put("isRePrintPackageBoxLabel", isRePrintPackageBoxLabel); change_jo.put("isUnPackBox", isUnPackBox); change_jo.put("UpdatedDateOfProduction", UpdatedDateOfProduction); diff --git a/lms/nladmin-system/src/main/java/org/nl/wms/pda/st/service/impl/PrintServiceImpl.java b/lms/nladmin-system/src/main/java/org/nl/wms/pda/st/service/impl/PrintServiceImpl.java index 37b0ea5..635fd2e 100644 --- a/lms/nladmin-system/src/main/java/org/nl/wms/pda/st/service/impl/PrintServiceImpl.java +++ b/lms/nladmin-system/src/main/java/org/nl/wms/pda/st/service/impl/PrintServiceImpl.java @@ -5,12 +5,16 @@ import cn.hutool.core.util.NumberUtil; import cn.hutool.core.util.ObjectUtil; import com.alibaba.fastjson.JSONArray; import com.alibaba.fastjson.JSONObject; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; import org.nl.modules.common.exception.BadRequestException; import org.nl.modules.wql.WQL; import org.nl.modules.wql.core.bean.WQLObject; +import org.nl.wms.basedata.master.customer.service.dao.Customerbase; +import org.nl.wms.basedata.master.customer.service.dao.mapper.CustomerbaseMapper; import org.nl.wms.pda.st.service.PrintService; +import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import java.io.*; @@ -26,6 +30,9 @@ import java.util.HashMap; @Slf4j public class PrintServiceImpl implements PrintService { + @Autowired + private CustomerbaseMapper customerbaseMapper; + @Override public JSONObject customerInfo(JSONObject whereJson) { String box_no = whereJson.getString("box_no"); @@ -40,7 +47,6 @@ public class PrintServiceImpl implements PrintService { public JSONObject customerPrint(JSONObject whereJson) { JSONObject jo = new JSONObject(); WQLObject printTab = WQLObject.getWQLObject("pdm_bi_printinfo"); - WQLObject custTab = WQLObject.getWQLObject("md_cs_customerbase"); WQLObject subTab = WQLObject.getWQLObject("pdm_bi_subpackagerelation"); String box_no = whereJson.getString("box_no"); @@ -97,15 +103,19 @@ public class PrintServiceImpl implements PrintService { String storage_conditions = ""; // 根据客户条件选择对应模板 - JSONObject jsonCust = custTab.query("cust_code = '" + box_jo.getString("customer_name") + "' and is_delete = '0' and is_used = '1'").uniqueResult(0); - if (ObjectUtil.isEmpty(jsonCust)) { + LambdaQueryWrapper lam = new LambdaQueryWrapper(); + lam.eq(Customerbase::getCust_code,box_jo.getString("customer_name")); + lam.eq(Customerbase::getIs_delete,"0"); + lam.eq(Customerbase::getIs_used,"1"); + Customerbase customer = customerbaseMapper.selectOne(lam); + if (ObjectUtil.isEmpty(customer)) { throw new BadRequestException("客户不存在或未启用"); } - if (ObjectUtil.isEmpty(jsonCust.getString("bz_print_no"))) { + String bz_print_no = customer.getBz_print_no(); + if (ObjectUtil.isEmpty(bz_print_no)) { throw new BadRequestException("请先设置客户打印模板"); } - String bz_print_no = jsonCust.getString("bz_print_no"); double weight = 0; JSONArray rows = WQL.getWO("PDA_ST_01").addParam("flag", "5").addParam("box_no", box_no).process().getResultJSONArray(0); @@ -181,7 +191,6 @@ public class PrintServiceImpl implements PrintService { public JSONObject customerPrint2(JSONObject whereJson) { JSONObject jo = new JSONObject(); WQLObject printTab = WQLObject.getWQLObject("pdm_bi_printinfo"); - WQLObject custTab = WQLObject.getWQLObject("md_cs_customerbase"); WQLObject subTab = WQLObject.getWQLObject("pdm_bi_subpackagerelation"); String box_no = whereJson.getString("box_no"); @@ -243,15 +252,19 @@ public class PrintServiceImpl implements PrintService { String storage_conditions = ""; // 根据客户条件选择对应模板 - JSONObject jsonCust = custTab.query("cust_code = '" + box_jo.getString("customer_name") + "' and is_delete = '0' and is_used = '1'").uniqueResult(0); - if (ObjectUtil.isEmpty(jsonCust)) { + LambdaQueryWrapper lam = new LambdaQueryWrapper(); + lam.eq(Customerbase::getCust_code,box_jo.getString("customer_name")); + lam.eq(Customerbase::getIs_delete,"0"); + lam.eq(Customerbase::getIs_used,"1"); + Customerbase customer = customerbaseMapper.selectOne(lam); + if (ObjectUtil.isEmpty(customer)) { throw new BadRequestException("客户不存在或未启用"); } - - if (ObjectUtil.isEmpty(jsonCust.getString("bz_print_no"))) { + String bz_print_no = customer.getBz_print_no(); + if (ObjectUtil.isEmpty(bz_print_no)) { throw new BadRequestException("请先设置客户打印模板"); } - String bz_print_no = jsonCust.getString("bz_print_no"); + double weight = 0; JSONArray rows = WQL.getWO("PDA_ST_01").addParam("flag", "5").addParam("box_no", box_no).process().getResultJSONArray(0); diff --git a/lms/nladmin-system/src/main/java/org/nl/wms/st/instor/service/impl/ChangeServiceImpl.java b/lms/nladmin-system/src/main/java/org/nl/wms/st/instor/service/impl/ChangeServiceImpl.java index 6382c97..c7df3e9 100644 --- a/lms/nladmin-system/src/main/java/org/nl/wms/st/instor/service/impl/ChangeServiceImpl.java +++ b/lms/nladmin-system/src/main/java/org/nl/wms/st/instor/service/impl/ChangeServiceImpl.java @@ -7,6 +7,7 @@ import cn.hutool.core.util.ObjectUtil; import cn.hutool.core.util.StrUtil; import com.alibaba.fastjson.JSONArray; import com.alibaba.fastjson.JSONObject; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; import org.nl.common.utils.SecurityUtils; @@ -15,11 +16,14 @@ import org.nl.common.utils.CodeUtil; import org.nl.modules.wql.WQL; import org.nl.modules.wql.core.bean.WQLObject; import org.nl.modules.wql.util.WqlUtil; +import org.nl.wms.basedata.master.customer.service.dao.Customerbase; +import org.nl.wms.basedata.master.customer.service.dao.mapper.CustomerbaseMapper; import org.nl.wms.basedata.st.service.impl.UserStorServiceImpl; import org.nl.wms.sch.manage.TaskStatusEnum; import org.nl.wms.st.inbill.service.StorPublicService; import org.nl.wms.st.instor.service.ChangeService; import org.nl.wms.st.instor.task.HandMoveStorAcsTask; +import org.springframework.beans.factory.annotation.Autowired; import org.springframework.data.domain.Pageable; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; @@ -37,6 +41,9 @@ import java.util.Map; public class ChangeServiceImpl implements ChangeService { private final StorPublicService storPublicService; + @Autowired + private CustomerbaseMapper customerbaseMapper; + @Override public Map pageQuery(Map whereJson, Pageable page) { HashMap map = new HashMap<>(whereJson); @@ -194,11 +201,14 @@ public class ChangeServiceImpl implements ChangeService { change_jo.put("demand_date", DemandDate); change_jo.put("customer_name", CustomerName); //查询对应的客户 - JSONObject customer_jo = WQLObject.getWQLObject("md_cs_customerbase").query("cust_code = '" + CustomerName + "'").uniqueResult(0); - if (ObjectUtil.isEmpty(customer_jo)) { + LambdaQueryWrapper lam = new LambdaQueryWrapper(); + lam.eq(Customerbase::getCust_code,CustomerName); + lam.eq(Customerbase::getIs_delete,"0"); + Customerbase customer = customerbaseMapper.selectOne(lam); + if (ObjectUtil.isEmpty(customer)) { throw new BadRequestException("未查询到对应客户编码为:" + CustomerName); } - change_jo.put("customer_description", customer_jo.getString("cust_name")); + change_jo.put("customer_description", customer.getCust_name()); change_jo.put("isRePrintPackageBoxLabel", isRePrintPackageBoxLabel); change_jo.put("isUnPackBox", isUnPackBox); change_jo.put("UpdatedDateOfProduction", UpdatedDateOfProduction); diff --git a/lms/nladmin-system/src/main/java/org/nl/wms/st/outbill/service/impl/CheckOutBillServiceImpl.java b/lms/nladmin-system/src/main/java/org/nl/wms/st/outbill/service/impl/CheckOutBillServiceImpl.java index a1c2ba9..6dbabbe 100644 --- a/lms/nladmin-system/src/main/java/org/nl/wms/st/outbill/service/impl/CheckOutBillServiceImpl.java +++ b/lms/nladmin-system/src/main/java/org/nl/wms/st/outbill/service/impl/CheckOutBillServiceImpl.java @@ -14,6 +14,7 @@ import com.alibaba.excel.write.metadata.WriteSheet; import com.alibaba.excel.write.metadata.fill.FillWrapper; import com.alibaba.fastjson.JSONArray; import com.alibaba.fastjson.JSONObject; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; import org.nl.common.utils.CodeUtil; @@ -25,6 +26,8 @@ import org.nl.modules.wql.core.bean.WQLObject; import org.nl.modules.wql.util.SpringContextHolder; import org.nl.modules.wql.util.WqlUtil; import org.nl.system.service.param.impl.SysParamServiceImpl; +import org.nl.wms.basedata.master.customer.service.dao.Customerbase; +import org.nl.wms.basedata.master.customer.service.dao.mapper.CustomerbaseMapper; import org.nl.wms.basedata.st.service.impl.UserStorServiceImpl; import org.nl.wms.pda.mps.eum.RegionTypeEnum; import org.nl.wms.sch.manage.TaskStatusEnum; @@ -39,6 +42,7 @@ import org.nl.wms.st.outbill.util.ThreadManage; import org.nl.wms.st.returns.service.InAndOutReturnService; import org.nl.wms.st.returns.service.impl.InAndOutRetrunServiceImpl; import org.nl.wms.util.TranUtil; +import org.springframework.beans.factory.annotation.Autowired; import org.springframework.data.domain.Pageable; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; @@ -67,6 +71,8 @@ public class CheckOutBillServiceImpl implements CheckOutBillService { private final OutTask outTask; private final HandMoveStorAcsTask moveStorAcsTask; private final InAndOutReturnService inAndOutReturnService; + @Autowired + private CustomerbaseMapper customerbaseMapper; @Override public Map pageQuery(Map whereJson, Pageable page, String[] stor_id, String[] bill_status, String[] bill_type) { @@ -5979,7 +5985,6 @@ public class CheckOutBillServiceImpl implements CheckOutBillService { @Transactional(rollbackFor = Exception.class) public void downloadExcel(HttpServletResponse response, Map whereJson) throws IOException { - WQLObject custTab = WQLObject.getWQLObject("MD_CS_CustomerBase"); // 客户基本信息表 WQLObject mstTab = WQLObject.getWQLObject("ST_IVT_IOStorInv"); // 出入库主表 WQLObject dtlTab = WQLObject.getWQLObject("st_ivt_iostorinvdtl"); // 出入库明细表 WQLObject disTab = WQLObject.getWQLObject("st_ivt_iostorinvdis"); // 出入库分配明细 @@ -5991,7 +5996,11 @@ public class CheckOutBillServiceImpl implements CheckOutBillService { JSONObject jsonMst = mstTab.query("iostorinv_id = '" + MapUtil.getStr(whereJson, "iostorinv_id") + "'").uniqueResult(0); String cust_code = jsonMst.getString("cust_code"); - JSONObject jsonCust = custTab.query("cust_code = '" + cust_code + "'").uniqueResult(0); + //查询客户信息 + LambdaQueryWrapper lam = new LambdaQueryWrapper(); + lam.eq(Customerbase::getCust_code,cust_code); + lam.eq(Customerbase::getIs_delete,"0"); + Customerbase jsonCust = customerbaseMapper.selectOne(lam); String bill_type = jsonMst.getString("bill_type"); int j = Integer.parseInt((String) whereJson.get("j")); @@ -6057,9 +6066,9 @@ public class CheckOutBillServiceImpl implements CheckOutBillService { code_template = SpringContextHolder.getBean(SysParamServiceImpl.class).findByCode("PRINT_TEMPLE").getValue(); } else { - shd_dtl_num = jsonCust.getIntValue("shd_dtl_num"); + shd_dtl_num = jsonCust.getShd_dtl_num(); //1.根据出入库主表中 收货单位 查询客户表中的模板路径 - code_template = jsonCust.getString("shd_print_no"); + code_template = jsonCust.getShd_print_no(); } JSONObject jsonDtl = dtlTab.query("iostorinv_id = '" + jsonMst.getString("iostorinv_id") + "'").uniqueResult(0); diff --git a/lms/nladmin-ui/src/views/wms/basedata/master/customer/index.vue b/lms/nladmin-ui/src/views/wms/basedata/master/customer/index.vue index 9530eac..ca47c72 100644 --- a/lms/nladmin-ui/src/views/wms/basedata/master/customer/index.vue +++ b/lms/nladmin-ui/src/views/wms/basedata/master/customer/index.vue @@ -2,16 +2,46 @@
- - +
+ + + + + + + + + + + + +
@@ -40,40 +70,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -81,8 +77,8 @@ - - + + @@ -93,11 +89,6 @@ - - - - - @@ -105,7 +96,7 @@ - + @@ -184,20 +175,19 @@ style="width: 100%;" @selection-change="crud.selectionChangeHandler" > - + - - - - - - - - - - - - + + + + + + + + + + +