Browse Source

opt:客户功能wql改成mybatis plus

master
zds 1 month ago
parent
commit
bd64696c00
  1. 18
      lms/nladmin-system/src/main/java/org/nl/b_lms/pda/service/impl/PrintTableTwoServiceImpl.java
  2. 28
      lms/nladmin-system/src/main/java/org/nl/wms/basedata/master/customer/controller/CustomerbaseController.java
  3. 46
      lms/nladmin-system/src/main/java/org/nl/wms/basedata/master/customer/service/CustomerbaseService.java
  4. 68
      lms/nladmin-system/src/main/java/org/nl/wms/basedata/master/customer/service/dao/Customerbase.java
  5. 61
      lms/nladmin-system/src/main/java/org/nl/wms/basedata/master/customer/service/dao/CustomerbaseProc.java
  6. 13
      lms/nladmin-system/src/main/java/org/nl/wms/basedata/master/customer/service/dao/mapper/CustomerbaseMapper.java
  7. 5
      lms/nladmin-system/src/main/java/org/nl/wms/basedata/master/customer/service/dao/mapper/CustomerbaseMapper.xml
  8. 14
      lms/nladmin-system/src/main/java/org/nl/wms/basedata/master/customer/service/dao/mapper/CustomerbaseProcMapper.java
  9. 5
      lms/nladmin-system/src/main/java/org/nl/wms/basedata/master/customer/service/dao/mapper/CustomerbaseProcMapper.xml
  10. 18
      lms/nladmin-system/src/main/java/org/nl/wms/basedata/master/customer/service/dto/CustomerbaseQuery.java
  11. 111
      lms/nladmin-system/src/main/java/org/nl/wms/basedata/master/customer/service/impl/CustomerbaseServiceImpl.java
  12. 1
      lms/nladmin-system/src/main/java/org/nl/wms/basedata/master/faultdevice/controller/FaultDeviceController.java
  13. 3
      lms/nladmin-system/src/main/java/org/nl/wms/basedata/master/faultdevice/service/FaultDeviceService.java
  14. 70
      lms/nladmin-system/src/main/java/org/nl/wms/basedata/master/service/CustomerbaseService.java
  15. 212
      lms/nladmin-system/src/main/java/org/nl/wms/basedata/master/service/dto/CustomerbaseDto.java
  16. 155
      lms/nladmin-system/src/main/java/org/nl/wms/basedata/master/service/impl/CustomerbaseServiceImpl.java
  17. 16
      lms/nladmin-system/src/main/java/org/nl/wms/ext/acs/service/impl/AcsToWmsServiceImpl.java
  18. 93
      lms/nladmin-system/src/main/java/org/nl/wms/ext/crm/service/impl/CrmToLmsServiceImpl.java
  19. 18
      lms/nladmin-system/src/main/java/org/nl/wms/ext/mes/service/impl/MesToLmsServiceImpl.java
  20. 35
      lms/nladmin-system/src/main/java/org/nl/wms/pda/st/service/impl/PrintServiceImpl.java
  21. 16
      lms/nladmin-system/src/main/java/org/nl/wms/st/instor/service/impl/ChangeServiceImpl.java
  22. 17
      lms/nladmin-system/src/main/java/org/nl/wms/st/outbill/service/impl/CheckOutBillServiceImpl.java
  23. 208
      lms/nladmin-ui/src/views/wms/basedata/master/customer/index.vue

