Merge remote-tracking branch 'origin/dev2.0' into dev2.0

dev2.0
anthonywj 2 years ago
commit b6abc005f3

@ -1,28 +1,43 @@
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.github.xiaoymin.knife4j.core.util.StrUtil; import com.github.xiaoymin.knife4j.core.util.StrUtil;
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.entity.basic.UdiEntity; import com.glxp.api.entity.basic.UdiEntity;
import com.glxp.api.entity.inv.DeptDeviceDetailEntity; import com.glxp.api.entity.inv.DeptDeviceDetailEntity;
import com.glxp.api.entity.system.SysPdfTemplateRelevanceLabelEntity;
import com.glxp.api.entity.system.SystemPDFTemplateEntity;
import com.glxp.api.req.inout.InspectionPDFTemplateRequest;
import com.glxp.api.req.inv.AddDeptDeviceRequest; import com.glxp.api.req.inv.AddDeptDeviceRequest;
import com.glxp.api.req.inv.FilterDeptDeviceRequest; import com.glxp.api.req.inv.FilterDeptDeviceRequest;
import com.glxp.api.req.inv.FilterDeviceReceiveOrderRequest;
import com.glxp.api.req.system.DeleteRequest; import com.glxp.api.req.system.DeleteRequest;
import com.glxp.api.res.inv.DeptDeviceDetailResponse; import com.glxp.api.res.inv.DeptDeviceDetailResponse;
import com.glxp.api.service.inv.DeptDeviceDetailService; import com.glxp.api.service.inv.DeptDeviceDetailService;
import com.glxp.api.service.system.SystemPDFModuleService;
import com.glxp.api.service.system.SystemPDFTemplateService;
import com.glxp.api.util.CustomUtil; import com.glxp.api.util.CustomUtil;
import com.glxp.api.util.JasperUtils;
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.beans.factory.annotation.Value;
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;
import org.springframework.web.bind.annotation.RequestBody; 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 javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.text.SimpleDateFormat;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.HashMap;
import java.util.List; import java.util.List;
import java.util.Map;
/** /**
* *
@ -33,6 +48,12 @@ public class DeptDeviceDetailController {
@Resource @Resource
private DeptDeviceDetailService deptDeviceDetailService; private DeptDeviceDetailService deptDeviceDetailService;
@Resource
private SystemPDFModuleService systemPDFModuleService;
@Resource
private SystemPDFTemplateService systemPDFTemplateService;
@Value("${file_path}")
private String filePath;
/** /**
* *
@ -116,4 +137,81 @@ public class DeptDeviceDetailController {
return deptDeviceDetailService.deleteDevice(deleteRequest.getId()); return deptDeviceDetailService.deleteDevice(deleteRequest.getId());
} }
/**
*
*
* @param inspectionPDFTemplateRequest
* @return
*/
@AuthRuleAnnotation("")
@PostMapping("/udiwms/inv/deptDevice/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("/udiwms/inv/deptDevice/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("code", obj.getCode() == null ? ' ' : obj.getCode());
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++;
}
}
data.put("data",list);
String param = JSON.toJSONString(data);
JasperUtils.jasperReport(request, response, param, filePath + "pdf/template/" + systemPDFTemplateEntity.getPath(), "pdf");
}
} }

