设备代码提交

dev2.0
郑明梁 2 years ago
parent 319484c145
commit 5c5f667cf5

@ -245,6 +245,22 @@ public class UdiRelevanceController extends BaseController {
} }
@AuthRuleAnnotation("")
@PostMapping("/udiwms/udiinfo/selectProduct")
public BaseResponse selectProduct(@RequestBody FilterUdiRelRequest filterUdiRelRequest) {
List<UdiRelevanceResponse> udiRelevanceResponses = null;
udiRelevanceResponses = udiRelevanceService.filterUdiRelevance(filterUdiRelRequest);
PageInfo<UdiRelevanceResponse> pageInfo;
pageInfo = new PageInfo<>(udiRelevanceResponses);
PageSimpleResponse<UdiRelevanceResponse> pageSimpleResponse = new PageSimpleResponse<>();
pageSimpleResponse.setTotal(pageInfo.getTotal());
pageSimpleResponse.setList(udiRelevanceResponses);
return ResultVOUtils.success(pageSimpleResponse);
}
//多选删除 //多选删除
@AuthRuleAnnotation("") @AuthRuleAnnotation("")
@PostMapping("/udi/udirel/deleteAll") @PostMapping("/udi/udirel/deleteAll")

@ -1,14 +1,35 @@
package com.glxp.api.controller.inv; package com.glxp.api.controller.inv;
import com.alibaba.fastjson.JSON;
import com.github.pagehelper.PageInfo; import com.github.pagehelper.PageInfo;
import com.glxp.api.annotation.AuthRuleAnnotation;
import com.glxp.api.common.enums.ResultEnum; import com.glxp.api.common.enums.ResultEnum;
import com.glxp.api.common.res.BaseResponse; import com.glxp.api.common.res.BaseResponse;
import com.glxp.api.common.util.ResultVOUtils; import com.glxp.api.common.util.ResultVOUtils;
import com.glxp.api.constant.FileConstant;
import com.glxp.api.dao.schedule.SystemParamConfigDao;
import com.glxp.api.entity.inv.DeviceReceiveOrderDetailEntity;
import com.glxp.api.entity.inv.DeviceReceiveOrderEntity; import com.glxp.api.entity.inv.DeviceReceiveOrderEntity;
import com.glxp.api.entity.purchase.SupCertEntity;
import com.glxp.api.entity.system.SysPdfTemplateRelevanceLabelEntity;
import com.glxp.api.entity.system.SysPdfTemplateRelevanceStatemenEntity;
import com.glxp.api.entity.system.SystemPDFTemplateEntity;
import com.glxp.api.req.inout.InspectionPDFTemplateRequest;
import com.glxp.api.req.inv.FilterDeptDeviceRequest;
import com.glxp.api.req.inv.FilterDeviceReceiveOrderDetailRequest;
import com.glxp.api.req.inv.FilterDeviceReceiveOrderRequest; import com.glxp.api.req.inv.FilterDeviceReceiveOrderRequest;
import com.glxp.api.res.inv.DeptDeviceDetailResponse;
import com.glxp.api.res.inv.DeviceReceiveOrderDetailResponse;
import com.glxp.api.res.inv.DeviceReceiveOrderResponse; import com.glxp.api.res.inv.DeviceReceiveOrderResponse;
import com.glxp.api.service.inv.DeptDeviceDetailService;
import com.glxp.api.service.inv.DeviceReceiveOrderDetailService;
import com.glxp.api.service.inv.DeviceReceiveOrderService; import com.glxp.api.service.inv.DeviceReceiveOrderService;
import com.glxp.api.service.system.SystemPDFModuleService;
import com.glxp.api.service.system.SystemPDFTemplateService;
import com.glxp.api.service.system.SystemParamConfigService;
import com.glxp.api.util.JasperUtils;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.validation.BindingResult; import org.springframework.validation.BindingResult;
import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.PostMapping;
@ -16,7 +37,10 @@ import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController; import org.springframework.web.bind.annotation.RestController;
import javax.annotation.Resource; import javax.annotation.Resource;
import java.util.List; import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.text.SimpleDateFormat;
import java.util.*;
/** /**
* *
@ -28,6 +52,19 @@ public class DeviceReceiveOrderController {
@Resource @Resource
private DeviceReceiveOrderService deviceReceiveOrderService; private DeviceReceiveOrderService deviceReceiveOrderService;
@Resource
private SystemParamConfigService systemParamConfigService;
@Resource
private SystemPDFModuleService systemPDFModuleService;
@Resource
private SystemPDFTemplateService systemPDFTemplateService;
@Resource
private DeviceReceiveOrderDetailService deviceReceiveOrderDetailService;
@Resource
private DeptDeviceDetailService deptDeviceDetailService;
@Value("${file_path}")
private String filePath;
/** /**
* *
* *
@ -111,6 +148,7 @@ public class DeviceReceiveOrderController {
return deviceReceiveOrderService.updateStatus(filterDeviceReceiveOrderRequest.getId(), filterDeviceReceiveOrderRequest.getStatus()); return deviceReceiveOrderService.updateStatus(filterDeviceReceiveOrderRequest.getId(), filterDeviceReceiveOrderRequest.getStatus());
} }
/** /**
* *
* *
@ -130,4 +168,83 @@ public class DeviceReceiveOrderController {
} }
@GetMapping("/device/receive/order/getConfig")
public BaseResponse getConfig() {
return ResultVOUtils.success(systemParamConfigService.selectByParamKey("device_product"));
}
/**
*
*
* @param inspectionPDFTemplateRequest
* @return
*/
@AuthRuleAnnotation("")
@PostMapping("/device/receive/order/verifyTemplateFile")
public BaseResponse verifyTemplateFile(@RequestBody InspectionPDFTemplateRequest inspectionPDFTemplateRequest) {
if (null == inspectionPDFTemplateRequest) {
return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL, "参数不能为空!");
}
//查询模板文件是否存在
SysPdfTemplateRelevanceLabelEntity sysPdfTemplateRelevanceLabelEntity = systemPDFModuleService.selectByLabelId(inspectionPDFTemplateRequest.getId());
if (null == sysPdfTemplateRelevanceLabelEntity) {
return ResultVOUtils.error(ResultEnum.DATA_NOT, "所属模块错误");
}
SystemPDFTemplateEntity systemPDFTemplateEntity = systemPDFTemplateService.selectById(String.valueOf(sysPdfTemplateRelevanceLabelEntity.getTemplateId()));
if (null == systemPDFTemplateEntity) {
return ResultVOUtils.error(ResultEnum.DATA_NOT, "模板错误");
}
return ResultVOUtils.success(sysPdfTemplateRelevanceLabelEntity.getTemplateId());
}
/**
*
*
* @param
* @param request
* @param response
* @throws Exception
*/
@AuthRuleAnnotation("")
@PostMapping("/device/receive/order/printOrder")
public void printOrder(@RequestBody FilterDeviceReceiveOrderRequest filterDeviceReceiveOrderRequest, HttpServletRequest request, HttpServletResponse response) throws Exception {
SystemPDFTemplateEntity systemPDFTemplateEntity = systemPDFTemplateService.selectById(filterDeviceReceiveOrderRequest.getTemplateId());
//打印单号标签
Map<String, Object> data = new HashMap<>(1);
List<Object> list = new ArrayList<>();
SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd");//定义新的日期格式
FilterDeptDeviceRequest filterDeptDeviceRequest=new FilterDeptDeviceRequest();
filterDeptDeviceRequest.setId(filterDeviceReceiveOrderRequest.getId());
List<DeptDeviceDetailResponse> deptDeviceDetailResponseList = deptDeviceDetailService.filterList(filterDeptDeviceRequest);
int i = 1;
if (deptDeviceDetailResponseList != null && deptDeviceDetailResponseList.size() > 0) {
for (DeptDeviceDetailResponse obj : deptDeviceDetailResponseList) {
Map<String, Object> supData = new HashMap<>();
supData.put("orderIdFk", obj.getOrderIdFk() == null ? ' ' : obj.getOrderIdFk());
supData.put("batchNo", obj.getBatchNo() == null ? ' ' : obj.getBatchNo());
supData.put("productionDate", obj.getProductionDate() == null ? ' ' : obj.getProductionDate());
supData.put("expireDate", obj.getExpireDate() == null ? ' ' : obj.getExpireDate());
supData.put("serialNo", obj.getSerialNo() == null ? ' ' : obj.getSerialNo());
supData.put("createTime", obj.getCreateTime() == null ? ' ' : obj.getCreateTime());
supData.put("invName", obj.getInvName() == null ? ' ' : obj.getInvName());
supData.put("zczbhhzbapzbh", obj.getZczbhhzbapzbh() == null ? ' ' : obj.getZczbhhzbapzbh());
supData.put("ggxh", obj.getGgxh() == null ? ' ' : obj.getGgxh());
supData.put("supName", obj.getSupName() == null ? ' ' : obj.getSupName());
supData.put("measname", obj.getMeasname() == null ? ' ' : obj.getMeasname());
supData.put("deviceName", obj.getDeviceName() == null ? ' ' : obj.getDeviceName());
supData.put("manufactory", obj.getManufactory() == null ? ' ' : obj.getManufactory());
supData.put("measname", obj.getMeasname() == null ? ' ' : obj.getMeasname());
supData.put("supName", obj.getSupName() == null ? ' ' : obj.getSupName());
list.add(supData);
i++;
}
}
String param = JSON.toJSONString(list);
JasperUtils.jasperReport(request, response, param, filePath + "pdf/template/" + systemPDFTemplateEntity.getPath(), "pdf");
}
} }