18
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 cn.hutool.core.util.ObjectUtil;
import com.alibaba.fastjson.JSONArray; import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import org.nl.b_lms.pda.service.PrintTableTwoService; import org.nl.b_lms.pda.service.PrintTableTwoService;
import org.nl.b_lms.pdm.info.dao.PdmBiContainerinfo; 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.core.bean.WQLObject;
import org.nl.modules.wql.util.SpringContextHolder; import org.nl.modules.wql.util.SpringContextHolder;
import org.nl.system.service.param.impl.SysParamServiceImpl; 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.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
@ -36,6 +39,9 @@ public class PrintTableTwoServiceImpl implements PrintTableTwoService {
@Autowired @Autowired
private IPdmBiOrderbominfoService iPdmBiOrderbominfoService; private IPdmBiOrderbominfoService iPdmBiOrderbominfoService;
@Autowired
private CustomerbaseMapper customerbaseMapper;
@Override @Override
@Transactional(rollbackFor = Exception.class) @Transactional(rollbackFor = Exception.class)
public JSONObject withinTable(JSONObject whereJson) { 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"; String BTW = "%BTW% /AF=" + LocationOfBTW + "/R=3 /PRN=" + "\"" + jsonPrint.getString("print_floder") + "\"" + " /D /P /C=1";
// 标签类型: 查询客户信息中配置的打印模版,根据模版找到字典配置的参数 // 标签类型: 查询客户信息中配置的打印模版,根据模版找到字典配置的参数
JSONObject jsonCust = WQLObject.getWQLObject("md_cs_customerbase") LambdaQueryWrapper<Customerbase> lam = new LambdaQueryWrapper<Customerbase>();
.query("cust_code = '" + subDao.getCustomer_name() + "' AND is_delete = '0' AND is_used = '1'") lam.eq(Customerbase::getCust_code,subDao.getCustomer_name());
.uniqueResult(0); lam.eq(Customerbase::getIs_delete,"0");
lam.eq(Customerbase::getIs_used,"1");
Customerbase jsonCust = customerbaseMapper.selectOne(lam);
if (ObjectUtil.isEmpty(jsonCust)) { if (ObjectUtil.isEmpty(jsonCust)) {
throw new BadRequestException("客户【"+subDao.getCustomer_description()+"】不存在或未启用!"); throw new BadRequestException("客户【"+subDao.getCustomer_description()+"】不存在或未启用!");
} }
JSONObject jsonDict = WQLObject.getWQLObject("sys_dict") 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); .uniqueResult(0);
if (ObjectUtil.isEmpty(jsonDict)) { if (ObjectUtil.isEmpty(jsonDict)) {
throw new BadRequestException("客户【"+subDao.getCustomer_description()+"】未找到对应的打印模版,请检查是否在客户信息中配置!"); throw new BadRequestException("客户【"+subDao.getCustomer_description()+"】未找到对应的打印模版,请检查是否在客户信息中配置!");

28
lms/nladmin-system/src/main/java/org/nl/wms/basedata/master/rest/CustomerbaseController.java → 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.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j; 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.modules.logging.annotation.Log;
import org.nl.wms.basedata.master.service.CustomerbaseService; import org.nl.wms.basedata.master.customer.service.CustomerbaseService;
import org.nl.wms.basedata.master.service.dto.CustomerbaseDto; import org.nl.wms.basedata.master.customer.service.dao.Customerbase;
import org.springframework.data.domain.Pageable; import org.nl.wms.basedata.master.customer.service.dto.CustomerbaseQuery;
import org.springframework.http.HttpStatus; import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity; import org.springframework.http.ResponseEntity;
import org.springframework.validation.annotation.Validated; import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import java.util.Map;
/** /**
* @author ldjun * @author ldjun
@ -20,7 +21,6 @@ import java.util.Map;
**/ **/
@RestController @RestController
@RequiredArgsConstructor @RequiredArgsConstructor
@RequestMapping("/api/customerbase") @RequestMapping("/api/customerbase")
@Slf4j @Slf4j
public class CustomerbaseController { public class CustomerbaseController {
@ -29,33 +29,25 @@ public class CustomerbaseController {
@GetMapping @GetMapping
@Log("查询客户基础表") @Log("查询客户基础表")
public ResponseEntity<Object> query(CustomerbaseQuery whereJson, PageQuery page) {
//@PreAuthorize("@el.check('customerbase:list')") return new ResponseEntity<>(TableDataInfo.build(customerbaseService.queryAll(whereJson, page)), HttpStatus.OK);
public ResponseEntity<Object> query(@RequestParam Map whereJson, Pageable page) {
return new ResponseEntity<>(customerbaseService.queryAll(whereJson, page), HttpStatus.OK);
} }
@PostMapping @PostMapping
@Log("新增客户基础表") @Log("新增客户基础表")
public ResponseEntity<Object> create(@Validated @RequestBody Customerbase dto) {
//@PreAuthorize("@el.check('customerbase:add')")
public ResponseEntity<Object> create(@Validated @RequestBody CustomerbaseDto dto) {
customerbaseService.create(dto); customerbaseService.create(dto);
return new ResponseEntity<>(HttpStatus.CREATED); return new ResponseEntity<>(HttpStatus.CREATED);
} }
@PutMapping @PutMapping
@Log("修改客户基础表") @Log("修改客户基础表")
public ResponseEntity<Object> update(@Validated @RequestBody Customerbase dto) {
//@PreAuthorize("@el.check('customerbase:edit')")
public ResponseEntity<Object> update(@Validated @RequestBody CustomerbaseDto dto) {
customerbaseService.update(dto); customerbaseService.update(dto);
return new ResponseEntity<>(HttpStatus.NO_CONTENT); return new ResponseEntity<>(HttpStatus.NO_CONTENT);
} }
@Log("删除客户基础表") @Log("删除客户基础表")
//@PreAuthorize("@el.check('customerbase:del')")
@DeleteMapping @DeleteMapping
public ResponseEntity<Object> delete(@RequestBody Long[] ids) { public ResponseEntity<Object> delete(@RequestBody Long[] ids) {
customerbaseService.deleteAll(ids); customerbaseService.deleteAll(ids);

46
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<Customerbase> {
/**
* 查询数据分页
*
* @param whereJson 条件
* @param page 分页参数
* @return Map<String, Object>
*/
IPage<Customerbase> queryAll(CustomerbaseQuery whereJson, PageQuery page);
/**
* 创建
*
* @param dto /
*/
void create(Customerbase dto);
/**
* 编辑
*
* @param dto /
*/
void update(Customerbase dto);
/**
* 多选删除
*
* @param ids /
*/
void deleteAll(Long[] ids);
}

68
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;
}

61
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));
}
}

13
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<Customerbase> {
}

5
lms/nladmin-system/src/main/java/org/nl/wms/basedata/master/customer/service/dao/mapper/CustomerbaseMapper.xml

@ -0,0 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="org.nl.wms.basedata.master.customer.service.dao.mapper.CustomerbaseMapper">
</mapper>

14
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<CustomerbaseProc> {
}

5
lms/nladmin-system/src/main/java/org/nl/wms/basedata/master/customer/service/dao/mapper/CustomerbaseProcMapper.xml

@ -0,0 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="org.nl.wms.basedata.master.customer.service.dao.mapper.CustomerbaseProcMapper">
</mapper>

18
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;
}

111
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<CustomerbaseMapper, Customerbase> implements CustomerbaseService {
@Autowired
private CustomerbaseMapper customerbaseMapper;
@Override
public IPage<Customerbase> queryAll(CustomerbaseQuery whereJson, PageQuery page) {
IPage<Customerbase> pages = new Page<>(page.getPage() + 1, page.getSize());
LambdaQueryWrapper<Customerbase> lam = new LambdaQueryWrapper<Customerbase>();
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<Customerbase> lam = new LambdaQueryWrapper<Customerbase>();
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<Customerbase> lam = new LambdaQueryWrapper<Customerbase>();
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<Customerbase> lam = new LambdaUpdateWrapper<Customerbase>();
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);
}
}

1
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; package org.nl.wms.basedata.master.faultdevice.controller;
import com.alibaba.fastjson.JSONObject;
import lombok.RequiredArgsConstructor; import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.nl.common.TableDataInfo; import org.nl.common.TableDataInfo;

3
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; package org.nl.wms.basedata.master.faultdevice.service;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.IService; import com.baomidou.mybatisplus.extension.service.IService;
import org.nl.common.domain.query.PageQuery; 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.dao.FaultDevice;
import org.nl.wms.basedata.master.faultdevice.service.dto.FaultQuery; 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 org.springframework.data.domain.Pageable;
import java.util.List;
import java.util.Map; import java.util.Map;
/** /**

70
lms/nladmin-system/src/main/java/org/nl/wms/basedata/master/service/CustomerbaseService.java

@ -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<String, Object>
*/
Map<String, Object> queryAll(Map whereJson, Pageable page);
/**
* 查询所有数据不分页
*
* @param whereJson 条件参数
* @return List<CustomerbaseDto>
*/
List<CustomerbaseDto> 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);
}

