|
|
@ -7,9 +7,11 @@ 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.BasicBussinessTypeEntity;
|
|
|
|
import com.glxp.api.entity.basic.BasicBussinessTypeEntity;
|
|
|
|
import com.glxp.api.entity.basic.UdiProductEntity;
|
|
|
|
import com.glxp.api.entity.basic.UdiProductEntity;
|
|
|
|
|
|
|
|
import com.glxp.api.entity.basic.UdiRelevanceEntity;
|
|
|
|
import com.glxp.api.entity.inout.IoCodeEntity;
|
|
|
|
import com.glxp.api.entity.inout.IoCodeEntity;
|
|
|
|
import com.glxp.api.entity.inout.IoOrderDetailBizEntity;
|
|
|
|
import com.glxp.api.entity.inout.IoOrderDetailBizEntity;
|
|
|
|
import com.glxp.api.entity.system.*;
|
|
|
|
import com.glxp.api.entity.system.*;
|
|
|
|
|
|
|
|
import com.glxp.api.entity.thrsys.ThrProductsEntity;
|
|
|
|
import com.glxp.api.req.basic.FilterOrderPrintRequest;
|
|
|
|
import com.glxp.api.req.basic.FilterOrderPrintRequest;
|
|
|
|
import com.glxp.api.req.inout.FilterOrderRequest;
|
|
|
|
import com.glxp.api.req.inout.FilterOrderRequest;
|
|
|
|
import com.glxp.api.res.basic.UdiRelevanceResponse;
|
|
|
|
import com.glxp.api.res.basic.UdiRelevanceResponse;
|
|
|
@ -20,11 +22,10 @@ import com.glxp.api.service.basic.UdiRelevanceService;
|
|
|
|
import com.glxp.api.service.inout.IoOrderDetailBizService;
|
|
|
|
import com.glxp.api.service.inout.IoOrderDetailBizService;
|
|
|
|
import com.glxp.api.service.inout.IoOrderService;
|
|
|
|
import com.glxp.api.service.inout.IoOrderService;
|
|
|
|
import com.glxp.api.service.inout.impl.IoCodeService;
|
|
|
|
import com.glxp.api.service.inout.impl.IoCodeService;
|
|
|
|
import com.glxp.api.service.system.SystemPDFModuleService;
|
|
|
|
import com.glxp.api.service.system.*;
|
|
|
|
import com.glxp.api.service.system.SystemPDFTemplateRelevanceCodeService;
|
|
|
|
import com.glxp.api.service.thrsys.ThrProductsService;
|
|
|
|
import com.glxp.api.service.system.SystemPDFTemplateRelevanceService;
|
|
|
|
|
|
|
|
import com.glxp.api.service.system.SystemPDFTemplateService;
|
|
|
|
|
|
|
|
import com.glxp.api.util.FileUtils;
|
|
|
|
import com.glxp.api.util.FileUtils;
|
|
|
|
|
|
|
|
import com.glxp.api.util.IntUtil;
|
|
|
|
import com.glxp.api.util.JasperUtils;
|
|
|
|
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.beans.factory.annotation.Value;
|
|
|
@ -69,6 +70,11 @@ public class BasicOrderPrintController {
|
|
|
|
@Value("${file_path}")
|
|
|
|
@Value("${file_path}")
|
|
|
|
private String filePath;
|
|
|
|
private String filePath;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Resource
|
|
|
|
|
|
|
|
SystemParamConfigService systemParamConfigService;
|
|
|
|
|
|
|
|
@Resource
|
|
|
|
|
|
|
|
ThrProductsService thrProductsService;
|
|
|
|
|
|
|
|
|
|
|
|
//校验模板是否正确
|
|
|
|
//校验模板是否正确
|
|
|
|
@AuthRuleAnnotation("")
|
|
|
|
@AuthRuleAnnotation("")
|
|
|
|
@PostMapping("/udiwms/pdf/template/inspection/order/file")
|
|
|
|
@PostMapping("/udiwms/pdf/template/inspection/order/file")
|
|
|
@ -101,7 +107,7 @@ public class BasicOrderPrintController {
|
|
|
|
Map<String, Object> data = new HashMap<>(1);
|
|
|
|
Map<String, Object> data = new HashMap<>(1);
|
|
|
|
List<Object> list = new ArrayList<>();
|
|
|
|
List<Object> list = new ArrayList<>();
|
|
|
|
SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd");//定义新的日期格式
|
|
|
|
SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd");//定义新的日期格式
|
|
|
|
|
|
|
|
String printThird = systemParamConfigService.selectValueByParamKey("order_print_by_thrproduct");
|
|
|
|
//查询打印格式
|
|
|
|
//查询打印格式
|
|
|
|
BasicBussinessTypeEntity basicBussinessTypeEntity = basicBussinessTypeService.findByAction(filterOrderPrintRequest.getAction());
|
|
|
|
BasicBussinessTypeEntity basicBussinessTypeEntity = basicBussinessTypeService.findByAction(filterOrderPrintRequest.getAction());
|
|
|
|
//根据批次号打印
|
|
|
|
//根据批次号打印
|
|
|
@ -117,7 +123,6 @@ public class BasicOrderPrintController {
|
|
|
|
for (IoOrderDetailBizEntity obj : ioOrderDetailBizEntityList) {
|
|
|
|
for (IoOrderDetailBizEntity obj : ioOrderDetailBizEntityList) {
|
|
|
|
//查询产品表
|
|
|
|
//查询产品表
|
|
|
|
UdiProductEntity udiProductEntity = udiProductService.findByUuid(obj.getUuidFk());
|
|
|
|
UdiProductEntity udiProductEntity = udiProductService.findByUuid(obj.getUuidFk());
|
|
|
|
// List<IoOrderInvoiceResponse> ioOrderInvoiceResponses = ioOrderDetailBizService.selectByorderIdFk(obj.getOrderIdFk());
|
|
|
|
|
|
|
|
//组装数据
|
|
|
|
//组装数据
|
|
|
|
Map<String, Object> bizData = new HashMap<>();
|
|
|
|
Map<String, Object> bizData = new HashMap<>();
|
|
|
|
bizData.put("index", i);
|
|
|
|
bizData.put("index", i);
|
|
|
@ -140,19 +145,21 @@ public class BasicOrderPrintController {
|
|
|
|
bizData.put("manufactor", obj.getManufacturer());
|
|
|
|
bizData.put("manufactor", obj.getManufacturer());
|
|
|
|
bizData.put("zczbhhzbapzbh", obj.getCertCode() == null ? ' ' : obj.getCertCode());
|
|
|
|
bizData.put("zczbhhzbapzbh", obj.getCertCode() == null ? ' ' : obj.getCertCode());
|
|
|
|
bizData.put("ylqxzcrbarmc", udiProductEntity.getYlqxzcrbarmc() == null ? ' ' : udiProductEntity.getYlqxzcrbarmc());
|
|
|
|
bizData.put("ylqxzcrbarmc", udiProductEntity.getYlqxzcrbarmc() == null ? ' ' : udiProductEntity.getYlqxzcrbarmc());
|
|
|
|
// bizData.put("cplb", udiProductEntity.getCplb() == null ? ' ' : udiProductEntity.getCplb());
|
|
|
|
|
|
|
|
// if(ioOrderInvoiceResponses != null && ioOrderInvoiceResponses.size()>0){
|
|
|
|
|
|
|
|
// String encode="";
|
|
|
|
if (IntUtil.value(printThird) == 1) {
|
|
|
|
// for (IoOrderInvoiceResponse respons : ioOrderInvoiceResponses) {
|
|
|
|
UdiRelevanceEntity udiRelevanceEntity = udiRelevanceService.selectById(obj.getBindRlFk());
|
|
|
|
// encode+=respons.getInvoiceEncode()+",";
|
|
|
|
ThrProductsEntity thrProductsEntity = thrProductsService.selectByCode(udiRelevanceEntity.getThirdId());
|
|
|
|
// }
|
|
|
|
bizData.put("productName", thrProductsEntity.getName() == null ? ' ' : thrProductsEntity.getName());
|
|
|
|
// encode = encode.substring(0,encode.length()-1);
|
|
|
|
bizData.put("spmc", thrProductsEntity.getName() == null ? ' ' : thrProductsEntity.getName());
|
|
|
|
// bizData.put("invoiceEncode", encode == null ? ' ' : encode);
|
|
|
|
bizData.put("spec", thrProductsEntity.getSpec() == null ? ' ' : thrProductsEntity.getSpec());
|
|
|
|
// SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
|
|
|
bizData.put("measname", thrProductsEntity.getMeasname() == null ? ' ' : thrProductsEntity.getMeasname());
|
|
|
|
// String dateStr = sdf.format(ioOrderInvoiceResponses.get(0).getCreateTime());
|
|
|
|
bizData.put("manufactor", thrProductsEntity.getManufactory());
|
|
|
|
// bizData.put("createTime", dateStr == null ? ' ' : dateStr);
|
|
|
|
bizData.put("zczbhhzbapzbh", thrProductsEntity.getRegisterNo() == null ? ' ' : thrProductsEntity.getRegisterNo());
|
|
|
|
//
|
|
|
|
bizData.put("ylqxzcrbarmc", thrProductsEntity.getYlqxzcrbarmc() == null ? ' ' : thrProductsEntity.getYlqxzcrbarmc());
|
|
|
|
// }
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
list.add(bizData);
|
|
|
|
list.add(bizData);
|
|
|
|
i++;
|
|
|
|
i++;
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -198,7 +205,7 @@ public class BasicOrderPrintController {
|
|
|
|
|
|
|
|
|
|
|
|
bizData.put("spmc", ioOrderDetailBizEntity.getCoName() == null ? ' ' : ioOrderDetailBizEntity.getCoName());
|
|
|
|
bizData.put("spmc", ioOrderDetailBizEntity.getCoName() == null ? ' ' : ioOrderDetailBizEntity.getCoName());
|
|
|
|
bizData.put("spec", ioOrderDetailBizEntity.getSpec() == null ? ' ' : ioOrderDetailBizEntity.getSpec());
|
|
|
|
bizData.put("spec", ioOrderDetailBizEntity.getSpec() == null ? ' ' : ioOrderDetailBizEntity.getSpec());
|
|
|
|
bizData.put("count", ioOrderDetailBizEntity.getCount());
|
|
|
|
bizData.put("count", IntUtil.value(obj.getReCount()));
|
|
|
|
bizData.put("measname", ioOrderDetailBizEntity.getMeasname() == null ? ' ' : ioOrderDetailBizEntity.getMeasname());
|
|
|
|
bizData.put("measname", ioOrderDetailBizEntity.getMeasname() == null ? ' ' : ioOrderDetailBizEntity.getMeasname());
|
|
|
|
bizData.put("price", ioOrderDetailBizEntity.getPrice() == null ? '0' : ioOrderDetailBizEntity.getPrice());
|
|
|
|
bizData.put("price", ioOrderDetailBizEntity.getPrice() == null ? '0' : ioOrderDetailBizEntity.getPrice());
|
|
|
|
bizData.put("batchNo", ioOrderDetailBizEntity.getBatchNo() == null ? ' ' : ioOrderDetailBizEntity.getBatchNo());
|
|
|
|
bizData.put("batchNo", ioOrderDetailBizEntity.getBatchNo() == null ? ' ' : ioOrderDetailBizEntity.getBatchNo());
|
|
|
@ -208,18 +215,19 @@ public class BasicOrderPrintController {
|
|
|
|
bizData.put("manufactor", ioOrderDetailBizEntity.getManufacturer());
|
|
|
|
bizData.put("manufactor", ioOrderDetailBizEntity.getManufacturer());
|
|
|
|
bizData.put("zczbhhzbapzbh", ioOrderDetailBizEntity.getCertCode() == null ? ' ' : ioOrderDetailBizEntity.getCertCode());
|
|
|
|
bizData.put("zczbhhzbapzbh", ioOrderDetailBizEntity.getCertCode() == null ? ' ' : ioOrderDetailBizEntity.getCertCode());
|
|
|
|
|
|
|
|
|
|
|
|
// bizData.put("cplb", udiProductEntity.getCplb() == null ? ' ' : udiProductEntity.getCplb());
|
|
|
|
if (IntUtil.value(printThird) == 1) {
|
|
|
|
// if(ioOrderInvoiceResponses != null && ioOrderInvoiceResponses.size()>0){
|
|
|
|
UdiRelevanceEntity udiRelevanceEntity = udiRelevanceService.selectById(obj.getRelId());
|
|
|
|
// String encode="";
|
|
|
|
ThrProductsEntity thrProductsEntity = thrProductsService.selectByCode(udiRelevanceEntity.getThirdId());
|
|
|
|
// for (IoOrderInvoiceResponse respons : ioOrderInvoiceResponses) {
|
|
|
|
bizData.put("productName", thrProductsEntity.getName() == null ? ' ' : thrProductsEntity.getName());
|
|
|
|
// encode+=respons.getInvoiceEncode()+",";
|
|
|
|
bizData.put("spmc", thrProductsEntity.getName() == null ? ' ' : thrProductsEntity.getName());
|
|
|
|
// }
|
|
|
|
bizData.put("spec", thrProductsEntity.getSpec() == null ? ' ' : thrProductsEntity.getSpec());
|
|
|
|
// encode = encode.substring(0,encode.length()-1);
|
|
|
|
bizData.put("measname", thrProductsEntity.getMeasname() == null ? ' ' : thrProductsEntity.getMeasname());
|
|
|
|
// bizData.put("invoiceEncode", encode == null ? ' ' : encode);
|
|
|
|
bizData.put("manufactor", thrProductsEntity.getManufactory());
|
|
|
|
// SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
|
|
|
bizData.put("zczbhhzbapzbh", thrProductsEntity.getRegisterNo() == null ? ' ' : thrProductsEntity.getRegisterNo());
|
|
|
|
// String dateStr = sdf.format(ioOrderInvoiceResponses.get(0).getCreateTime());
|
|
|
|
bizData.put("ylqxzcrbarmc", thrProductsEntity.getYlqxzcrbarmc() == null ? ' ' : thrProductsEntity.getYlqxzcrbarmc());
|
|
|
|
// bizData.put("createTime", dateStr == null ? ' ' : dateStr);
|
|
|
|
}
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
list.add(bizData);
|
|
|
|
list.add(bizData);
|
|
|
|
i++;
|
|
|
|
i++;
|
|
|
|
}
|
|
|
|
}
|
|
|
|