单据按di排序

test
anthonywj 1 year ago
parent 7de61eb509
commit 4d307a42a3

@ -15,6 +15,7 @@ import com.glxp.api.entity.system.SystemPDFTemplateEntity;
import com.glxp.api.req.basic.FilterOrderPrintRequest;
import com.glxp.api.req.inout.FilterOrderRequest;
import com.glxp.api.res.basic.UdiRelevanceResponse;
import com.glxp.api.res.inout.IoOrderDetailCodeResponse;
import com.glxp.api.res.inout.IoOrderResponse;
import com.glxp.api.service.basic.IBasicBussinessTypeService;
import com.glxp.api.service.basic.UdiProductService;
@ -22,10 +23,8 @@ import com.glxp.api.service.basic.UdiRelevanceService;
import com.glxp.api.service.inout.IoOrderDetailBizService;
import com.glxp.api.service.inout.IoOrderService;
import com.glxp.api.service.inout.impl.IoCodeService;
import com.glxp.api.service.system.SystemPDFModuleService;
import com.glxp.api.service.system.SystemPDFTemplateRelevanceCodeService;
import com.glxp.api.service.system.SystemPDFTemplateRelevanceService;
import com.glxp.api.service.system.SystemPDFTemplateService;
import com.glxp.api.service.system.*;
import com.glxp.api.util.IntUtil;
import com.glxp.api.util.JasperUtils;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Value;
@ -38,6 +37,7 @@ import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.text.SimpleDateFormat;
import java.util.*;
import java.util.stream.Collectors;
@Slf4j
@RestController
@ -65,6 +65,8 @@ public class BasicOrderPrintController {
UdiRelevanceService udiRelevanceService;
@Resource
SystemPDFTemplateRelevanceCodeService systemPDFTemplateRelevanceCodeService;
@Resource
SystemParamConfigService systemParamConfigService;
//校验模板是否正确
@AuthRuleAnnotation("")
@ -98,7 +100,7 @@ public class BasicOrderPrintController {
Map<String, Object> data = new HashMap<>(1);
List<Object> list = new ArrayList<>();
SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd");//定义新的日期格式
String value = systemParamConfigService.selectValueByParamKey("order_detail_visible");
//查询打印格式
BasicBussinessTypeEntity basicBussinessTypeEntity = basicBussinessTypeService.findByAction(filterOrderPrintRequest.getAction());
//根据批次号打印
@ -109,6 +111,11 @@ public class BasicOrderPrintController {
IoOrderResponse ioOrderResponse = ioOrderService.filterList(filterOrderRequest).get(0);
//查询业务单详情
List<IoOrderDetailBizEntity> ioOrderDetailBizEntityList = ioOrderDetailBizService.findByOrderId(filterOrderPrintRequest.getOrderIdFk());
if (IntUtil.value(value) == 1) {
ioOrderDetailBizEntityList = ioOrderDetailBizEntityList.stream()
.sorted(Comparator.comparing(IoOrderDetailBizEntity::getNameCode))
.collect(Collectors.toList());
}
int i = 1;
if (ioOrderDetailBizEntityList != null && ioOrderDetailBizEntityList.size() > 0) {
for (IoOrderDetailBizEntity obj : ioOrderDetailBizEntityList) {
@ -162,6 +169,12 @@ public class BasicOrderPrintController {
IoOrderResponse ioOrderResponse = ioOrderService.filterList(filterOrderRequest).get(0);
//查询扫码单详情
List<IoCodeEntity> ioCodeEntityList = ioCodeService.findByOrderId(filterOrderPrintRequest.getOrderIdFk());
if (IntUtil.value(value) == 1) {
ioCodeEntityList = ioCodeEntityList.stream()
.sorted(Comparator.comparing(IoCodeEntity::getNameCode))
.collect(Collectors.toList());
}
//查询业务单据表
List<IoOrderDetailBizEntity> ioOrderDetailBizEntityList = ioOrderDetailBizService.findByOrderId(filterOrderPrintRequest.getOrderIdFk());
int i = 1;
@ -221,8 +234,6 @@ public class BasicOrderPrintController {
}
}
}
data.put("data", list);
String param = JSON.toJSONString(data);
JasperUtils.jasperReport(request, response, param, filePath + "/pdf/template/" + systemPDFTemplateEntity.getPath(), "pdf");

@ -67,6 +67,7 @@ import org.springframework.web.bind.annotation.RestController;
import javax.annotation.Resource;
import java.math.BigDecimal;
import java.util.*;
import java.util.stream.Collectors;
/**
*
@ -551,6 +552,12 @@ public class IoOrderDetailBizController extends BaseController {
@GetMapping("/udiwms/inout/bizDetail/filterList")
public BaseResponse filterList(FilterOrderDetailBizRequest orderDetailBizRequest) {
List<IoOrderDetailBizResponse> list = orderDetailBizService.filterList(orderDetailBizRequest);
String value = systemParamConfigService.selectValueByParamKey("order_detail_visible");
if (IntUtil.value(value) == 1) {
list = list.stream()
.sorted(Comparator.comparing(IoOrderDetailBizResponse::getNameCode))
.collect(Collectors.toList());
}
List<IoOrderDetailCodeEntity> orderDetailCodeEntities = orderDetailCodeService.findByOrderId(orderDetailBizRequest.getOrderIdFk());
ioCheckInoutService.bizOrderCheck2(list, orderDetailCodeEntities);
PageInfo<IoOrderDetailBizResponse> pageInfo = new PageInfo<>(list);

@ -10,17 +10,22 @@ import com.glxp.api.entity.inout.IoOrderDetailBizEntity;
import com.glxp.api.entity.inout.IoOrderDetailCodeEntity;
import com.glxp.api.req.inout.FilterOrderDetailCodeRequest;
import com.glxp.api.res.PageSimpleResponse;
import com.glxp.api.res.inout.IoOrderDetailBizResponse;
import com.glxp.api.res.inout.IoOrderDetailCodeResponse;
import com.glxp.api.service.inout.IoCheckInoutService;
import com.glxp.api.service.inout.IoOrderDetailBizService;
import com.glxp.api.service.inout.IoOrderDetailCodeService;
import com.glxp.api.service.system.SystemParamConfigService;
import com.glxp.api.util.IntUtil;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;
import javax.annotation.Resource;
import java.util.Comparator;
import java.util.List;
import java.util.stream.Collectors;
/**
*
@ -34,7 +39,8 @@ public class IoOrderDetailCodeController {
private IoCheckInoutService ioCheckInoutService;
@Resource
private IoOrderDetailBizService orderDetailBizService;
@Resource
SystemParamConfigService systemParamConfigService;
//获取新增扫码单据详情---临时接口查询
@AuthRuleAnnotation("")
@ -58,6 +64,12 @@ public class IoOrderDetailCodeController {
@GetMapping("udiwms/inout/codeDetail/filterList")
public BaseResponse filterList(FilterOrderDetailCodeRequest detailCodeRequest) {
List<IoOrderDetailCodeResponse> list = ioOrderDetailCodeService.filterList(detailCodeRequest);
String value = systemParamConfigService.selectValueByParamKey("order_detail_visible");
if (IntUtil.value(value) == 1) {
list = list.stream()
.sorted(Comparator.comparing(IoOrderDetailCodeResponse::getNameCode))
.collect(Collectors.toList());
}
List<IoOrderDetailBizEntity> orderDetailBizEntities = orderDetailBizService.findByOrderId(detailCodeRequest.getOrderIdFk());
ioCheckInoutService.codeOrderCheck2(list, orderDetailBizEntities);
PageInfo<IoOrderDetailCodeResponse> pageInfo = new PageInfo<>(list);

@ -1,5 +1,6 @@
package com.glxp.api.controller.inout;
import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.collection.CollUtil;
import cn.hutool.core.date.DateUtil;
import cn.hutool.core.util.StrUtil;
@ -23,6 +24,7 @@ import com.glxp.api.req.inout.*;
import com.glxp.api.res.inout.CptTraceOrderResponse;
import com.glxp.api.res.inout.CptTraceResultResponse;
import com.glxp.api.res.inout.IoOrderDetailResultResponse;
import com.glxp.api.res.inout.IoOrderDetailVo;
import com.glxp.api.service.auth.CustomerService;
import com.glxp.api.service.basic.IBasicBussinessTypeService;
import com.glxp.api.service.inout.*;
@ -32,6 +34,7 @@ import com.glxp.api.service.system.CompanyService;
import com.glxp.api.service.system.SystemPDFModuleService;
import com.glxp.api.service.system.SystemPDFTemplateService;
import com.glxp.api.service.thrsys.ThrProductsService;
import com.glxp.api.util.BeanCopyUtils;
import com.glxp.api.util.JasperUtils;
import com.glxp.api.util.MsDateUtil;
import net.sf.jasperreports.engine.JRException;
@ -142,13 +145,13 @@ public class IoOrderDetailResultController extends BaseController {
public void exportTemplate(FilterOrderDetailResultRequest orderDetailResultRequest, HttpServletResponse response) throws IOException {
// 模拟数据库获取数据
List<IoOrderDetailResultResponse> list = getOrderResult(orderDetailResultRequest);
List<IoOrderDetailVo> orderDetailVos = BeanUtil.copyToList(list, IoOrderDetailVo.class);
response.setCharacterEncoding(StandardCharsets.UTF_8.name());
response.setHeader("content-Type", "application/vnd.ms-excel");
response.setHeader("Content-Disposition",
"attachment;filename=" + URLEncoder.encode("出入库明细" + DateUtil.format(new Date(), "yyyy-MM-dd") + ".xlsx", StandardCharsets.UTF_8.name()));
EasyExcel.write(response.getOutputStream(), IoOrderDetailResultResponse.class).sheet().doWrite(list);
EasyExcel.write(response.getOutputStream(), IoOrderDetailResultResponse.class).sheet().doWrite(orderDetailVos);
}
@ -156,13 +159,13 @@ public class IoOrderDetailResultController extends BaseController {
public void selectExportExcel(@RequestBody FilterOrderDetailResultRequest orderDetailResultRequest, HttpServletResponse response) throws IOException {
// 模拟数据库获取数据
List<IoOrderDetailResultResponse> list = getOrderResult(orderDetailResultRequest);
List<IoOrderDetailVo> orderDetailVos = BeanUtil.copyToList(list, IoOrderDetailVo.class);
response.setCharacterEncoding(StandardCharsets.UTF_8.name());
response.setHeader("content-Type", "application/vnd.ms-excel");
response.setHeader("Content-Disposition",
"attachment;filename=" + URLEncoder.encode("出入库明细" + DateUtil.format(new Date(), "yyyy-MM-dd") + ".xlsx", StandardCharsets.UTF_8.name()));
EasyExcel.write(response.getOutputStream(), IoOrderDetailResultResponse.class).sheet().doWrite(list);
EasyExcel.write(response.getOutputStream(), IoOrderDetailResultResponse.class).sheet().doWrite(orderDetailVos);
}

@ -0,0 +1,81 @@
package com.glxp.api.res.inout;
import com.alibaba.excel.annotation.ExcelProperty;
import lombok.Data;
import java.util.Date;
@Data
public class IoOrderDetailVo {
@ExcelProperty(value = "出入库单号", index = 1)
private String orderIdFk;
/**
* DI
*/
@ExcelProperty(value = "DI/物资编码", index = 2)
private String nameCode;
/**
*
*/
@ExcelProperty(value = "批次号", index = 5)
private String batchNo;
/**
*
*/
@ExcelProperty(value = "生产日期", index = 10)
private String productDate;
/**
*
*/
@ExcelProperty(value = "失效日期", index = 11)
private String expireDate;
/**
*
*/
@ExcelProperty(value = "物资名称", index = 3)
private String coName;
/**
*
*/
@ExcelProperty(value = "注册/备案号", index = 14)
private String certCode;
/**
*
*/
@ExcelProperty(value = "生产企业", index = 13)
private String manufacturer;
/**
*
*/
@ExcelProperty(value = "计量单位", index = 8)
private String measname;
/**
*
*/
@ExcelProperty(value = "规格型号", index = 4)
private String spec;
@ExcelProperty(value = "入库数量", index = 6)
private Integer inCount;
@ExcelProperty(value = "出库数量", index = 7)
private Integer outCount;
@ExcelProperty(value = "单据类型", index = 9)
private String billTypeName;
@ExcelProperty(value = "出入库时间", index = 12)
private Date auditTime;
@ExcelProperty(value = "往来单位", index = 0)
private String fromName;
}

@ -41,7 +41,7 @@
AND bp.cpmctymc like concat('%', #{cpmctymc}, '%')
</if>
<if test="nameCode != null and nameCode != ''">
AND ip.nameCode like concat('%', #{nameCode}, '%')
AND bp.nameCode like concat('%', #{nameCode}, '%')
</if>
<if test="relIdFk != null and relIdFk != ''">
AND ip.relIdFk = #{relIdFk}

Loading…
Cancel
Save