212
lms/nladmin-system/src/main/java/org/nl/wms/basedata/master/service/dto/CustomerbaseDto.java

@ -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;
}

155
lms/nladmin-system/src/main/java/org/nl/wms/basedata/master/service/impl/CustomerbaseServiceImpl.java

@ -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<String, Object> 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<CustomerbaseDto> queryAll(Map whereJson) {
WQLObject wo = WQLObject.getWQLObject("md_cs_customerbase");
JSONArray arr = wo.query().getResultJSONArray(0);
List<CustomerbaseDto> 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);
}
}
}

16
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.notice.ISysNoticeService;
import org.nl.system.service.param.ISysParamService; import org.nl.system.service.param.ISysParamService;
import org.nl.system.service.param.impl.SysParamServiceImpl; 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.ext.acs.service.AcsToWmsService;
import org.nl.wms.pda.mps.eum.RegionTypeEnum; import org.nl.wms.pda.mps.eum.RegionTypeEnum;
import org.nl.wms.pda.mps.service.CasingService; import org.nl.wms.pda.mps.service.CasingService;
@ -96,6 +98,9 @@ public class AcsToWmsServiceImpl implements AcsToWmsService {
private final ISysNoticeService noticeService; 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); LambdaQueryWrapper<Customerbase> lam = new LambdaQueryWrapper<Customerbase>();
if (ObjectUtil.isEmpty(jsonCust)) { 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("客户不存在请检查!"); throw new BadRequestException("客户不存在请检查!");
} }
JSONObject data = new JSONObject(); 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(); 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); result.put("data", data);
return result; return result;
} }

