新增退货补单流程,诏安两个分库问题,单据明细打印问题

test
anthonywj 1 year ago
parent 0264531d28
commit f23c0136dd

@ -424,7 +424,14 @@ public class BasicBussinessTypeController extends BaseController {
bussinessTypeFilterRequest.setEnable(true);
//bussinessTypeFilterRequest.setMainAction(ConstantType.TYPE_PUT);
List<BasicBussinessTypeResponse> bussinessTypeEntities;
bussinessTypeEntities = basicBussinessTypeService.filterList(bussinessTypeFilterRequest);
if (StrUtil.isNotEmpty(bussinessTypeFilterRequest.getInvCode())) {
bussinessTypeEntities = basicBussinessTypeService.filterJoinByInv(bussinessTypeFilterRequest);
} else {
bussinessTypeEntities = basicBussinessTypeService.filterList(bussinessTypeFilterRequest);
}
PageSimpleResponse<BasicBussinessTypeResponse> pageSimpleResponse = new PageSimpleResponse<>();
pageSimpleResponse.setList(bussinessTypeEntities);
return ResultVOUtils.success(pageSimpleResponse);

@ -3,6 +3,7 @@ package com.glxp.api.controller.inout;
import cn.hutool.core.collection.CollUtil;
import cn.hutool.core.date.DateUtil;
import cn.hutool.core.util.StrUtil;
import com.alibaba.excel.EasyExcel;
import com.alibaba.fastjson.JSON;
import com.github.pagehelper.PageInfo;
import com.glxp.api.annotation.AuthRuleAnnotation;
@ -46,6 +47,8 @@ import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.net.URLEncoder;
import java.nio.charset.StandardCharsets;
import java.text.SimpleDateFormat;
import java.util.*;
@ -98,12 +101,20 @@ public class IoOrderDetailResultController extends BaseController {
@AuthRuleAnnotation("")
@GetMapping("/udiwms/inout/resultDetail/filterOrderList")
public BaseResponse filterOrderList(FilterOrderDetailResultRequest orderDetailResultRequest) {
PageInfo<IoOrderDetailResultResponse> pageInfo = new PageInfo<>(getOrderResult(orderDetailResultRequest));
return ResultVOUtils.page(pageInfo);
}
public List<IoOrderDetailResultResponse> getOrderResult(FilterOrderDetailResultRequest orderDetailResultRequest) {
if (CollUtil.isNotEmpty(orderDetailResultRequest.getList())) {
return orderDetailResultRequest.getList();
}
FilterOrderRequest filterOrderRequest = new FilterOrderRequest();
filterOrderRequest.setVueType(orderDetailResultRequest.getActionType());
List<String> actions = orderService.setActions(filterOrderRequest);
if (CollUtil.isEmpty(actions)) {
return ResultVOUtils.success("");
return Collections.emptyList();
}
orderDetailResultRequest.setActions(actions);
AuthAdmin authAdmin = customerService.getUserBean();
@ -122,13 +133,39 @@ public class IoOrderDetailResultController extends BaseController {
}
String fromName = orderDetailResultResponse.getFromName();
orderDetailResultResponse.setFromName(fromName);
}
return list;
}
}
PageInfo<IoOrderDetailResultResponse> pageInfo = new PageInfo<>(list);
return ResultVOUtils.page(pageInfo);
@GetMapping("/udiwms/inout/resultDetail/exportExcel")
public void exportTemplate(FilterOrderDetailResultRequest orderDetailResultRequest, HttpServletResponse response) throws IOException {
// 模拟数据库获取数据
List<IoOrderDetailResultResponse> list = getOrderResult(orderDetailResultRequest);
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);
}
@PostMapping("/udiwms/inout/resultDetail/selectExportExcel")
public void selectExportExcel(@RequestBody FilterOrderDetailResultRequest orderDetailResultRequest, HttpServletResponse response) throws IOException {
// 模拟数据库获取数据
List<IoOrderDetailResultResponse> list = getOrderResult(orderDetailResultRequest);
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);
}
/**
* pda
*/

