库存明细打印

dev
郑明梁 2 years ago
parent 388d68b3ae
commit 2510734ae2

@ -123,7 +123,7 @@ 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()); // 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);
@ -146,19 +146,19 @@ 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()); // bizData.put("cplb", udiProductEntity.getCplb() == null ? ' ' : udiProductEntity.getCplb());
if(ioOrderInvoiceResponses != null && ioOrderInvoiceResponses.size()>0){ // if(ioOrderInvoiceResponses != null && ioOrderInvoiceResponses.size()>0){
String encode=""; // String encode="";
for (IoOrderInvoiceResponse respons : ioOrderInvoiceResponses) { // for (IoOrderInvoiceResponse respons : ioOrderInvoiceResponses) {
encode+=respons.getInvoiceEncode()+","; // encode+=respons.getInvoiceEncode()+",";
} // }
encode = encode.substring(0,encode.length()-1); // encode = encode.substring(0,encode.length()-1);
bizData.put("invoiceEncode", encode == null ? ' ' : encode); // bizData.put("invoiceEncode", encode == null ? ' ' : encode);
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); // SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
String dateStr = sdf.format(ioOrderInvoiceResponses.get(0).getCreateTime()); // String dateStr = sdf.format(ioOrderInvoiceResponses.get(0).getCreateTime());
bizData.put("createTime", dateStr == null ? ' ' : dateStr); // bizData.put("createTime", dateStr == null ? ' ' : dateStr);
//
} // }
list.add(bizData); list.add(bizData);
i++; i++;
} }
@ -185,7 +185,7 @@ public class BasicOrderPrintController {
} }
//查询产品表 //查询产品表
UdiProductEntity udiProductEntity = udiProductService.findByUuid(ioOrderDetailBizEntity.getUuidFk()); UdiProductEntity udiProductEntity = udiProductService.findByUuid(ioOrderDetailBizEntity.getUuidFk());
List<IoOrderInvoiceResponse> ioOrderInvoiceResponses = ioOrderDetailBizService.selectByorderIdFk(ioOrderDetailBizEntity.getOrderIdFk()); // List<IoOrderInvoiceResponse> ioOrderInvoiceResponses = ioOrderDetailBizService.selectByorderIdFk(ioOrderDetailBizEntity.getOrderIdFk());
//组装数据 //组装数据
Map<String, Object> bizData = new HashMap<>(); Map<String, Object> bizData = new HashMap<>();
bizData.put("index", i); bizData.put("index", i);
@ -208,18 +208,18 @@ 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("ylqxzcrbarmc", udiProductEntity.getYlqxzcrbarmc() == null ? ' ' : udiProductEntity.getYlqxzcrbarmc()); bizData.put("ylqxzcrbarmc", udiProductEntity.getYlqxzcrbarmc() == null ? ' ' : udiProductEntity.getYlqxzcrbarmc());
bizData.put("cplb", udiProductEntity.getCplb() == null ? ' ' : udiProductEntity.getCplb()); // bizData.put("cplb", udiProductEntity.getCplb() == null ? ' ' : udiProductEntity.getCplb());
if(ioOrderInvoiceResponses != null && ioOrderInvoiceResponses.size()>0){ // if(ioOrderInvoiceResponses != null && ioOrderInvoiceResponses.size()>0){
String encode=""; // String encode="";
for (IoOrderInvoiceResponse respons : ioOrderInvoiceResponses) { // for (IoOrderInvoiceResponse respons : ioOrderInvoiceResponses) {
encode+=respons.getInvoiceEncode()+","; // encode+=respons.getInvoiceEncode()+",";
} // }
encode = encode.substring(0,encode.length()-1); // encode = encode.substring(0,encode.length()-1);
bizData.put("invoiceEncode", encode == null ? ' ' : encode); // bizData.put("invoiceEncode", encode == null ? ' ' : encode);
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); // SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
String dateStr = sdf.format(ioOrderInvoiceResponses.get(0).getCreateTime()); // String dateStr = sdf.format(ioOrderInvoiceResponses.get(0).getCreateTime());
bizData.put("createTime", dateStr == null ? ' ' : dateStr); // bizData.put("createTime", dateStr == null ? ' ' : dateStr);
} // }
list.add(bizData); list.add(bizData);
i++; i++;
} }

