修改打印是否按第三方产品信息打印

test
anthonywj 2 years ago
parent 5df22a6981
commit 3db2210e09

@ -185,7 +185,7 @@ public class SysUserController extends BaseController {
return ResultVOUtils.error(ResultEnum.DATA_REPEAT, "当前管理员已存在");
}
AuthAdmin authAdmin = new AuthAdmin();
BeanUtil.copyProperties(authUserSaveRequest, authAdmin);
BeanUtils.copyProperties(authUserSaveRequest, authAdmin);
if (authAdmin.getPassWord() != null) {
authAdmin.setPassWord(PasswordUtils.authAdminPwd(authAdmin.getPassWord()));
}

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

@ -1,5 +1,7 @@
package com.glxp.api.util;
import cn.hutool.core.util.StrUtil;
public class IntUtil {
public static int value(Integer value) {
@ -22,4 +24,12 @@ public class IntUtil {
return false;
else return value;
}
public static int value(String value) {
if (StrUtil.isEmpty(value))
return 0;
else return Integer.parseInt(value);
}
}

Loading…
Cancel
Save