@ -53,6 +53,8 @@ public interface UdiProductDao {
List<UdiRelevanceResponse> filterUdiInfo2(FilterUdiRelRequest filterUdiRelRequest); List<UdiRelevanceResponse> filterUdiInfo2(FilterUdiRelRequest filterUdiRelRequest);
UdiRelevanceResponse filterUdiInfoById(String id);
/** /**
* *

@ -93,45 +93,54 @@ public class DeviceReceiveOrderDetailEntity {
/** /**
* *
*/ */
@TableField(exist = false)
private String productName; private String productName;
/** /**
* *
*/ */
@TableField(exist = false)
private String invName; private String invName;
/** /**
* *
*/ */
@TableField(exist = false)
private String invSpaceName; private String invSpaceName;
/** /**
* *
*/ */
@TableField(exist = false)
private String invSpaceCode; private String invSpaceCode;
/** /**
* / * /
*/ */
@TableField(exist = false)
private String zczbhhzbapzbh; private String zczbhhzbapzbh;
/** /**
* *
*/ */
@TableField(exist = false)
private String ylqxzcrbarmc; private String ylqxzcrbarmc;
/** /**
* *
*/ */
@TableField(exist = false)
private String ggxh; private String ggxh;
/** /**
* *
*/ */
@TableField(exist = false)
private Boolean editSerialNo; private Boolean editSerialNo;
/** /**
* *
*/ */
@TableField(exist = false)
private String deptName; private String deptName;
} }

