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

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_CHECKED = "4";//已校验
public static String SORDER_DELIVER = "5";//已送货
public static String SORDER_ERROR = "6"; //校验异常
public static final int RECEIVE_UN = 0; //未验收
public static final int RECEIVE_ED = 1; //已验收
@ -155,7 +156,4 @@ public class ConstantStatus {
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) {
String errMsg = "所选业务单据" + exitErp.getErpOrderId() + "已被其他出入库单" + exitErp.getOrderIdFk() + "绑定";
String errMsg = "所选业务单据" + docidStr + "已被其他出入库单" + exitErp.getId() + "绑定";
orderEntity.setRemark(errMsg);
orderEntity.setUpdateTime(new Date());
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("")
@PostMapping("/warehouse/repeatPrintCheck")//TODO 重新校验
public BaseResponse repeatPrintCheck(@RequestBody FilterErpOrderRequest filterErpOrderRequest, BindingResult bindingResult) {

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

@ -73,7 +73,7 @@ public class InvSubWarehouseController {
if (StrUtil.isNotEmpty(filterInvWarehouseRequest.getPcode())) {
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"))
filterInvWarehouseRequest.setUserId(authAdmin.getId() + "");
else {

@ -161,18 +161,13 @@ public class PurApplyController {
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();
String billNo = gennerOrderUtils.createStOrderNo(new OrderNoTypeBean(Constant.JH_ORDER, "yyyyMMdd"));
purPlanEntity.setBillNo(billNo);
purPlanEntity.setBillDate(new Date());
purPlanEntity.setStatus(ConstantStatus.APPLY_DRAFT);
// purPlanEntity.setLocStorageCode(purApplyEntity.getTargetInv());
// purPlanEntity.setInvWarehouseCode(purApplyEntity.getTargetSubInv());
purPlanEntity.setBillType("purPlan");
// purPlanEntity.setBillType(purApplyEntity.getTargetBillType());
// purPlanEntity.setDeptCode(purApplyEntity.getDeptCode());
// purPlanEntity.setCreateBy(purApplyEntity.getAuditBy());
purPlanEntity.setCreateTime(new Date());
purPlanEntity.setUpdateTime(new Date());
purPlanEntity.setApplyBillNo(purApplyEntity.getBillNo());

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

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

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

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

Loading…
Cancel
Save