@ -11,13 +11,16 @@ 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.constant.ConstantType; import com.glxp.api.constant.ConstantType;
import com.glxp.api.controller.BaseController; import com.glxp.api.controller.BaseController;
import com.glxp.api.entity.auth.AuthAdmin;
import com.glxp.api.entity.auth.AuthCompany; import com.glxp.api.entity.auth.AuthCompany;
import com.glxp.api.entity.basic.BasicBussinessTypeEntity; import com.glxp.api.entity.basic.BasicBussinessTypeEntity;
import com.glxp.api.entity.inout.IoOrderDetailBizEntity; import com.glxp.api.entity.inout.IoOrderDetailBizEntity;
import com.glxp.api.entity.inout.IoOrderDetailCodeEntity; import com.glxp.api.entity.inout.IoOrderDetailCodeEntity;
import com.glxp.api.entity.inout.IoOrderEntity; import com.glxp.api.entity.inout.IoOrderEntity;
import com.glxp.api.entity.inout.IoOrderInvoiceEntity;
import com.glxp.api.entity.system.SysPdfTemplateRelevanceStatemenEntity; import com.glxp.api.entity.system.SysPdfTemplateRelevanceStatemenEntity;
import com.glxp.api.entity.system.SystemPDFTemplateEntity; import com.glxp.api.entity.system.SystemPDFTemplateEntity;
import com.glxp.api.entity.thrsys.ThrProductsEntity;
import com.glxp.api.req.inout.*; import com.glxp.api.req.inout.*;
import com.glxp.api.res.inout.CptTraceOrderResponse; import com.glxp.api.res.inout.CptTraceOrderResponse;
import com.glxp.api.res.inout.CptTraceResultResponse; import com.glxp.api.res.inout.CptTraceResultResponse;
@ -26,11 +29,14 @@ import com.glxp.api.res.inout.IoOrderDetailResultResponse;
import com.glxp.api.service.auth.AuthCompanyService; import com.glxp.api.service.auth.AuthCompanyService;
import com.glxp.api.service.basic.IBasicBussinessTypeService; import com.glxp.api.service.basic.IBasicBussinessTypeService;
import com.glxp.api.service.inout.*; import com.glxp.api.service.inout.*;
import com.glxp.api.service.inout.impl.IoOrderInvoiceService;
import com.glxp.api.service.system.SystemPDFModuleService; import com.glxp.api.service.system.SystemPDFModuleService;
import com.glxp.api.service.system.SystemPDFTemplateService; import com.glxp.api.service.system.SystemPDFTemplateService;
import com.glxp.api.service.thrsys.ThrProductsService;
import com.glxp.api.util.DateUtil; import com.glxp.api.util.DateUtil;
import com.glxp.api.util.JasperUtils; import com.glxp.api.util.JasperUtils;
import net.sf.jasperreports.engine.JRException; import net.sf.jasperreports.engine.JRException;
import org.apache.commons.collections.CollectionUtils;
import org.springframework.beans.factory.annotation.Value; import org.springframework.beans.factory.annotation.Value;
import org.springframework.validation.BindingResult; import org.springframework.validation.BindingResult;
import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.GetMapping;
@ -66,6 +72,10 @@ public class IoOrderDetailResultController extends BaseController {
private String filePath; private String filePath;
@Resource @Resource
AuthCompanyService authCompanyService; AuthCompanyService authCompanyService;
@Resource
private ThrProductsService thrProductsService;
@Resource
private IoOrderInvoiceService ioOrderInvoiceService;
/** /**
* *
@ -205,6 +215,7 @@ public class IoOrderDetailResultController extends BaseController {
if (filterOrderDetailResultRequest.getList() != null && filterOrderDetailResultRequest.getList().size() > 0) { if (filterOrderDetailResultRequest.getList() != null && filterOrderDetailResultRequest.getList().size() > 0) {
ioOrderDetailResultResponseList = filterOrderDetailResultRequest.getList(); ioOrderDetailResultResponseList = filterOrderDetailResultRequest.getList();
} else { } else {
//按查询打印 //按查询打印
FilterOrderRequest filterOrderRequest = new FilterOrderRequest(); FilterOrderRequest filterOrderRequest = new FilterOrderRequest();
filterOrderRequest.setVueType(filterOrderDetailResultRequest.getActionType()); filterOrderRequest.setVueType(filterOrderDetailResultRequest.getActionType());
@ -226,6 +237,25 @@ public class IoOrderDetailResultController extends BaseController {
} }
int i = 1; int i = 1;
for (IoOrderDetailResultResponse ioOrderDetailResultResponse : ioOrderDetailResultResponseList) { for (IoOrderDetailResultResponse ioOrderDetailResultResponse : ioOrderDetailResultResponseList) {
//查询第三方产品产品类别
ThrProductsEntity thrProductsEntity = thrProductsService.filterThrProductsByMainId(ioOrderDetailResultResponse.getBindRlFk() + "");
//查询发票信息
String dateStr="";
List<String> encodeList=new ArrayList<>();
IoOrderInvoiceRequest ioOrderInvoiceRequest=new IoOrderInvoiceRequest();
ioOrderInvoiceRequest.setBindRlFk(ioOrderDetailResultResponse.getBindRlFk() + "");
ioOrderInvoiceRequest.setOrderIdFk(ioOrderDetailResultResponse.getOrderIdFk());
ioOrderInvoiceRequest.setBatchNo(ioOrderDetailResultResponse.getBatchNo());
List<IoOrderInvoiceEntity> ioOrderInvoiceEntityList=ioOrderInvoiceService.selectOrderInvoice(ioOrderInvoiceRequest);
for (IoOrderInvoiceEntity ioOrderInvoiceEntity : ioOrderInvoiceEntityList) {
encodeList.add(ioOrderInvoiceEntity.getInvoiceEncode());
}
String encode=String.join(",", encodeList);
if(CollectionUtils.isNotEmpty(ioOrderInvoiceEntityList)){
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
dateStr = sdf.format(ioOrderInvoiceEntityList.get(0).getCreateTime());
}
//组装数据 //组装数据
Map<String, Object> ioOrderDetailResultData = new HashMap<>(); Map<String, Object> ioOrderDetailResultData = new HashMap<>();
ioOrderDetailResultData.put("index", String.valueOf(i)); ioOrderDetailResultData.put("index", String.valueOf(i));
@ -248,11 +278,15 @@ public class IoOrderDetailResultController extends BaseController {
ioOrderDetailResultData.put("billTypeName", ioOrderDetailResultResponse.getBillTypeName() == null ? ' ' : ioOrderDetailResultResponse.getBillTypeName()); ioOrderDetailResultData.put("billTypeName", ioOrderDetailResultResponse.getBillTypeName() == null ? ' ' : ioOrderDetailResultResponse.getBillTypeName());
ioOrderDetailResultData.put("mainAction", ioOrderDetailResultResponse.getMainAction() == null ? ' ' : ioOrderDetailResultResponse.getMainAction()); ioOrderDetailResultData.put("mainAction", ioOrderDetailResultResponse.getMainAction() == null ? ' ' : ioOrderDetailResultResponse.getMainAction());
ioOrderDetailResultData.put("auditTime", ioOrderDetailResultResponse.getAuditTime() == null ? ' ' : formatter.format(ioOrderDetailResultResponse.getAuditTime())); ioOrderDetailResultData.put("auditTime", ioOrderDetailResultResponse.getAuditTime() == null ? ' ' : formatter.format(ioOrderDetailResultResponse.getAuditTime()));
if(thrProductsEntity!=null){
ioOrderDetailResultData.put("cplb", thrProductsEntity.getCplb() == null ? ' ' : thrProductsEntity.getCplb());
}
ioOrderDetailResultData.put("invoiceEncode", encode);
ioOrderDetailResultData.put("createTime", dateStr);
list.add(ioOrderDetailResultData); list.add(ioOrderDetailResultData);
i++; i++;
} }
data.put("data", list); data.put("data", list);
String param = JSON.toJSONString(data); String param = JSON.toJSONString(data);
JasperUtils.jasperReport(request, response, param, filePath + "pdf/template/" + systemPDFTemplateEntity.getPath(), "pdf"); JasperUtils.jasperReport(request, response, param, filePath + "pdf/template/" + systemPDFTemplateEntity.getPath(), "pdf");
@ -260,6 +294,7 @@ public class IoOrderDetailResultController extends BaseController {
} }
/** /**
* UDI * UDI
*/ */

@ -34,5 +34,5 @@ public interface ThrProductsDao extends BaseMapperPlus<ThrProductsDao, ThrProduc
List<ThrProductsEntity> selectThrProducts(FilterThrProductsRequest filterThrProductsRequest); List<ThrProductsEntity> selectThrProducts(FilterThrProductsRequest filterThrProductsRequest);
int insertOrUpdateEntity(ThrProductsEntity record); int insertOrUpdateEntity(ThrProductsEntity record);
ThrProductsEntity filterThrProductsByMainId(@Param("relId") String relId);
} }

@ -35,5 +35,6 @@ public interface ThrProductsService extends IService<ThrProductsEntity> {
Boolean isExit(String code, String thirdIdFk); Boolean isExit(String code, String thirdIdFk);
ThrProductsEntity filterThrProductsByMainId(String relId);
} }

@ -114,4 +114,10 @@ public class ThrProductsServiceImpl extends ServiceImpl<ThrProductsDao, ThrProdu
return false; return false;
} }
@Override
public ThrProductsEntity filterThrProductsByMainId(String relId) {
return thrProductsDao.filterThrProductsByMainId(relId);
}
} }

@ -344,4 +344,17 @@
updateUser = #{updateUser,jdbcType=VARCHAR}, updateUser = #{updateUser,jdbcType=VARCHAR},
</trim> </trim>
</insert> </insert>
<select id="filterThrProductsByMainId" resultType="com.glxp.api.entity.thrsys.ThrProductsEntity">
SELECT *
FROM thr_products
LEFT JOIN basic_udirel ON thr_products.id = basic_udirel.mainId
<where>
<if test="relId != '' and relId != null">
AND basic_udirel.id = #{relId}
</if>
</where>
</select>
</mapper> </mapper>

Loading…
Cancel
Save