申购,计划问题,业务单据校验问题

zhairh
anthonywj 3 years ago
parent 90b5b2363d
commit cae5043b72

@ -44,6 +44,7 @@ public class ConstantStatus {
public static String SORDER_CHECK = "3";//待校验 public static String SORDER_CHECK = "3";//待校验
public static String SORDER_CHECKED = "4";//已校验 public static String SORDER_CHECKED = "4";//已校验
public static String SORDER_DELIVER = "5";//已送货 public static String SORDER_DELIVER = "5";//已送货
public static String SORDER_ERROR = "6"; //校验异常
public static final int RECEIVE_UN = 0; //未验收 public static final int RECEIVE_UN = 0; //未验收
public static final int RECEIVE_ED = 1; //已验收 public static final int RECEIVE_ED = 1; //已验收
@ -155,7 +156,4 @@ public class ConstantStatus {
public static final int CERT_PRODUCT = 3; //产品品种 public static final int CERT_PRODUCT = 3; //产品品种
} }

@ -628,9 +628,9 @@ public class OrderDetailController {
} }
ErpOrderEntity exitErp = new ContrastErpUtil().vailErpExit(orderDetailService, erpOrderEntities, importErpOrderRequest.getOrderId()); OrderEntity exitErp = vialErpExit(docids);
if (exitErp != null) { if (exitErp != null) {
String errMsg = "所选业务单据" + exitErp.getErpOrderId() + "已被其他出入库单" + exitErp.getOrderIdFk() + "绑定"; String errMsg = "所选业务单据" + docidStr + "已被其他出入库单" + exitErp.getId() + "绑定";
orderEntity.setRemark(errMsg); orderEntity.setRemark(errMsg);
orderEntity.setUpdateTime(new Date()); orderEntity.setUpdateTime(new Date());
orderService.updateOrder(orderEntity); orderService.updateOrder(orderEntity);
@ -651,6 +651,23 @@ public class OrderDetailController {
} }
public OrderEntity vialErpExit(List<ErpOrderResponse> docids) {
if (CollUtil.isNotEmpty(docids)) {
for (ErpOrderResponse erpOrderResponse : docids) {
OrderFilterRequest orderFilterRequest = new OrderFilterRequest();
orderFilterRequest.setErpFk(erpOrderResponse.getBillNo());
List<OrderEntity> orderEntities = orderService.findAllOrders(orderFilterRequest);
if (CollUtil.isNotEmpty(orderEntities)) {
return orderEntities.get(0);
}
}
}
return null;
}
@AuthRuleAnnotation("") @AuthRuleAnnotation("")
@PostMapping("/warehouse/repeatPrintCheck")//TODO 重新校验 @PostMapping("/warehouse/repeatPrintCheck")//TODO 重新校验
public BaseResponse repeatPrintCheck(@RequestBody FilterErpOrderRequest filterErpOrderRequest, BindingResult bindingResult) { public BaseResponse repeatPrintCheck(@RequestBody FilterErpOrderRequest filterErpOrderRequest, BindingResult bindingResult) {

@ -337,7 +337,6 @@ public class StockOrderController {
stockOrderEntityList = stockOrderService.filterListOr(stockOrderFilterRequest); stockOrderEntityList = stockOrderService.filterListOr(stockOrderFilterRequest);
if (stockOrderEntityList != null && stockOrderEntityList.size() > 0) { if (stockOrderEntityList != null && stockOrderEntityList.size() > 0) {
for (StockOrderEntity stockOrderEntity : stockOrderEntityList) { for (StockOrderEntity stockOrderEntity : stockOrderEntityList) {
ErpOrderResponse erpOrderResponse = new ErpOrderResponse(); ErpOrderResponse erpOrderResponse = new ErpOrderResponse();
BeanUtils.copyProperties(stockOrderEntity, erpOrderResponse); BeanUtils.copyProperties(stockOrderEntity, erpOrderResponse);

@ -73,7 +73,7 @@ public class InvSubWarehouseController {
if (StrUtil.isNotEmpty(filterInvWarehouseRequest.getPcode())) { if (StrUtil.isNotEmpty(filterInvWarehouseRequest.getPcode())) {
AuthAdmin authAdmin = customerService.getUserBean(); AuthAdmin authAdmin = customerService.getUserBean();
if (filterInvWarehouseRequest.getFilter() == null || filterInvWarehouseRequest.getFilter() == 1) { if (filterInvWarehouseRequest.getFilter() == null || filterInvWarehouseRequest.getFilter() == 1 || filterInvWarehouseRequest.getFilter() ==2) {
if (authAdmin.getCustomerId().equals("110")) if (authAdmin.getCustomerId().equals("110"))
filterInvWarehouseRequest.setUserId(authAdmin.getId() + ""); filterInvWarehouseRequest.setUserId(authAdmin.getId() + "");
else { else {

@ -161,18 +161,13 @@ public class PurApplyController {
purApplyService.update(purApplyEntity); purApplyService.update(purApplyEntity);
//审核通过后转换成采购计划单 //审核通过后转换成采购计划单
if (purApplyEntity.getStatus() == ConstantStatus.APPLY_AUDIT_ED && purApplyRequest.isGeneratePlan()) { if (purApplyEntity.getStatus() == ConstantStatus.APPLY_AUDIT_ED && purApplyRequest.isAudtoPlan()) {
PurPlanEntity purPlanEntity = new PurPlanEntity(); PurPlanEntity purPlanEntity = new PurPlanEntity();
String billNo = gennerOrderUtils.createStOrderNo(new OrderNoTypeBean(Constant.JH_ORDER, "yyyyMMdd")); String billNo = gennerOrderUtils.createStOrderNo(new OrderNoTypeBean(Constant.JH_ORDER, "yyyyMMdd"));
purPlanEntity.setBillNo(billNo); purPlanEntity.setBillNo(billNo);
purPlanEntity.setBillDate(new Date()); purPlanEntity.setBillDate(new Date());
purPlanEntity.setStatus(ConstantStatus.APPLY_DRAFT); purPlanEntity.setStatus(ConstantStatus.APPLY_DRAFT);
// purPlanEntity.setLocStorageCode(purApplyEntity.getTargetInv());
// purPlanEntity.setInvWarehouseCode(purApplyEntity.getTargetSubInv());
purPlanEntity.setBillType("purPlan"); purPlanEntity.setBillType("purPlan");
// purPlanEntity.setBillType(purApplyEntity.getTargetBillType());
// purPlanEntity.setDeptCode(purApplyEntity.getDeptCode());
// purPlanEntity.setCreateBy(purApplyEntity.getAuditBy());
purPlanEntity.setCreateTime(new Date()); purPlanEntity.setCreateTime(new Date());
purPlanEntity.setUpdateTime(new Date()); purPlanEntity.setUpdateTime(new Date());
purPlanEntity.setApplyBillNo(purApplyEntity.getBillNo()); purPlanEntity.setApplyBillNo(purApplyEntity.getBillNo());

@ -40,7 +40,7 @@ public class OrderFilterRequest extends ListPageRequest {
private List<String> filterActions; private List<String> filterActions;
private String wmsUserId; private String wmsUserId;
private String wmsUserName; private String wmsUserName;
private String erpFk;
private String stockOrderId; private String stockOrderId;
} }

@ -43,4 +43,6 @@ public class StockOrderFilterRequest extends ListPageRequest {
private String orderId; private String orderId;
private Boolean filterNoSelect;
} }

@ -34,7 +34,8 @@
receiveStatus, erpFk, stockCheckFk, customerId, supId, receiveStatus, erpFk, stockCheckFk, customerId, supId,
exportFilePath, locStorageCode, supplementNo, ullageSupNo, createUser, reviewUser, exportFilePath, locStorageCode, supplementNo, ullageSupNo, createUser, reviewUser,
outChangeEnable, originUllageSupNo, preCheck, updateTime, replicateNo, invWarehouseCode, outChangeEnable, originUllageSupNo, preCheck, updateTime, replicateNo, invWarehouseCode,
fromSubInvCode, createTime, invStorageCode, deptCode, printRemark, codeFillCheck,preInBillNo,preOutBillNo) fromSubInvCode, createTime, invStorageCode, deptCode, printRemark, codeFillCheck,
preInBillNo, preOutBillNo)
values (#{id}, values (#{id},
#{action}, #{action},
#{corpOrderId}, #{corpOrderId},
@ -57,56 +58,60 @@
#{updateTime}, #{replicateNo}, #{invWarehouseCode}, #{fromSubInvCode}, #{createTime}, #{invStorageCode}, #{updateTime}, #{replicateNo}, #{invWarehouseCode}, #{fromSubInvCode}, #{createTime}, #{invStorageCode},
#{deptCode}, #{deptCode},
#{printRemark}, #{printRemark},
#{codeFillCheck},#{preInBillNo},#{preOutBillNo}) #{codeFillCheck}, #{preInBillNo}, #{preOutBillNo})
</insert> </insert>
<insert id="importOrder" keyProperty="id" parameterType="com.glxp.sale.admin.entity.inout.OrderEntity"> <insert id="importOrder" keyProperty="id" parameterType="com.glxp.sale.admin.entity.inout.OrderEntity">
insert insert
ignore ignore
INTO io_order(id, action, corpOrderId, actDate, fromCorpId, actor, mainAction, INTO io_order(id, action, corpOrderId, actDate, fromCorpId, actor, mainAction,
fromCorp, status, remark, exportStatus, fromType, contrastStatus, signStatus, fromCorp, status, remark, exportStatus, fromType, contrastStatus, signStatus,
receiveStatus, erpFk, stockCheckFk, customerId, supId, receiveStatus, erpFk, stockCheckFk, customerId, supId,
exportFilePath, locStorageCode, supplementNo, ullageSupNo, createUser, reviewUser, exportFilePath, locStorageCode, supplementNo, ullageSupNo, createUser, reviewUser,
outChangeEnable, originUllageSupNo, preCheck, updateTime, replicateNo, invWarehouseCode, outChangeEnable, originUllageSupNo, preCheck, updateTime, replicateNo, invWarehouseCode,
fromSubInvCode, createTime, invStorageCode, deptCode, printRemark, codeFillCheck,preInBillNo,preOutBillNo) fromSubInvCode, createTime, invStorageCode, deptCode, printRemark, codeFillCheck,preInBillNo,preOutBillNo)
values (#{id}, values (
#{action}, #{id},
#{corpOrderId}, #{action},
#{actDate}, #{corpOrderId},
#{fromCorpId}, #{actDate},
#{actor}, #{fromCorpId},
#{mainAction}, #{actor},
#{fromCorp}, #{mainAction},
#{status}, #{fromCorp},
#{remark}, #{status},
#{exportStatus}, #{remark},
#{fromType}, #{exportStatus},
#{contrastStatus}, #{fromType},
#{signStatus}, #{contrastStatus},
#{receiveStatus}, #{signStatus},
#{erpFk}, #{receiveStatus},
#{stockCheckFk}, #{erpFk},
#{customerId}, #{stockCheckFk},
#{supId}, #{customerId},
#{exportFilePath}, #{supId},
#{locStorageCode}, #{exportFilePath},
#{supplementNo}, #{locStorageCode},
#{ullageSupNo}, #{supplementNo},
#{createUser}, #{ullageSupNo},
#{reviewUser}, #{createUser},
#{outChangeEnable}, #{reviewUser},
#{originUllageSupNo}, #{outChangeEnable},
#{preCheck}, #{originUllageSupNo},
#{updateTime}, #{preCheck},
#{replicateNo}, #{updateTime},
#{invWarehouseCode}, #{replicateNo},
#{fromSubInvCode}, #{invWarehouseCode},
#{createTime}, #{fromSubInvCode},
#{invStorageCode}, #{createTime},
#{deptCode}, #{invStorageCode},
#{printRemark}, #{deptCode},
#{codeFillCheck},#{preInBillNo},#{preOutBillNo}) #{printRemark},
#{codeFillCheck},
#{preInBillNo},
#{preOutBillNo}
)
</insert> </insert>
@ -287,7 +292,9 @@
<if test="fromCorp != '' and fromCorp!=null"> <if test="fromCorp != '' and fromCorp!=null">
and fromCorp =#{fromCorp} and fromCorp =#{fromCorp}
</if> </if>
<if test="erpFk != '' and erpFk!=null">
and erpFk =#{erpFk}
</if>
<if test="invWarehouseCode != '' and invWarehouseCode!=null"> <if test="invWarehouseCode != '' and invWarehouseCode!=null">
and invWarehouseCode =#{invWarehouseCode} and invWarehouseCode =#{invWarehouseCode}
<if test="userId != '' and userId!=null"> <if test="userId != '' and userId!=null">
@ -326,7 +333,7 @@
and fromCorpId =#{fromCorpId} and fromCorpId =#{fromCorpId}
</if> </if>
<if test="action != '' and action!=null"> <if test="action != '' and action!=null">
and action = #{action} and `action` = #{action}
</if> </if>
<if test="status != '' and status!=null and status!=10"> <if test="status != '' and status!=null and status!=10">
and io_order.status = #{status} and io_order.status = #{status}
@ -383,7 +390,9 @@
and (invWarehouseCode in (select code from inv_warehouse_user WHERE userId =#{userId}) or and (invWarehouseCode in (select code from inv_warehouse_user WHERE userId =#{userId}) or
invWarehouseCode is null or invWarehouseCode='') invWarehouseCode is null or invWarehouseCode='')
</if> </if>
<if test="erpFk != '' and erpFk!=null">
and erpFk like concat('%',#{erpFk},'%')
</if>
</where> </where>
group by io_order.id group by io_order.id
ORDER BY actDate DESC ORDER BY actDate DESC
@ -465,6 +474,9 @@
<if test="invWarehouseCode != '' and invWarehouseCode!=null"> <if test="invWarehouseCode != '' and invWarehouseCode!=null">
and invWarehouseCode =#{invWarehouseCode} and invWarehouseCode =#{invWarehouseCode}
</if> </if>
<if test="erpFk != '' and erpFk!=null">
and erpFk =#{erpFk}
</if>
</where> </where>
group by io_order.id group by io_order.id
ORDER BY actDate DESC ORDER BY actDate DESC
@ -539,6 +551,9 @@
<if test="invWarehouseCode != '' and invWarehouseCode!=null"> <if test="invWarehouseCode != '' and invWarehouseCode!=null">
and invWarehouseCode =#{invWarehouseCode} and invWarehouseCode =#{invWarehouseCode}
</if> </if>
<if test="erpFk != '' and erpFk!=null">
and erpFk =#{erpFk}
</if>
</where> </where>
group by io_order.id group by io_order.id
</select> </select>
@ -568,6 +583,9 @@
<if test="ullageSupNo != '' and ullageSupNo!=null"> <if test="ullageSupNo != '' and ullageSupNo!=null">
and ullageSupNo =#{ullageSupNo} and ullageSupNo =#{ullageSupNo}
</if> </if>
<if test="erpFk != '' and erpFk!=null">
and erpFk =#{erpFk}
</if>
</where> </where>
limit 1 limit 1
</select> </select>
@ -592,7 +610,9 @@
#{item} #{item}
</foreach> </foreach>
</if> </if>
<if test="erpFk != '' and erpFk!=null">
and erpFk =#{erpFk}
</if>
</where> </where>
</select> </select>
@ -623,7 +643,7 @@
from io_order from io_order
left join auth_dept on io_order.deptCode = auth_dept.code left join auth_dept on io_order.deptCode = auth_dept.code
where io_order.status = 4 where io_order.status = 4
and (io_order.id = #{billNo} or io_order.erpFk = #{billNo}) and (io_order.id = #{billNo} or io_order.erpFk = #{billNo}) limit 1
</select> </select>
<select id="selectByIds" resultType="com.glxp.sale.admin.entity.inout.OrderEntity"> <select id="selectByIds" resultType="com.glxp.sale.admin.entity.inout.OrderEntity">
@ -655,7 +675,7 @@
</update> </update>
<select id="selectOrderNos" resultType="com.glxp.sale.admin.res.inout.OrderNoResult"> <select id="selectOrderNos" resultType="com.glxp.sale.admin.res.inout.OrderNoResult">
select id, supplementNo, originUllageSupNo, ullageSupNo, replicateNo,preInBillNo,preOutBillNo select id, supplementNo, originUllageSupNo, ullageSupNo, replicateNo, preInBillNo, preOutBillNo
from io_order from io_order
where id = #{id} where id = #{id}
</select> </select>

@ -219,6 +219,12 @@
<if test="userId!=null"> <if test="userId!=null">
and inv_warehouse_user.userId =#{userId} and inv_warehouse_user.userId =#{userId}
</if> </if>
<if test="filterNoSelect!=null">
and stock_order.orderIdFk is null
</if>
</where> </where>
group by stock_order.id group by stock_order.id
ORDER BY stock_order.billdate DESC ORDER BY stock_order.billdate DESC

Loading…
Cancel
Save