设备代码提交

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("")
@PostMapping("/udi/udirel/deleteAll")

@ -1,14 +1,35 @@
package com.glxp.api.controller.inv;
import com.alibaba.fastjson.JSON;
import com.github.pagehelper.PageInfo;
import com.glxp.api.annotation.AuthRuleAnnotation;
import com.glxp.api.common.enums.ResultEnum;
import com.glxp.api.common.res.BaseResponse;
import com.glxp.api.common.util.ResultVOUtils;
import com.glxp.api.constant.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.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.res.inv.DeptDeviceDetailResponse;
import com.glxp.api.res.inv.DeviceReceiveOrderDetailResponse;
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.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 org.springframework.beans.factory.annotation.Value;
import org.springframework.validation.BindingResult;
import org.springframework.web.bind.annotation.GetMapping;
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 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
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());
}
/**
*
*
@ -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);
UdiRelevanceResponse filterUdiInfoById(String id);
/**
*

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

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

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

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

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

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

@ -18,6 +18,8 @@ public interface DeviceReceiveOrderService {
*/
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.InvProductDetailDao;
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.InvProductDetailEntity;
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.FilterDeviceReceiveOrderDetailRequest;
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.service.basic.UdiProductService;
import com.glxp.api.service.inv.DeviceReceiveOrderDetailService;
import com.glxp.api.service.system.SystemParamConfigService;
import com.glxp.api.util.udi.FilterUdiUtils;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;
@ -39,6 +44,10 @@ public class DeviceReceiveOrderDetailServiceImpl implements DeviceReceiveOrderDe
private InvProductDetailDao invProductDetailDao;
@Resource
private InvProductDao invProductDao;
@Resource
private SystemParamConfigService systemParamConfigService;
@Resource
private UdiProductService udiProductService;
@Override
public List<DeviceReceiveOrderDetailResponse> filterList(FilterDeviceReceiveOrderDetailRequest detailRequest) {
@ -96,6 +105,8 @@ public class DeviceReceiveOrderDetailServiceImpl implements DeviceReceiveOrderDe
DeviceReceiveOrderDetailEntity orderDetail = getDeviceReceiveOrderDetailEntity(addDetailRequest.getOrderIdFk(), addDetailRequest.getCode(), invProductDetailEntity);
deviceReceiveOrderDetailDao.insert(orderDetail);
} else {
SystemParamConfigEntity systemParamConfigEntity = systemParamConfigService.selectByParamKey("device_product");
if(systemParamConfigEntity.getParamValue().equals("0")){
//通过选库存添加
//查询选中的库存信息
for (String invProductId : addDetailRequest.getInvProductIds()) {
@ -155,6 +166,21 @@ public class DeviceReceiveOrderDetailServiceImpl implements DeviceReceiveOrderDe
}
}
}
}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("添加成功!");
}
@ -192,6 +218,9 @@ public class DeviceReceiveOrderDetailServiceImpl implements DeviceReceiveOrderDe
if (null == detailEntity || null == detailEntity.getId()) {
return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL);
}
SystemParamConfigEntity systemParamConfigEntity = systemParamConfigService.selectByParamKey("device_product");
if(systemParamConfigEntity.getParamValue().equals("0")){
//判断新的条码是否重复
FilterDeviceReceiveOrderDetailRequest detailRequest = new FilterDeviceReceiveOrderDetailRequest();
detailRequest.setOrderIdFk(detailEntity.getOrderIdFk());
@ -200,10 +229,14 @@ public class DeviceReceiveOrderDetailServiceImpl implements DeviceReceiveOrderDe
if (CollUtil.isNotEmpty(list)) {
return ResultVOUtils.error(ResultEnum.DATA_REPEAT, "条码重复!");
}
}else{
}
deviceReceiveOrderDetailDao.updateById(detailEntity);
return ResultVOUtils.success("更新成功!");
}
@Override
public BaseResponse deleteOrderDetail(FilterDeviceReceiveOrderDetailRequest detailRequest) {
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.thread.ThreadUtil;
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.glxp.api.annotation.AuthRuleAnnotation;
import com.glxp.api.common.enums.ResultEnum;
import com.glxp.api.common.res.BaseResponse;
import com.glxp.api.common.util.ResultVOUtils;
import com.glxp.api.constant.Constant;
import com.glxp.api.constant.FileConstant;
import com.glxp.api.dao.inv.DeviceReceiveOrderDao;
import com.glxp.api.dao.inv.DeviceReceiveOrderDetailDao;
import com.glxp.api.entity.inv.DeviceReceiveOrderDetailEntity;
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.purchase.purPlanPrintRequest;
import com.glxp.api.res.inv.DeviceReceiveOrderResponse;
import com.glxp.api.service.auth.CustomerService;
import com.glxp.api.service.inv.DeptDeviceDetailService;
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.JasperUtils;
import com.glxp.api.util.OrderNoTypeBean;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;
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 java.util.Collections;
import java.util.Date;
import java.util.List;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.text.SimpleDateFormat;
import java.util.*;
@Slf4j
@Service
@ -55,6 +71,11 @@ public class DeviceReceiveOrderServiceImpl implements DeviceReceiveOrderService
return deviceReceiveOrderDao.filterList(deviceReceiveOrderRequest);
}
@Override
public DeviceReceiveOrderEntity selectDeviceOrder(String orderId) {
return deviceReceiveOrderDao.selectOne(new QueryWrapper<DeviceReceiveOrderEntity>().eq("orderId",orderId));
}
@Override
public BaseResponse addDeviceReceiveOrder(DeviceReceiveOrderEntity deviceReceiveOrderEntity) {
if (null == deviceReceiveOrderEntity) {

@ -32,21 +32,12 @@
resultType="com.glxp.api.res.basic.UdiRelevanceResponse">
SELECT basic_products.id,
basic_udirel.thirdId,
basic_udirel.thirdName,
basic_udirel.isUseDy,
basic_udirel.thirdId1,
basic_udirel.thirdId2,
basic_udirel.thirdId3,
basic_udirel.thirdId4,
basic_udirel.ybbm,
basic_udirel.sptm,
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_products.nameCode,
basic_products.packRatio,
@ -57,7 +48,6 @@
basic_products.zxxsbzbhsydysl,
basic_products.bhxjcpbm,
basic_products.bzcj,
basic_products.addType,
basic_products.deviceRecordKey,
basic_products.cpmctymc,
basic_products.cplb,
@ -93,7 +83,8 @@
basic_products.mjfs,
basic_products.categoryName,
basic_products.cplx,
basic_products.hchzsb
basic_products.hchzsb,
company_product_relevance.customerId as unitFk
FROM (company_product_relevance
inner JOIN basic_udirel
ON company_product_relevance.udiRlIdFk = basic_udirel.id)
@ -1107,4 +1098,74 @@
where nameCode = #{nameCode}
limit 1
</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>

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

Loading…
Cancel
Save