@ -54,4 +54,6 @@ public class FilterDeptDeviceRequest extends ListPageRequest {
*/ */
private Integer addType; private Integer addType;
private Integer id;
} }

@ -40,4 +40,6 @@ public class FilterDeviceReceiveOrderRequest extends ListPageRequest {
*/ */
private String fromInvSpaceCode; private String fromInvSpaceCode;
private String templateId;
} }

@ -151,4 +151,6 @@ public class DeptDeviceDetailResponse {
* *
*/ */
private String invName; private String invName;
private String orderIdFk;
} }

@ -19,6 +19,8 @@ public interface UdiProductService {
List<UdiRelevanceResponse> filterUdiInfo2(FilterUdiRelRequest filterUdiRelRequest); List<UdiRelevanceResponse> filterUdiInfo2(FilterUdiRelRequest filterUdiRelRequest);
UdiRelevanceResponse filterUdiInfoById(String id);
List<UdiProductEntity> filterAllUdiInfo(FilterUdiRelRequest filterUdiRelRequest); List<UdiProductEntity> filterAllUdiInfo(FilterUdiRelRequest filterUdiRelRequest);
UdiProductEntity findByNameCode(String nameCode); UdiProductEntity findByNameCode(String nameCode);

@ -72,6 +72,11 @@ public class UdiProductServiceImpl implements UdiProductService {
return data; return data;
} }
@Override
public UdiRelevanceResponse filterUdiInfoById(String id) {
return udiProductDao.filterUdiInfoById(id);
}
@Override @Override
public List<UdiProductEntity> filterAllUdiInfo(FilterUdiRelRequest filterUdiRelRequest) { public List<UdiProductEntity> filterAllUdiInfo(FilterUdiRelRequest filterUdiRelRequest) {
if (filterUdiRelRequest == null) { if (filterUdiRelRequest == null) {

@ -18,6 +18,8 @@ public interface DeviceReceiveOrderService {
*/ */
List<DeviceReceiveOrderResponse> filterList(FilterDeviceReceiveOrderRequest deviceReceiveOrderRequest); List<DeviceReceiveOrderResponse> filterList(FilterDeviceReceiveOrderRequest deviceReceiveOrderRequest);
DeviceReceiveOrderEntity selectDeviceOrder(String orderId);
/** /**
* *
* *

@ -11,14 +11,19 @@ import com.glxp.api.dao.inv.DeviceReceiveOrderDetailDao;
import com.glxp.api.dao.inv.InvProductDao; import com.glxp.api.dao.inv.InvProductDao;
import com.glxp.api.dao.inv.InvProductDetailDao; import com.glxp.api.dao.inv.InvProductDetailDao;
import com.glxp.api.entity.basic.UdiEntity; import com.glxp.api.entity.basic.UdiEntity;
import com.glxp.api.entity.basic.UdiProductEntity;
import com.glxp.api.entity.inv.DeviceReceiveOrderDetailEntity; import com.glxp.api.entity.inv.DeviceReceiveOrderDetailEntity;
import com.glxp.api.entity.inv.InvProductDetailEntity; import com.glxp.api.entity.inv.InvProductDetailEntity;
import com.glxp.api.entity.inv.InvProductEntity; import com.glxp.api.entity.inv.InvProductEntity;
import com.glxp.api.entity.system.SystemParamConfigEntity;
import com.glxp.api.req.inv.AddDeviceReceiveOrderDetailRequest; import com.glxp.api.req.inv.AddDeviceReceiveOrderDetailRequest;
import com.glxp.api.req.inv.FilterDeviceReceiveOrderDetailRequest; import com.glxp.api.req.inv.FilterDeviceReceiveOrderDetailRequest;
import com.glxp.api.req.inv.FilterInvProductDetailRequest; import com.glxp.api.req.inv.FilterInvProductDetailRequest;
import com.glxp.api.res.basic.UdiRelevanceResponse;
import com.glxp.api.res.inv.DeviceReceiveOrderDetailResponse; import com.glxp.api.res.inv.DeviceReceiveOrderDetailResponse;
import com.glxp.api.service.basic.UdiProductService;
import com.glxp.api.service.inv.DeviceReceiveOrderDetailService; import com.glxp.api.service.inv.DeviceReceiveOrderDetailService;
import com.glxp.api.service.system.SystemParamConfigService;
import com.glxp.api.util.udi.FilterUdiUtils; import com.glxp.api.util.udi.FilterUdiUtils;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
@ -39,6 +44,10 @@ public class DeviceReceiveOrderDetailServiceImpl implements DeviceReceiveOrderDe
private InvProductDetailDao invProductDetailDao; private InvProductDetailDao invProductDetailDao;
@Resource @Resource
private InvProductDao invProductDao; private InvProductDao invProductDao;
@Resource
private SystemParamConfigService systemParamConfigService;
@Resource
private UdiProductService udiProductService;
@Override @Override
public List<DeviceReceiveOrderDetailResponse> filterList(FilterDeviceReceiveOrderDetailRequest detailRequest) { public List<DeviceReceiveOrderDetailResponse> filterList(FilterDeviceReceiveOrderDetailRequest detailRequest) {
@ -96,64 +105,81 @@ public class DeviceReceiveOrderDetailServiceImpl implements DeviceReceiveOrderDe
DeviceReceiveOrderDetailEntity orderDetail = getDeviceReceiveOrderDetailEntity(addDetailRequest.getOrderIdFk(), addDetailRequest.getCode(), invProductDetailEntity); DeviceReceiveOrderDetailEntity orderDetail = getDeviceReceiveOrderDetailEntity(addDetailRequest.getOrderIdFk(), addDetailRequest.getCode(), invProductDetailEntity);
deviceReceiveOrderDetailDao.insert(orderDetail); deviceReceiveOrderDetailDao.insert(orderDetail);
} else { } else {
//通过选库存添加 SystemParamConfigEntity systemParamConfigEntity = systemParamConfigService.selectByParamKey("device_product");
//查询选中的库存信息 if(systemParamConfigEntity.getParamValue().equals("0")){
for (String invProductId : addDetailRequest.getInvProductIds()) { //通过选库存添加
InvProductEntity invProductEntity = invProductDao.selectById(invProductId); //查询选中的库存信息
//查询库存详情 for (String invProductId : addDetailRequest.getInvProductIds()) {
FilterInvProductDetailRequest filterInvProductDetailRequest = new FilterInvProductDetailRequest(); InvProductEntity invProductEntity = invProductDao.selectById(invProductId);
filterInvProductDetailRequest.setRelId(String.valueOf(invProductEntity.getRelIdFk())); //查询库存详情
filterInvProductDetailRequest.setBatchNo(invProductEntity.getBatchNo()); FilterInvProductDetailRequest filterInvProductDetailRequest = new FilterInvProductDetailRequest();
filterInvProductDetailRequest.setDeptCode(invProductEntity.getDeptCode()); filterInvProductDetailRequest.setRelId(String.valueOf(invProductEntity.getRelIdFk()));
filterInvProductDetailRequest.setInvCode(invProductEntity.getInvCode()); filterInvProductDetailRequest.setBatchNo(invProductEntity.getBatchNo());
filterInvProductDetailRequest.setInvSpaceCode(addDetailRequest.getInvSpaceCode()); filterInvProductDetailRequest.setDeptCode(invProductEntity.getDeptCode());
filterInvProductDetailRequest.setSupId(addDetailRequest.getSupId()); filterInvProductDetailRequest.setInvCode(invProductEntity.getInvCode());
List<InvProductDetailEntity> invProductDetailEntities = invProductDetailDao.filterInvProductDetailList(filterInvProductDetailRequest); filterInvProductDetailRequest.setInvSpaceCode(addDetailRequest.getInvSpaceCode());
//计算出在仓库中的设备 filterInvProductDetailRequest.setSupId(addDetailRequest.getSupId());
//提取库存详情中不同的码 List<InvProductDetailEntity> invProductDetailEntities = invProductDetailDao.filterInvProductDetailList(filterInvProductDetailRequest);
List<String> codesList = invProductDetailEntities.stream().map(InvProductDetailEntity::getCode).distinct().collect(Collectors.toList()); //计算出在仓库中的设备
//初始化所有码数量集合 //提取库存详情中不同的码
Map<String, Integer> codeMap = new HashMap<>(codesList.size()); List<String> codesList = invProductDetailEntities.stream().map(InvProductDetailEntity::getCode).distinct().collect(Collectors.toList());
codesList.forEach(code -> codeMap.put(code, 0)); //初始化所有码数量集合
//计算库存详情中的码明细,得出所有存在于库存中的码 Map<String, Integer> codeMap = new HashMap<>(codesList.size());
for (InvProductDetailEntity invProductDetailEntity : invProductDetailEntities) { codesList.forEach(code -> codeMap.put(code, 0));
Integer count = codeMap.get(invProductDetailEntity.getCode()); //计算库存详情中的码明细,得出所有存在于库存中的码
if (invProductDetailEntity.getMainAction().equals(ConstantType.TYPE_PUT)) { for (InvProductDetailEntity invProductDetailEntity : invProductDetailEntities) {
//入库,数量 +1 Integer count = codeMap.get(invProductDetailEntity.getCode());
count = count + 1; if (invProductDetailEntity.getMainAction().equals(ConstantType.TYPE_PUT)) {
} else { //入库,数量 +1
//出库, 数量 -1 count = count + 1;
count = count - 1; } else {
//出库, 数量 -1
count = count - 1;
}
codeMap.put(invProductDetailEntity.getCode(), count);
} }
codeMap.put(invProductDetailEntity.getCode(), count);
}
//根据计算得出的,所有存在于库存中的码明细,生成设备领用记录详情 //根据计算得出的,所有存在于库存中的码明细,生成设备领用记录详情
for (String code : codeMap.keySet()) { for (String code : codeMap.keySet()) {
if (codeMap.get(code) > 0) { if (codeMap.get(code) > 0) {
//查找此条码对应的库存详情数据,根据此库存详情数据,查找仓库货位等信息 //查找此条码对应的库存详情数据,根据此库存详情数据,查找仓库货位等信息
InvProductDetailEntity invProductDetailEntity = new InvProductDetailEntity(); InvProductDetailEntity invProductDetailEntity = new InvProductDetailEntity();
for (InvProductDetailEntity detailEntity : invProductDetailEntities) { for (InvProductDetailEntity detailEntity : invProductDetailEntities) {
if (detailEntity.getCode().equals(code)) { if (detailEntity.getCode().equals(code)) {
invProductDetailEntity = detailEntity; invProductDetailEntity = detailEntity;
break; break;
}
} }
}
//此条码存在于库存中,解析条码生成设备领用记录详情 //此条码存在于库存中,解析条码生成设备领用记录详情
Integer count = codeMap.get(code); Integer count = codeMap.get(code);
if (count > 1) { if (count > 1) {
for (int i = 0; i < count; i++) { for (int i = 0; i < count; i++) {
DeviceReceiveOrderDetailEntity orderDetail = getDeviceReceiveOrderDetailEntity(addDetailRequest.getOrderIdFk(), code, invProductDetailEntity);
//插入设备领用记录详情
deviceReceiveOrderDetailDao.insert(orderDetail);
}
} else {
DeviceReceiveOrderDetailEntity orderDetail = getDeviceReceiveOrderDetailEntity(addDetailRequest.getOrderIdFk(), code, invProductDetailEntity); DeviceReceiveOrderDetailEntity orderDetail = getDeviceReceiveOrderDetailEntity(addDetailRequest.getOrderIdFk(), code, invProductDetailEntity);
//插入设备领用记录详情
deviceReceiveOrderDetailDao.insert(orderDetail); deviceReceiveOrderDetailDao.insert(orderDetail);
} }
} else {
DeviceReceiveOrderDetailEntity orderDetail = getDeviceReceiveOrderDetailEntity(addDetailRequest.getOrderIdFk(), code, invProductDetailEntity);
deviceReceiveOrderDetailDao.insert(orderDetail);
} }
} }
} }
}else{
for (String invProductId : addDetailRequest.getInvProductIds()) {
DeviceReceiveOrderDetailEntity deviceReceiveOrderDetailEntity = new DeviceReceiveOrderDetailEntity();
UdiRelevanceResponse udiRelevanceResponse = udiProductService.filterUdiInfoById(invProductId);
//查询库存详情
deviceReceiveOrderDetailEntity.setRelId(udiRelevanceResponse.getRelId());
deviceReceiveOrderDetailEntity.setOrderIdFk(addDetailRequest.getOrderIdFk());
deviceReceiveOrderDetailEntity.setSupId(udiRelevanceResponse.getUnitFk());
deviceReceiveOrderDetailEntity.setCreateTime(new Date());
deviceReceiveOrderDetailEntity.setUpdateTime(new Date());
deviceReceiveOrderDetailDao.insert(deviceReceiveOrderDetailEntity);
}
} }
} }
return ResultVOUtils.success("添加成功!"); return ResultVOUtils.success("添加成功!");
@ -192,18 +218,25 @@ public class DeviceReceiveOrderDetailServiceImpl implements DeviceReceiveOrderDe
if (null == detailEntity || null == detailEntity.getId()) { if (null == detailEntity || null == detailEntity.getId()) {
return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL); return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL);
} }
//判断新的条码是否重复
FilterDeviceReceiveOrderDetailRequest detailRequest = new FilterDeviceReceiveOrderDetailRequest(); SystemParamConfigEntity systemParamConfigEntity = systemParamConfigService.selectByParamKey("device_product");
detailRequest.setOrderIdFk(detailEntity.getOrderIdFk()); if(systemParamConfigEntity.getParamValue().equals("0")){
detailRequest.setCode(detailRequest.getCode()); //判断新的条码是否重复
List<DeviceReceiveOrderDetailResponse> list = deviceReceiveOrderDetailDao.filterList(detailRequest); FilterDeviceReceiveOrderDetailRequest detailRequest = new FilterDeviceReceiveOrderDetailRequest();
if (CollUtil.isNotEmpty(list)) { detailRequest.setOrderIdFk(detailEntity.getOrderIdFk());
return ResultVOUtils.error(ResultEnum.DATA_REPEAT, "条码重复!"); detailRequest.setCode(detailRequest.getCode());
List<DeviceReceiveOrderDetailResponse> list = deviceReceiveOrderDetailDao.filterList(detailRequest);
if (CollUtil.isNotEmpty(list)) {
return ResultVOUtils.error(ResultEnum.DATA_REPEAT, "条码重复!");
}
}else{
} }
deviceReceiveOrderDetailDao.updateById(detailEntity); deviceReceiveOrderDetailDao.updateById(detailEntity);
return ResultVOUtils.success("更新成功!"); return ResultVOUtils.success("更新成功!");
} }
@Override @Override
public BaseResponse deleteOrderDetail(FilterDeviceReceiveOrderDetailRequest detailRequest) { public BaseResponse deleteOrderDetail(FilterDeviceReceiveOrderDetailRequest detailRequest) {
if (null == detailRequest.getId() && StrUtil.isBlank(detailRequest.getOrderIdFk())) { if (null == detailRequest.getId() && StrUtil.isBlank(detailRequest.getOrderIdFk())) {

@ -3,30 +3,46 @@ package com.glxp.api.service.inv.impl;
import cn.hutool.core.collection.CollUtil; import cn.hutool.core.collection.CollUtil;
import cn.hutool.core.thread.ThreadUtil; import cn.hutool.core.thread.ThreadUtil;
import cn.hutool.core.util.StrUtil; import cn.hutool.core.util.StrUtil;
import com.alibaba.fastjson.JSON;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.github.pagehelper.PageHelper; import com.github.pagehelper.PageHelper;
import com.glxp.api.annotation.AuthRuleAnnotation;
import com.glxp.api.common.enums.ResultEnum; import com.glxp.api.common.enums.ResultEnum;
import com.glxp.api.common.res.BaseResponse; import com.glxp.api.common.res.BaseResponse;
import com.glxp.api.common.util.ResultVOUtils; import com.glxp.api.common.util.ResultVOUtils;
import com.glxp.api.constant.Constant; import com.glxp.api.constant.Constant;
import com.glxp.api.constant.FileConstant;
import com.glxp.api.dao.inv.DeviceReceiveOrderDao; import com.glxp.api.dao.inv.DeviceReceiveOrderDao;
import com.glxp.api.dao.inv.DeviceReceiveOrderDetailDao; import com.glxp.api.dao.inv.DeviceReceiveOrderDetailDao;
import com.glxp.api.entity.inv.DeviceReceiveOrderDetailEntity; import com.glxp.api.entity.inv.DeviceReceiveOrderDetailEntity;
import com.glxp.api.entity.inv.DeviceReceiveOrderEntity; import com.glxp.api.entity.inv.DeviceReceiveOrderEntity;
import com.glxp.api.entity.purchase.SupCertEntity;
import com.glxp.api.entity.purchase.SupCompanyEntity;
import com.glxp.api.entity.system.SysPdfTemplateRelevanceStatemenEntity;
import com.glxp.api.entity.system.SystemPDFTemplateEntity;
import com.glxp.api.req.inout.InspectionPDFTemplateRequest;
import com.glxp.api.req.inv.FilterDeviceReceiveOrderRequest; import com.glxp.api.req.inv.FilterDeviceReceiveOrderRequest;
import com.glxp.api.req.purchase.purPlanPrintRequest;
import com.glxp.api.res.inv.DeviceReceiveOrderResponse; import com.glxp.api.res.inv.DeviceReceiveOrderResponse;
import com.glxp.api.service.auth.CustomerService; import com.glxp.api.service.auth.CustomerService;
import com.glxp.api.service.inv.DeptDeviceDetailService; import com.glxp.api.service.inv.DeptDeviceDetailService;
import com.glxp.api.service.inv.DeviceReceiveOrderService; import com.glxp.api.service.inv.DeviceReceiveOrderService;
import com.glxp.api.service.system.SystemPDFModuleService;
import com.glxp.api.service.system.SystemPDFTemplateService;
import com.glxp.api.util.GennerOrderUtils; import com.glxp.api.util.GennerOrderUtils;
import com.glxp.api.util.JasperUtils;
import com.glxp.api.util.OrderNoTypeBean; import com.glxp.api.util.OrderNoTypeBean;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import javax.annotation.Resource; import javax.annotation.Resource;
import java.util.Collections; import javax.servlet.http.HttpServletRequest;
import java.util.Date; import javax.servlet.http.HttpServletResponse;
import java.util.List; import java.text.SimpleDateFormat;
import java.util.*;
@Slf4j @Slf4j
@Service @Service
@ -55,6 +71,11 @@ public class DeviceReceiveOrderServiceImpl implements DeviceReceiveOrderService
return deviceReceiveOrderDao.filterList(deviceReceiveOrderRequest); return deviceReceiveOrderDao.filterList(deviceReceiveOrderRequest);
} }
@Override
public DeviceReceiveOrderEntity selectDeviceOrder(String orderId) {
return deviceReceiveOrderDao.selectOne(new QueryWrapper<DeviceReceiveOrderEntity>().eq("orderId",orderId));
}
@Override @Override
public BaseResponse addDeviceReceiveOrder(DeviceReceiveOrderEntity deviceReceiveOrderEntity) { public BaseResponse addDeviceReceiveOrder(DeviceReceiveOrderEntity deviceReceiveOrderEntity) {
if (null == deviceReceiveOrderEntity) { if (null == deviceReceiveOrderEntity) {

@ -32,21 +32,12 @@
resultType="com.glxp.api.res.basic.UdiRelevanceResponse"> resultType="com.glxp.api.res.basic.UdiRelevanceResponse">
SELECT basic_products.id, SELECT basic_products.id,
basic_udirel.thirdId, basic_udirel.thirdId,
basic_udirel.thirdName,
basic_udirel.isUseDy, basic_udirel.isUseDy,
basic_udirel.thirdId1, basic_udirel.thirdId1,
basic_udirel.thirdId2, basic_udirel.thirdId2,
basic_udirel.thirdId3, basic_udirel.thirdId3,
basic_udirel.thirdId4, basic_udirel.thirdId4,
basic_udirel.ybbm,
basic_udirel.sptm,
basic_udirel.isDisable, basic_udirel.isDisable,
basic_udirel.thirdName1,
basic_udirel.thirdName2,
basic_udirel.thirdName3,
basic_udirel.thirdName4,
basic_udirel.manufactory,
basic_udirel.measname,
basic_udirel.udplatCode, basic_udirel.udplatCode,
basic_products.nameCode, basic_products.nameCode,
basic_products.packRatio, basic_products.packRatio,
@ -57,7 +48,6 @@
basic_products.zxxsbzbhsydysl, basic_products.zxxsbzbhsydysl,
basic_products.bhxjcpbm, basic_products.bhxjcpbm,
basic_products.bzcj, basic_products.bzcj,
basic_products.addType,
basic_products.deviceRecordKey, basic_products.deviceRecordKey,
basic_products.cpmctymc, basic_products.cpmctymc,
basic_products.cplb, basic_products.cplb,
@ -93,7 +83,8 @@
basic_products.mjfs, basic_products.mjfs,
basic_products.categoryName, basic_products.categoryName,
basic_products.cplx, basic_products.cplx,
basic_products.hchzsb basic_products.hchzsb,
company_product_relevance.customerId as unitFk
FROM (company_product_relevance FROM (company_product_relevance
inner JOIN basic_udirel inner JOIN basic_udirel
ON company_product_relevance.udiRlIdFk = basic_udirel.id) ON company_product_relevance.udiRlIdFk = basic_udirel.id)
@ -188,7 +179,7 @@
allowNoBatch, allowNoExpire, allowNoBatch, allowNoExpire,
allowNoProduct, allowNoSerial, spmc, cplx, hchzsb, cpdls, price, basicPrductRemak1, basicPrductRemak2, allowNoProduct, allowNoSerial, spmc, cplx, hchzsb, cpdls, price, basicPrductRemak1, basicPrductRemak2,
basicPrductRemak3, basicPrductRemak4, basicPrductRemak5, basicPrductRemak6, basicPrductRemak7, basicPrductRemak3, basicPrductRemak4, basicPrductRemak5, basicPrductRemak6, basicPrductRemak7,
basicPrductRemak8,updateTime basicPrductRemak8, updateTime
, sfwblztlcp, cgzmraqxgxx, sfbjwycxsy, zdcfsycs, sfwwjbz, syqsfxyjxmj, mjfs, categoryName, , sfwblztlcp, cgzmraqxgxx, sfbjwycxsy, zdcfsycs, sfwwjbz, syqsfxyjxmj, mjfs, categoryName,
pinyinInitial) pinyinInitial)
values (#{id}, #{uuid}, values (#{id}, #{uuid},
@ -922,7 +913,7 @@
<select id="selectGgxhList" resultType="java.lang.String"> <select id="selectGgxhList" resultType="java.lang.String">
select distinct ggxh select distinct ggxh
from basic_products from basic_products
left join basic_udirel on basic_products.uuid = basic_udirel.uuid left join basic_udirel on basic_products.uuid = basic_udirel.uuid
where basic_udirel.id = #{relId} where basic_udirel.id = #{relId}
</select> </select>
@ -1097,14 +1088,84 @@
<select id="selectUdiByName" resultType="com.glxp.api.entity.basic.UdiProductEntity"> <select id="selectUdiByName" resultType="com.glxp.api.entity.basic.UdiProductEntity">
SELECT b1.*, SELECT b1.*,
b2.useMuti as useMuti, b2.useMuti as useMuti,
b2.useNum as useNum, b2.useNum as useNum,
b2.id as relId, b2.id as relId,
c1.customerId as supId c1.customerId as supId
FROM basic_products b1 FROM basic_products b1
LEFT JOIN basic_udirel b2 ON b1.uuid = b2.uuid LEFT JOIN basic_udirel b2 ON b1.uuid = b2.uuid
LEFT JOIN company_product_relevance c1 ON c1.udiRlIdFk = b2.id LEFT JOIN company_product_relevance c1 ON c1.udiRlIdFk = b2.id
where nameCode = #{nameCode} where nameCode = #{nameCode}
limit 1 limit 1
</select> </select>
<select id="filterUdiInfoById" parameterType="string"
resultType="com.glxp.api.res.basic.UdiRelevanceResponse">
SELECT basic_products.id,
basic_udirel.id as relId,
basic_udirel.thirdId,
basic_udirel.isUseDy,
basic_udirel.thirdId1,
basic_udirel.thirdId2,
basic_udirel.thirdId3,
basic_udirel.thirdId4,
basic_udirel.isDisable,
basic_udirel.udplatCode,
basic_products.nameCode,
basic_products.packRatio,
basic_products.packLevel,
basic_products.packUnit,
basic_products.bhxjsl,
basic_products.bhzxxsbzsl,
basic_products.zxxsbzbhsydysl,
basic_products.bhxjcpbm,
basic_products.bzcj,
basic_products.deviceRecordKey,
basic_products.cpmctymc,
basic_products.cplb,
basic_products.flbm,
basic_products.ggxh,
basic_products.qxlb,
basic_products.tyshxydm,
basic_products.ylqxzcrbarmc,
basic_products.zczbhhzbapzbh,
basic_products.ylqxzcrbarywmc,
basic_products.sydycpbs,
basic_products.uuid,
basic_products.sjcpbm,
basic_products.versionNumber,
basic_products.diType,
basic_products.scbssfbhph,
basic_products.scbssfbhxlh,
basic_products.scbssfbhscrq,
basic_products.scbssfbhsxrq,
basic_products.cpms,
basic_products.originUuid,
basic_products.allowNoBatch,
basic_products.allowNoExpire,
basic_products.allowNoProduct,
basic_products.allowNoSerial,
basic_products.spmc,
basic_products.sfwblztlcp,
basic_products.cgzmraqxgxx,
basic_products.sfbjwycxsy,
basic_products.zdcfsycs,
basic_products.sfwwjbz,
basic_products.syqsfxyjxmj,
basic_products.mjfs,
basic_products.categoryName,
basic_products.cplx,
basic_products.hchzsb,
company_product_relevance.customerId as unitFk
FROM basic_udirel
left JOIN company_product_relevance ON company_product_relevance.udiRlIdFk = basic_udirel.id
left JOIN basic_products ON basic_udirel.uuid = basic_products.uuid
<where>
<if test="id != '' and id != null">
AND basic_udirel.id = #{id}
</if>
</where>
limit 1
</select>
</mapper> </mapper>

@ -37,6 +37,9 @@
<if test="deptCode != null and deptCode != ''"> <if test="deptCode != null and deptCode != ''">
AND t.deptCode = #{deptCode} AND t.deptCode = #{deptCode}
</if> </if>
<if test="id != null">
AND t.id = #{id}
</if>
<if test="invCode != null and invCode != ''"> <if test="invCode != null and invCode != ''">
AND t.invCode = #{invCode} AND t.invCode = #{invCode}
</if> </if>

Loading…
Cancel
Save