@ -123,7 +123,7 @@ public class BasicBusTypePreEntity {
@TableField(value = "remark")
private String remark;
// 创建单模式1送货至入库单模式2.向上级补单模式3.预验收转入库单模式4.寄售转入库单模式
// 创建单模式1送货至入库单模式2.向上级补单模式3.预验收转入库单模式4.寄售转入库单模式5.退货向上级补单模式
@TableField(value = "createType")
private int createType;

@ -136,7 +136,7 @@ public class IoOrderDetailBizEntity {
*
*/
@TableField(value = "`count`")
private int count;
private Integer count;
/**
*

@ -139,13 +139,13 @@ public class IoOrderDetailResultEntity {
*
*/
@TableField(value = "`count`")
private int count;
private Integer count;
/**
*
*/
@TableField(value = "reCount")
private int reCount;
private Integer reCount;
/**
*

@ -1,6 +1,8 @@
package com.glxp.api.res.inout;
import cn.hutool.core.util.StrUtil;
import com.alibaba.excel.annotation.ExcelProperty;
import com.alibaba.excel.annotation.write.style.ColumnWidth;
import lombok.Data;
import java.math.BigDecimal;
@ -17,6 +19,7 @@ public class IoOrderDetailResultResponse {
/**
*
*/
@ExcelProperty(value = "出入库单号", index = 1)
private String orderIdFk;
/**
@ -32,31 +35,37 @@ public class IoOrderDetailResultResponse {
/**
* 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;
/**
@ -67,16 +76,19 @@ public class IoOrderDetailResultResponse {
/**
*
*/
@ExcelProperty(value = "生产企业", index = 13)
private String manufacturer;
/**
*
*/
@ExcelProperty(value = "计量单位", index = 8)
private String measname;
/**
*
*/
@ExcelProperty(value = "规格型号", index = 4)
private String spec;
/**
@ -123,8 +135,9 @@ public class IoOrderDetailResultResponse {
*
*/
private int reCount;
@ExcelProperty(value = "入库数量", index = 6)
private Integer inCount;
@ExcelProperty(value = "出库数量", index = 7)
private Integer outCount;
@ -159,10 +172,14 @@ public class IoOrderDetailResultResponse {
private String remark5;
private int acceptCount;
private String fromCorpName;
@ExcelProperty(value = "单据类型", index = 9)
private String billTypeName;
private String mainAction;
@ExcelProperty(value = "出入库时间", index = 12)
private Date auditTime;
private String fromInvName;
@ExcelProperty(value = "往来单位", index = 0)
private String fromName;
/**

@ -213,13 +213,34 @@ public class IoChangeInoutService {
InvWarehouseEntity invWarehouseEntity = invWarehouseService.findByInvSubByCode(Constant.INV_PRE_CODE);
outOrder.setFromInvCode(invWarehouseEntity.getCode());
outOrder.setFromDeptCode(invWarehouseEntity.getParentId());
} else {
} else if (bussinessChangeTypeEntity.getCreateType() == 5) { //退货出库
outOrder.setCustomerId(Constant.SYSTEM_CUSTOMER_ID);
InvWarehouseEntity curInv = invWarehouseService.findByInvSubByCode(orderEntity.getInvCode());
InvWarehouseEntity upInv = invWarehouseService.findByInvSubByCode(curInv.getParentCode());
if (upInv != null) {
outOrder.setFromInvCode(upInv.getCode());
outOrder.setFromDeptCode(upInv.getParentId());
outOrder.setFromCorp(null);
} else {
outOrder.setCustomerId(corpName);
outOrder.setFromCorp(corpName);
}
//原先流程---使用流转单据默认仓库
// outOrder.setFromInvCode(bussinessChangeTypeEntity.getDefaultInvCode());
// outOrder.setFromDeptCode(bussinessChangeTypeEntity.getDefaultDeptCode());
} else { //向上级补单模式
outOrder.setCustomerId(Constant.SYSTEM_CUSTOMER_ID);
InvWarehouseEntity curInv = invWarehouseService.findByInvSubByCode(orderEntity.getInvCode());
InvWarehouseEntity upInv = invWarehouseService.findByInvSubByCode(curInv.getParentCode());
if (upInv != null) {
outOrder.setFromInvCode(upInv.getCode());
outOrder.setFromDeptCode(upInv.getParentId());
outOrder.setFromCorp(null);
}
if (StrUtil.isNotEmpty(bussinessChangeTypeEntity.getDefaultInvCode())) {
outOrder.setFromInvCode(bussinessChangeTypeEntity.getDefaultInvCode());
outOrder.setFromDeptCode(bussinessChangeTypeEntity.getDefaultDeptCode());
}
//原先流程---使用流转单据默认仓库
// outOrder.setFromInvCode(bussinessChangeTypeEntity.getDefaultInvCode());

Loading…
Cancel
Save