93
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 cn.hutool.core.util.StrUtil;
import com.alibaba.fastjson.JSONArray; import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import lombok.RequiredArgsConstructor; import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.nl.common.utils.SecurityUtils; import org.nl.common.utils.SecurityUtils;
import org.nl.modules.wql.WQL; 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.nl.wms.ext.crm.service.CrmToLmsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import java.util.HashMap; import java.util.HashMap;
@ -20,69 +25,59 @@ import java.util.HashMap;
@RequiredArgsConstructor @RequiredArgsConstructor
@Slf4j @Slf4j
public class CrmToLmsServiceImpl implements CrmToLmsService { public class CrmToLmsServiceImpl implements CrmToLmsService {
@Autowired
private CustomerbaseMapper customerbaseMapper;
@Autowired
private CustomerbaseProcMapper customerbaseProcMapper;
@Override @Override
public JSONObject getCustomerInfo(JSONObject row) { public JSONObject getCustomerInfo(JSONObject row) {
String customer_name = row.getString("CustomerName"); String customer_name = row.getString("CustomerName");
String description = row.getString("Description"); String description = row.getString("Description");
String company = row.getString("Company"); 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"); 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 currentUserId = SecurityUtils.getCurrentUserId();
String nickName = SecurityUtils.getCurrentNickName(); String nickName = SecurityUtils.getCurrentNickName();
String now = DateUtil.now(); String now = DateUtil.now();
JSONObject customer_jo = WQLObject.getWQLObject("md_cs_customerbase").query("cust_code = '" + customer_name + "'").uniqueResult(0); CustomerbaseProc customerbaseProc = new CustomerbaseProc();
if (ObjectUtil.isEmpty(customer_jo)) { customerbaseProc.copyFrom(row);
customer_jo = new JSONObject(); JSONObject jo = new JSONObject();
customer_jo.put("cust_id", IdUtil.getSnowflake(1, 1).nextId()); customerbaseProc.setId(IdUtil.getSnowflake(1, 1).nextId()+"");
customer_jo.put("cust_code", customer_name); customerbaseProc.setCreate_time(now);
customer_jo.put("cust_name", description); customerbaseProcMapper.insert(customerbaseProc);
customer_jo.put("cust_simple_name", company); log.info(customerbaseProc.toString());
customer_jo.put("sales_owner", sales_owner);
customer_jo.put("create_id", currentUserId);
customer_jo.put("create_name", nickName); LambdaQueryWrapper<Customerbase> lam = new LambdaQueryWrapper<Customerbase>();
customer_jo.put("create_time", now); lam.eq(Customerbase::getCust_code,customer_name);
customer_jo.put("update_optid", currentUserId); lam.eq(Customerbase::getIs_delete,"0");
customer_jo.put("update_optname", nickName); Customerbase customer = customerbaseMapper.selectOne(lam);
customer_jo.put("update_time", now);
WQLObject.getWQLObject("md_cs_customerbase").insert(customer_jo); 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 { } else {
customer_jo.put("cust_name", description); customer.setCust_name(description);
customer_jo.put("cust_simple_name", company); customer.setCust_simple_name(company);
customer_jo.put("sales_owner", sales_owner); customer.setSales_owner(sales_owner);
customer_jo.put("update_optid", currentUserId); customer.setUpdate_id(currentUserId);
customer_jo.put("update_optname", nickName); customer.setUpdate_name(nickName);
customer_jo.put("update_time", now); customer.setUpdate_time(now);
WQLObject.getWQLObject("md_cs_customerbase").update(customer_jo); customerbaseMapper.updateById(customer);
} }

18
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.dao.PdmBiOrderbominfo;
import org.nl.b_lms.pdm.info.service.IPdmBiContainerinfoService; import org.nl.b_lms.pdm.info.service.IPdmBiContainerinfoService;
import org.nl.b_lms.pdm.info.service.IPdmBiOrderbominfoService; 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.pdm.subpackagerelation.service.IpdmBiSubpackagerelationService;
import org.nl.b_lms.sch.point.dao.BstIvtPackageinfoivt; import org.nl.b_lms.sch.point.dao.BstIvtPackageinfoivt;
import org.nl.b_lms.sch.point.service.IbstIvtPackageinfoivtService; 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.core.bean.WQLObject;
import org.nl.modules.wql.util.SpringContextHolder; import org.nl.modules.wql.util.SpringContextHolder;
import org.nl.system.service.param.impl.SysParamServiceImpl; 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.acs.service.WmsToAcsService;
import org.nl.wms.ext.mes.service.MesToLmsService; import org.nl.wms.ext.mes.service.MesToLmsService;
import org.nl.wms.pda.mps.service.InService; import org.nl.wms.pda.mps.service.InService;
import org.nl.wms.pda.mps.service.OutService; import org.nl.wms.pda.mps.service.OutService;
import org.nl.wms.pda.mps.service.impl.BakingServiceImpl; 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.manage.AbstractAcsTask;
import org.nl.wms.sch.tasks.CoolCutTask; import org.nl.wms.sch.tasks.CoolCutTask;
import org.nl.wms.st.inbill.service.CheckOutBillService; import org.nl.wms.st.inbill.service.CheckOutBillService;
@ -96,10 +96,10 @@ public class MesToLmsServiceImpl implements MesToLmsService {
private IbstIvtPackageinfoivtService packageinfoivtService; private IbstIvtPackageinfoivtService packageinfoivtService;
@Autowired @Autowired
private IpdmBiSubpackagerelationService subpackagerelationService; private SlitterService slitterService;
@Autowired @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("demand_date", DemandDate);
change_jo.put("customer_name", CustomerName); change_jo.put("customer_name", CustomerName);
//查询对应的客户 //查询对应的客户
JSONObject customer_jo = WQLObject.getWQLObject("md_cs_customerbase").query("cust_code = '" + CustomerName + "'").uniqueResult(0); LambdaQueryWrapper<Customerbase> lam = new LambdaQueryWrapper<Customerbase>();
if (ObjectUtil.isEmpty(customer_jo)) { 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); 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("isRePrintPackageBoxLabel", isRePrintPackageBoxLabel);
change_jo.put("isUnPackBox", isUnPackBox); change_jo.put("isUnPackBox", isUnPackBox);
change_jo.put("UpdatedDateOfProduction", UpdatedDateOfProduction); change_jo.put("UpdatedDateOfProduction", UpdatedDateOfProduction);

35
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 cn.hutool.core.util.ObjectUtil;
import com.alibaba.fastjson.JSONArray; import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import lombok.RequiredArgsConstructor; import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.nl.modules.common.exception.BadRequestException; import org.nl.modules.common.exception.BadRequestException;
import org.nl.modules.wql.WQL; import org.nl.modules.wql.WQL;
import org.nl.modules.wql.core.bean.WQLObject; 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.nl.wms.pda.st.service.PrintService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import java.io.*; import java.io.*;
@ -26,6 +30,9 @@ import java.util.HashMap;
@Slf4j @Slf4j
public class PrintServiceImpl implements PrintService { public class PrintServiceImpl implements PrintService {
@Autowired
private CustomerbaseMapper customerbaseMapper;
@Override @Override
public JSONObject customerInfo(JSONObject whereJson) { public JSONObject customerInfo(JSONObject whereJson) {
String box_no = whereJson.getString("box_no"); String box_no = whereJson.getString("box_no");
@ -40,7 +47,6 @@ public class PrintServiceImpl implements PrintService {
public JSONObject customerPrint(JSONObject whereJson) { public JSONObject customerPrint(JSONObject whereJson) {
JSONObject jo = new JSONObject(); JSONObject jo = new JSONObject();
WQLObject printTab = WQLObject.getWQLObject("pdm_bi_printinfo"); WQLObject printTab = WQLObject.getWQLObject("pdm_bi_printinfo");
WQLObject custTab = WQLObject.getWQLObject("md_cs_customerbase");
WQLObject subTab = WQLObject.getWQLObject("pdm_bi_subpackagerelation"); WQLObject subTab = WQLObject.getWQLObject("pdm_bi_subpackagerelation");
String box_no = whereJson.getString("box_no"); String box_no = whereJson.getString("box_no");
@ -97,15 +103,19 @@ public class PrintServiceImpl implements PrintService {
String storage_conditions = ""; String storage_conditions = "";
// 根据客户条件选择对应模板 // 根据客户条件选择对应模板
JSONObject jsonCust = custTab.query("cust_code = '" + box_jo.getString("customer_name") + "' and is_delete = '0' and is_used = '1'").uniqueResult(0); LambdaQueryWrapper<Customerbase> lam = new LambdaQueryWrapper<Customerbase>();
if (ObjectUtil.isEmpty(jsonCust)) { 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("客户不存在或未启用"); 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("请先设置客户打印模板"); throw new BadRequestException("请先设置客户打印模板");
} }
String bz_print_no = jsonCust.getString("bz_print_no");
double weight = 0; double weight = 0;
JSONArray rows = WQL.getWO("PDA_ST_01").addParam("flag", "5").addParam("box_no", box_no).process().getResultJSONArray(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) { public JSONObject customerPrint2(JSONObject whereJson) {
JSONObject jo = new JSONObject(); JSONObject jo = new JSONObject();
WQLObject printTab = WQLObject.getWQLObject("pdm_bi_printinfo"); WQLObject printTab = WQLObject.getWQLObject("pdm_bi_printinfo");
WQLObject custTab = WQLObject.getWQLObject("md_cs_customerbase");
WQLObject subTab = WQLObject.getWQLObject("pdm_bi_subpackagerelation"); WQLObject subTab = WQLObject.getWQLObject("pdm_bi_subpackagerelation");
String box_no = whereJson.getString("box_no"); String box_no = whereJson.getString("box_no");
@ -243,15 +252,19 @@ public class PrintServiceImpl implements PrintService {
String storage_conditions = ""; String storage_conditions = "";
// 根据客户条件选择对应模板 // 根据客户条件选择对应模板
JSONObject jsonCust = custTab.query("cust_code = '" + box_jo.getString("customer_name") + "' and is_delete = '0' and is_used = '1'").uniqueResult(0); LambdaQueryWrapper<Customerbase> lam = new LambdaQueryWrapper<Customerbase>();
if (ObjectUtil.isEmpty(jsonCust)) { 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("客户不存在或未启用"); throw new BadRequestException("客户不存在或未启用");
} }
String bz_print_no = customer.getBz_print_no();
if (ObjectUtil.isEmpty(jsonCust.getString("bz_print_no"))) { if (ObjectUtil.isEmpty(bz_print_no)) {
throw new BadRequestException("请先设置客户打印模板"); throw new BadRequestException("请先设置客户打印模板");
} }
String bz_print_no = jsonCust.getString("bz_print_no");
double weight = 0; double weight = 0;
JSONArray rows = WQL.getWO("PDA_ST_01").addParam("flag", "5").addParam("box_no", box_no).process().getResultJSONArray(0); JSONArray rows = WQL.getWO("PDA_ST_01").addParam("flag", "5").addParam("box_no", box_no).process().getResultJSONArray(0);

16
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 cn.hutool.core.util.StrUtil;
import com.alibaba.fastjson.JSONArray; import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import lombok.RequiredArgsConstructor; import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.nl.common.utils.SecurityUtils; 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.WQL;
import org.nl.modules.wql.core.bean.WQLObject; import org.nl.modules.wql.core.bean.WQLObject;
import org.nl.modules.wql.util.WqlUtil; 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.basedata.st.service.impl.UserStorServiceImpl;
import org.nl.wms.sch.manage.TaskStatusEnum; import org.nl.wms.sch.manage.TaskStatusEnum;
import org.nl.wms.st.inbill.service.StorPublicService; import org.nl.wms.st.inbill.service.StorPublicService;
import org.nl.wms.st.instor.service.ChangeService; import org.nl.wms.st.instor.service.ChangeService;
import org.nl.wms.st.instor.task.HandMoveStorAcsTask; import org.nl.wms.st.instor.task.HandMoveStorAcsTask;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Pageable; import org.springframework.data.domain.Pageable;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
@ -37,6 +41,9 @@ import java.util.Map;
public class ChangeServiceImpl implements ChangeService { public class ChangeServiceImpl implements ChangeService {
private final StorPublicService storPublicService; private final StorPublicService storPublicService;
@Autowired
private CustomerbaseMapper customerbaseMapper;
@Override @Override
public Map<String, Object> pageQuery(Map whereJson, Pageable page) { public Map<String, Object> pageQuery(Map whereJson, Pageable page) {
HashMap<String, String> map = new HashMap<>(whereJson); HashMap<String, String> map = new HashMap<>(whereJson);
@ -194,11 +201,14 @@ public class ChangeServiceImpl implements ChangeService {
change_jo.put("demand_date", DemandDate); change_jo.put("demand_date", DemandDate);
change_jo.put("customer_name", CustomerName); change_jo.put("customer_name", CustomerName);
//查询对应的客户 //查询对应的客户
JSONObject customer_jo = WQLObject.getWQLObject("md_cs_customerbase").query("cust_code = '" + CustomerName + "'").uniqueResult(0); LambdaQueryWrapper<Customerbase> lam = new LambdaQueryWrapper<Customerbase>();
if (ObjectUtil.isEmpty(customer_jo)) { 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); 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("isRePrintPackageBoxLabel", isRePrintPackageBoxLabel);
change_jo.put("isUnPackBox", isUnPackBox); change_jo.put("isUnPackBox", isUnPackBox);
change_jo.put("UpdatedDateOfProduction", UpdatedDateOfProduction); change_jo.put("UpdatedDateOfProduction", UpdatedDateOfProduction);

17
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.excel.write.metadata.fill.FillWrapper;
import com.alibaba.fastjson.JSONArray; import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import lombok.RequiredArgsConstructor; import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.nl.common.utils.CodeUtil; 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.SpringContextHolder;
import org.nl.modules.wql.util.WqlUtil; import org.nl.modules.wql.util.WqlUtil;
import org.nl.system.service.param.impl.SysParamServiceImpl; 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.basedata.st.service.impl.UserStorServiceImpl;
import org.nl.wms.pda.mps.eum.RegionTypeEnum; import org.nl.wms.pda.mps.eum.RegionTypeEnum;
import org.nl.wms.sch.manage.TaskStatusEnum; 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.InAndOutReturnService;
import org.nl.wms.st.returns.service.impl.InAndOutRetrunServiceImpl; import org.nl.wms.st.returns.service.impl.InAndOutRetrunServiceImpl;
import org.nl.wms.util.TranUtil; import org.nl.wms.util.TranUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Pageable; import org.springframework.data.domain.Pageable;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
@ -67,6 +71,8 @@ public class CheckOutBillServiceImpl implements CheckOutBillService {
private final OutTask outTask; private final OutTask outTask;
private final HandMoveStorAcsTask moveStorAcsTask; private final HandMoveStorAcsTask moveStorAcsTask;
private final InAndOutReturnService inAndOutReturnService; private final InAndOutReturnService inAndOutReturnService;
@Autowired
private CustomerbaseMapper customerbaseMapper;
@Override @Override
public Map<String, Object> pageQuery(Map whereJson, Pageable page, String[] stor_id, String[] bill_status, String[] bill_type) { public Map<String, Object> 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) @Transactional(rollbackFor = Exception.class)
public void downloadExcel(HttpServletResponse response, Map whereJson) throws IOException { public void downloadExcel(HttpServletResponse response, Map whereJson) throws IOException {
WQLObject custTab = WQLObject.getWQLObject("MD_CS_CustomerBase"); // 客户基本信息表
WQLObject mstTab = WQLObject.getWQLObject("ST_IVT_IOStorInv"); // 出入库主表 WQLObject mstTab = WQLObject.getWQLObject("ST_IVT_IOStorInv"); // 出入库主表
WQLObject dtlTab = WQLObject.getWQLObject("st_ivt_iostorinvdtl"); // 出入库明细表 WQLObject dtlTab = WQLObject.getWQLObject("st_ivt_iostorinvdtl"); // 出入库明细表
WQLObject disTab = WQLObject.getWQLObject("st_ivt_iostorinvdis"); // 出入库分配明细 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); JSONObject jsonMst = mstTab.query("iostorinv_id = '" + MapUtil.getStr(whereJson, "iostorinv_id") + "'").uniqueResult(0);
String cust_code = jsonMst.getString("cust_code"); String cust_code = jsonMst.getString("cust_code");
JSONObject jsonCust = custTab.query("cust_code = '" + cust_code + "'").uniqueResult(0); //查询客户信息
LambdaQueryWrapper<Customerbase> lam = new LambdaQueryWrapper<Customerbase>();
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"); String bill_type = jsonMst.getString("bill_type");
int j = Integer.parseInt((String) whereJson.get("j")); 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(); code_template = SpringContextHolder.getBean(SysParamServiceImpl.class).findByCode("PRINT_TEMPLE").getValue();
} else { } else {
shd_dtl_num = jsonCust.getIntValue("shd_dtl_num"); shd_dtl_num = jsonCust.getShd_dtl_num();
//1.根据出入库主表中 收货单位 查询客户表中的模板路径 //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); JSONObject jsonDtl = dtlTab.query("iostorinv_id = '" + jsonMst.getString("iostorinv_id") + "'").uniqueResult(0);

208
lms/nladmin-ui/src/views/wms/basedata/master/customer/index.vue

@ -2,16 +2,46 @@
<div class="app-container"> <div class="app-container">
<!--工具栏--> <!--工具栏-->
<div class="head-container"> <div class="head-container">
<el-input <div v-if="crud.props.searchToggle">
v-model="query.search" <!-- 搜索 -->
clearable <el-form
style="width: 300px" :inline="true"
size="mini" class="demo-form-inline"
placeholder="输入客户编码或客户名称" label-position="right"
prefix-icon="el-icon-search" label-width="80px"
class="filter-item" label-suffix=":"
/> >
<rrOperation /> <el-form-item label="模糊查询">
<el-input
v-model="query.search"
clearable
style="width: 300px"
size="mini"
placeholder="输入客户编码或客户名称"
prefix-icon="el-icon-search"
class="filter-item"
/>
</el-form-item>
<el-form-item label="是否启用">
<el-select
v-model="query.is_used"
clearable
size="mini"
placeholder="请选择"
class="filter-item"
@change="crud.toQuery"
>
<el-option
v-for="item in dict.IS_OR_NOT"
:key="item.value"
:label="item.label"
:value="item.value"
/>
</el-select>
</el-form-item>
<rrOperation />
</el-form>
</div>
<!--如果想在工具栏加入更多按钮可以使用插槽方式 slot = 'left' or 'right'--> <!--如果想在工具栏加入更多按钮可以使用插槽方式 slot = 'left' or 'right'-->
<crudOperation :permission="permission" /> <crudOperation :permission="permission" />
<!--表单组件--> <!--表单组件-->
@ -40,40 +70,6 @@
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row> </el-row>
<el-row :gutter="20">
<el-col :span="8">
<el-form-item label="税务登记号">
<el-input v-model="form.tax_no" style="width: 200px;" />
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="工商注册号">
<el-input v-model="form.register_no" style="width: 200px;" />
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="经营许可证号">
<el-input v-model="form.manage_lice_no" style="width: 200px;" />
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="20">
<el-col :span="8">
<el-form-item label="营业执照">
<el-input v-model="form.busi_char_name" style="width: 200px;" />
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="邮政编码">
<el-input v-model="form.zip_code" style="width: 200px;" />
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item label="公司电话">
<el-input v-model="form.corp_tele_no" style="width: 200px;" />
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="20"> <el-row :gutter="20">
<el-col :span="8"> <el-col :span="8">
<el-form-item label="公司地址"> <el-form-item label="公司地址">
@ -81,8 +77,8 @@
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="8"> <el-col :span="8">
<el-form-item label="外部标识"> <el-form-item label="公司电话">
<el-input v-model="form.ext_id" style="width: 200px;" /> <el-input v-model="form.corp_tele_no" style="width: 200px;" />
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="8"> <el-col :span="8">
@ -93,11 +89,6 @@
</el-col> </el-col>
</el-row> </el-row>
<el-row :gutter="24"> <el-row :gutter="24">
<el-col :span="8">
<el-form-item label="法人代表">
<el-input v-model="form.jurid_name" style="width: 200px;" />
</el-form-item>
</el-col>
<el-col :span="8"> <el-col :span="8">
<el-form-item label="送货单打印模板路径"> <el-form-item label="送货单打印模板路径">
<el-input v-model="form.shd_print_no" style="width: 200px;" /> <el-input v-model="form.shd_print_no" style="width: 200px;" />
@ -105,7 +96,7 @@
</el-col> </el-col>
<el-col :span="8"> <el-col :span="8">
<el-form-item label="送货单明细数"> <el-form-item label="送货单明细数">
<el-input-number v-model="form.shd_dtl_num" :min="1" :max="100" :precision="0" :controls="false" style="width: 200px;"/> <el-input-number v-model="form.shd_dtl_num" :min="1" :max="100" :precision="0" :controls="true" style="width: 200px;"/>
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row> </el-row>
@ -184,20 +175,19 @@
style="width: 100%;" style="width: 100%;"
@selection-change="crud.selectionChangeHandler" @selection-change="crud.selectionChangeHandler"
> >
<el-table-column prop="cust_code" label="客户编码" show-overflow-tooltip /> <el-table-column prop="cust_code" label="客户编码" :min-width="flexWidth('cust_code',crud.data,'客户编码')" />
<el-table-column prop="cust_name" label="客户名称 " show-overflow-tooltip width="150px" /> <el-table-column prop="cust_name" label="客户名称 " show-overflow-tooltip width="150px" />
<el-table-column prop="cust_simple_name" label="客户简称 " show-overflow-tooltip /> <el-table-column prop="cust_simple_name" label="客户简称 " :min-width="flexWidth('cust_simple_name',crud.data,'客户简称')" />
<el-table-column prop="sales_owner" label="业务员 " show-overflow-tooltip /> <el-table-column prop="sales_owner" label="业务员 " :min-width="flexWidth('sales_owner',crud.data,'业务员')" />
<el-table-column prop="corp_tele_no" label="公司电话" show-overflow-tooltip /> <el-table-column prop="corp_tele_no" label="公司电话" :min-width="flexWidth('corp_tele_no',crud.data,'公司电话')" />
<el-table-column prop="corp_address" label="公司地址" show-overflow-tooltip /> <el-table-column prop="corp_address" label="公司地址" width="150px" show-overflow-tooltip />
<el-table-column prop="jurid_name" label="法人代表" show-overflow-tooltip /> <el-table-column prop="bz_print_no" label="包装打印模板" :formatter="printTemple" :min-width="flexWidth('bz_print_within',crud.data,'内标打印模板')" />
<el-table-column prop="bz_print_no" label="包装打印模板" width="150px" :formatter="printTemple" show-overflow-tooltip /> <el-table-column prop="bz_print_within" label="内标打印模板" :formatter="printTemple2" :min-width="flexWidth('bz_print_within',crud.data,'内标打印模板')" />
<el-table-column prop="bz_print_within" label="内标打印模板" width="150px" :formatter="printTemple2" show-overflow-tooltip /> <el-table-column prop="shd_print_no" label="送货单打印模板路径" :min-width="flexWidth('shd_print_no',crud.data,'送货单打印模板路径')"/>
<el-table-column prop="shd_print_no" label="送货单打印模板路径" width="180px" show-overflow-tooltip/> <el-table-column prop="shd_dtl_num" label="送货单明细数" :min-width="flexWidth('shd_dtl_num',crud.data,'送货单明细数')" />
<el-table-column prop="shd_dtl_num" label="送货单明细数" width="150px" show-overflow-tooltip /> <el-table-column prop="is_auto_table" label="是否自动贴标" :min-width="flexWidth('is_auto_table',crud.data,'是否自动贴标')" :formatter="autoTable"/>
<el-table-column prop="is_auto_table" label="是否自动贴标" width="150px" show-overflow-tooltip :formatter="autoTable"/> <el-table-column prop="update_name" label="修改者" :min-width="flexWidth('update_name',crud.data,'修改者')"/>
<el-table-column prop="update_optname" label="修改者" width="150px"/> <el-table-column prop="update_time" label="修改时间" :min-width="flexWidth('update_time',crud.data,'修改时间')" />
<el-table-column prop="update_time" label="修改时间" width="150" />
<el-table-column label="启用" align="center" prop="is_used"> <el-table-column label="启用" align="center" prop="is_used">
<template slot-scope="scope"> <template slot-scope="scope">
<el-switch <el-switch
@ -237,27 +227,12 @@ import rrOperation from '@crud/RR.operation'
import crudOperation from '@crud/CRUD.operation' import crudOperation from '@crud/CRUD.operation'
import udOperation from '@crud/UD.operation' import udOperation from '@crud/UD.operation'
import pagination from '@crud/Pagination' import pagination from '@crud/Pagination'
import Treeselect, { LOAD_CHILDREN_OPTIONS } from '@riophae/vue-treeselect'
import '@riophae/vue-treeselect/dist/vue-treeselect.css'
import crudClassstandard from '@/views/wms/basedata/master/customer/customerbase'
const defaultForm = { const defaultForm = {
cust_id: null, cust_id: null,
cust_code: null, cust_code: null,
cust_name: null, cust_name: null,
cust_simple_name: null, cust_simple_name: null,
country: null,
state: null,
city: null,
faxnumber: null,
webSite: null,
jurid_name: null,
tax_no: null,
register_no: null,
manage_lice_no: null,
busi_char_name: null,
area_id: null,
zip_code: null,
corp_tele_no: null, corp_tele_no: null,
corp_address: null, corp_address: null,
create_id: null, create_id: null,
@ -266,14 +241,9 @@ const defaultForm = {
update_optid: null, update_optid: null,
update_optname: null, update_optname: null,
update_time: null, update_time: null,
is_used_time: null,
is_used: null, is_used: null,
is_delete: null, is_delete: null,
ext_id: null,
remark: null, remark: null,
class_id: null,
class_code: null,
class_name: null,
zj_print_no: null, zj_print_no: null,
bz_print_no: null, bz_print_no: null,
shd_print_no: null, shd_print_no: null,
@ -283,8 +253,8 @@ const defaultForm = {
} }
export default { export default {
name: 'Customerbase', name: 'Customerbase',
dicts: ['is_used', 'print_temple', 'two_print_temple'], dicts: ['is_used', 'print_temple', 'two_print_temple', 'IS_OR_NOT'],
components: { pagination, crudOperation, rrOperation, udOperation, Treeselect }, components: { pagination, crudOperation, rrOperation, udOperation },
mixins: [presenter(), header(), form(defaultForm), crud()], mixins: [presenter(), header(), form(defaultForm), crud()],
cruds() { cruds() {
return CRUD({ return CRUD({
@ -295,14 +265,17 @@ export default {
reset: true reset: true
}, },
idField: 'cust_id', idField: 'cust_id',
sort: 'cust_id,desc', sort: '',
crudMethod: { ...crudCustomerbase } crudMethod: { ...crudCustomerbase }
}) })
}, },
data() { data() {
return { return {
permission: {}, permission: {
classes: [], add: ['admin', 'customerbase:add'],
edit: ['admin', 'customerbase:edit'],
del: ['admin', 'customerbase:del']
},
rules: { rules: {
cust_id: [ cust_id: [
{ required: true, message: '客户标识不能为空', trigger: 'blur' } { required: true, message: '客户标识不能为空', trigger: 'blur' }
@ -313,23 +286,8 @@ export default {
cust_name: [ cust_name: [
{ required: true, message: '客户名称 不能为空', trigger: 'blur' } { required: true, message: '客户名称 不能为空', trigger: 'blur' }
], ],
create_id: [
{ required: true, message: '创建人不能为空', trigger: 'blur' }
],
create_name: [
{ required: true, message: '创建人不能为空', trigger: 'blur' }
],
create_time: [
{ required: true, message: '创建时间不能为空', trigger: 'blur' }
],
is_used: [ is_used: [
{ required: true, message: '是否启用不能为空', trigger: 'blur' } { required: true, message: '是否启用不能为空', trigger: 'blur' }
],
is_delete: [
{ required: true, message: '是否删除不能为空', trigger: 'blur' }
],
class_id: [
{ required: true, message: '基础分类不能为空', trigger: 'blur' }
] ]
} }
} }
@ -339,46 +297,6 @@ export default {
[CRUD.HOOK.beforeRefresh]() { [CRUD.HOOK.beforeRefresh]() {
return true return true
}, },
[CRUD.HOOK.afterToCU](crud, form) {
if (form.material_type_id != null) {
this.getSubTypes(form.material_type_id)
} else {
this.getClass()
}
},
getSubTypes(id) {
crudClassstandard.getClassSuperior(id).then(res => {
const date = res.content
this.buildClass(date)
this.classes = date
})
},
getClass() {
crudClassstandard.getClass({ enabled: true, 'base_data_type': '05' }).then(res => {
this.classes = res.content.map(function(obj) {
if (obj.hasChildren) {
obj.children = null
}
return obj
})
})
},
//
loadClass({ action, parentNode, callback }) {
if (action === LOAD_CHILDREN_OPTIONS) {
crudClassstandard.getClass({ pid: parentNode.id }).then(res => {
parentNode.children = res.content.map(function(obj) {
if (obj.hasChildren) {
obj.children = null
}
return obj
})
setTimeout(() => {
callback()
}, 100)
})
}
},
// //
changeEnabled(data, val) { changeEnabled(data, val) {
this.$confirm('此操作将 "' + this.dict.label.is_used[val] + '" ' + data.cust_name + ', 是否继续?', '提示', { this.$confirm('此操作将 "' + this.dict.label.is_used[val] + '" ' + data.cust_name + ', 是否继续?', '提示', {

Loading…
Cancel
Save