@ -6,9 +6,12 @@ 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.entity.inv.DeviceReceiveOrderDetailEntity; import com.glxp.api.entity.inv.DeviceReceiveOrderDetailEntity;
import com.glxp.api.req.basic.FilterUdiRelRequest;
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.res.basic.UdiRelevanceResponse;
import com.glxp.api.res.inv.DeviceReceiveOrderDetailResponse; import com.glxp.api.res.inv.DeviceReceiveOrderDetailResponse;
import com.glxp.api.service.basic.UdiRelevanceService;
import com.glxp.api.service.inv.DeviceReceiveOrderDetailService; import com.glxp.api.service.inv.DeviceReceiveOrderDetailService;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.springframework.validation.BindingResult; import org.springframework.validation.BindingResult;
@ -29,6 +32,8 @@ public class DeviceReceiveDetailController {
@Resource @Resource
private DeviceReceiveOrderDetailService detailService; private DeviceReceiveOrderDetailService detailService;
@Resource
private UdiRelevanceService udiRelevanceService;
/** /**
* *
@ -128,4 +133,13 @@ public class DeviceReceiveDetailController {
return ResultVOUtils.page(pageInfo); return ResultVOUtils.page(pageInfo);
} }
@GetMapping("/device/receive/order/detail/selectProductByRelId")
public BaseResponse selectProductByRelId(FilterDeviceReceiveOrderDetailRequest detailRequest) {
FilterUdiRelRequest filterUdiRelRequest = new FilterUdiRelRequest();
filterUdiRelRequest.setRelId(detailRequest.getRelId());
UdiRelevanceResponse udiRelevanceResponse = udiRelevanceService.selectOneUdi(filterUdiRelRequest);
return ResultVOUtils.success(udiRelevanceResponse);
}
} }

@ -10,6 +10,7 @@ import com.glxp.api.constant.FileConstant;
import com.glxp.api.dao.schedule.SystemParamConfigDao; import com.glxp.api.dao.schedule.SystemParamConfigDao;
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.inv.DeviceRepairOrderDetailEntity;
import com.glxp.api.entity.purchase.SupCertEntity; import com.glxp.api.entity.purchase.SupCertEntity;
import com.glxp.api.entity.system.SysPdfTemplateRelevanceLabelEntity; import com.glxp.api.entity.system.SysPdfTemplateRelevanceLabelEntity;
import com.glxp.api.entity.system.SysPdfTemplateRelevanceStatemenEntity; import com.glxp.api.entity.system.SysPdfTemplateRelevanceStatemenEntity;
@ -187,16 +188,16 @@ public class DeviceReceiveOrderController {
} }
//查询模板文件是否存在 //查询模板文件是否存在
SysPdfTemplateRelevanceLabelEntity sysPdfTemplateRelevanceLabelEntity = systemPDFModuleService.selectByLabelId(inspectionPDFTemplateRequest.getId()); SysPdfTemplateRelevanceStatemenEntity sysPdfTemplateRelevanceStatemenEntity = systemPDFModuleService.selectByStatemenId(inspectionPDFTemplateRequest.getId());
if (null == sysPdfTemplateRelevanceLabelEntity) { if (null == sysPdfTemplateRelevanceStatemenEntity) {
return ResultVOUtils.error(ResultEnum.DATA_NOT, "所属模块错误"); return ResultVOUtils.error(ResultEnum.DATA_NOT, "所属模块错误");
} }
SystemPDFTemplateEntity systemPDFTemplateEntity = systemPDFTemplateService.selectById(String.valueOf(sysPdfTemplateRelevanceLabelEntity.getTemplateId())); SystemPDFTemplateEntity systemPDFTemplateEntity = systemPDFTemplateService.selectById(String.valueOf(sysPdfTemplateRelevanceStatemenEntity.getTemplateId()));
if (null == systemPDFTemplateEntity) { if (null == systemPDFTemplateEntity) {
return ResultVOUtils.error(ResultEnum.DATA_NOT, "模板错误"); return ResultVOUtils.error(ResultEnum.DATA_NOT, "模板错误");
} }
return ResultVOUtils.success(sysPdfTemplateRelevanceLabelEntity.getTemplateId()); return ResultVOUtils.success(sysPdfTemplateRelevanceStatemenEntity.getTemplateId());
} }
/** /**
@ -216,11 +217,14 @@ public class DeviceReceiveOrderController {
List<Object> list = new ArrayList<>(); List<Object> list = new ArrayList<>();
SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd");//定义新的日期格式 SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd");//定义新的日期格式
FilterDeptDeviceRequest filterDeptDeviceRequest=new FilterDeptDeviceRequest(); FilterDeptDeviceRequest filterDeptDeviceRequest=new FilterDeptDeviceRequest();
filterDeptDeviceRequest.setId(filterDeviceReceiveOrderRequest.getId()); //查询主表
List<DeptDeviceDetailResponse> deptDeviceDetailResponseList = deptDeviceDetailService.filterList(filterDeptDeviceRequest); DeviceReceiveOrderEntity deviceReceiveOrderEntity = deviceReceiveOrderService.selectDeviceOrder(filterDeviceReceiveOrderRequest.getOrderId());
FilterDeviceReceiveOrderDetailRequest filterDeviceReceiveOrderDetailRequest =new FilterDeviceReceiveOrderDetailRequest();
filterDeviceReceiveOrderDetailRequest.setOrderIdFk(filterDeviceReceiveOrderRequest.getOrderId());
List<DeviceReceiveOrderDetailResponse> deviceReceiveOrderDetailResponses = deviceReceiveOrderDetailService.selectByorderIdFk(filterDeviceReceiveOrderDetailRequest);
int i = 1; int i = 1;
if (deptDeviceDetailResponseList != null && deptDeviceDetailResponseList.size() > 0) { if (deviceReceiveOrderDetailResponses != null && deviceReceiveOrderDetailResponses.size() > 0) {
for (DeptDeviceDetailResponse obj : deptDeviceDetailResponseList) { for (DeviceReceiveOrderDetailResponse obj : deviceReceiveOrderDetailResponses) {
Map<String, Object> supData = new HashMap<>(); Map<String, Object> supData = new HashMap<>();
supData.put("orderIdFk", obj.getOrderIdFk() == null ? ' ' : obj.getOrderIdFk()); supData.put("orderIdFk", obj.getOrderIdFk() == null ? ' ' : obj.getOrderIdFk());
supData.put("code", obj.getCode() == null ? ' ' : obj.getCode()); supData.put("code", obj.getCode() == null ? ' ' : obj.getCode());
@ -234,7 +238,7 @@ public class DeviceReceiveOrderController {
supData.put("ggxh", obj.getGgxh() == null ? ' ' : obj.getGgxh()); supData.put("ggxh", obj.getGgxh() == null ? ' ' : obj.getGgxh());
supData.put("supName", obj.getSupName() == null ? ' ' : obj.getSupName()); supData.put("supName", obj.getSupName() == null ? ' ' : obj.getSupName());
supData.put("measname", obj.getMeasname() == null ? ' ' : obj.getMeasname()); supData.put("measname", obj.getMeasname() == null ? ' ' : obj.getMeasname());
supData.put("deviceName", obj.getDeviceName() == null ? ' ' : obj.getDeviceName()); supData.put("deviceName", obj.getProductName() == null ? ' ' : obj.getProductName());
supData.put("manufactory", obj.getManufactory() == null ? ' ' : obj.getManufactory()); supData.put("manufactory", obj.getManufactory() == null ? ' ' : obj.getManufactory());
supData.put("measname", obj.getMeasname() == null ? ' ' : obj.getMeasname()); supData.put("measname", obj.getMeasname() == null ? ' ' : obj.getMeasname());
supData.put("supName", obj.getSupName() == null ? ' ' : obj.getSupName()); supData.put("supName", obj.getSupName() == null ? ' ' : obj.getSupName());

@ -43,5 +43,7 @@ public class FilterDeviceReceiveOrderDetailRequest extends ListPageRequest {
* *
*/ */
private Integer status; private Integer status;
private String relId;
} }

Loading…
Cancel
Save