领用单据相关bug修改,第三方业务单据修改

purchase
anthonyywj2 3 years ago
parent b3c8f5b5fd
commit b3d8fe831d

@ -5,6 +5,7 @@ import cn.hutool.core.util.StrUtil;
import cn.hutool.db.sql.Order;
import com.github.pagehelper.PageInfo;
import com.glxp.api.admin.annotation.AuthRuleAnnotation;
import com.glxp.api.admin.constant.Constant;
import com.glxp.api.admin.constant.ConstantStatus;
import com.glxp.api.admin.controller.inout.utils.CheckOrderUtils;
import com.glxp.api.admin.controller.inout.utils.ContrastErpUtil;
@ -55,6 +56,8 @@ import com.glxp.api.admin.thread.InvProductsTrService;
import com.glxp.api.admin.thread.IoTransInoutService;
import com.glxp.api.admin.util.CustomUtil;
import com.glxp.api.admin.util.DateUtil;
import com.glxp.api.admin.util.GennerOrderUtils;
import com.glxp.api.admin.util.OrderNoTypeBean;
import com.glxp.api.common.enums.ResultEnum;
import com.glxp.api.common.res.BaseResponse;
import com.glxp.api.common.util.ResultVOUtils;
@ -89,6 +92,10 @@ public class OrderDetailController {
@Resource
private ThrOrderService thrOrderService;
@Resource
GennerOrderUtils gennerOrderUtils;
@Resource
private ThrOrderDetailService thrOrderDetailService;
@ -238,15 +245,14 @@ public class OrderDetailController {
StockOrderEntity stockOrderEntity = new StockOrderEntity();
BeanUtils.copyProperties(thrOrderEntity, stockOrderEntity);
String billNo = CustomUtil.getId();
String billNo = gennerOrderUtils.createStOrderNo(new OrderNoTypeBean(Constant.BUS_ORDER, "yyyyMMdd"));
stockOrderEntity.setBillNo(billNo);
BussinessOriginTypeResponse bussinessOriginTypeResponse = bussinessOriginTypeService.finByThirdAction(thrOrderEntity.getBillType());
stockOrderEntity.setBillType(bussinessOriginTypeResponse.getLocalAction());
stockOrderEntity.setId(null);
// stockOrderEntity.setCustomerId(customerId);
// stockOrderEntity.setUnitIdFk(customerId);
stockOrderEntity.setStatus(ConstantStatus.SORDER_ALLOC);//未提交
stockOrderEntity.setLocStorageCode(filterErpOrderRequest.getLocStorageCode());
stockOrderEntity.setInvWarehouseCode(filterErpOrderRequest.getInvWarehouseCode());
stockOrderEntity.setThirdOrderFk(thrOrderEntity.getBillNo());
stockOrderEntity.setSourceType(ConstantStatus.ST_THIRD_SEL);//外部提交
stockOrderEntity.setPrintStatus(ConstantStatus.SORDER_PRINT_UN);//未打印

@ -222,6 +222,21 @@ public class ThrOrderController {
}
@AuthRuleAnnotation("")
@PostMapping("/udiwms/thrsys/delOrderDetail")
public BaseResponse delOrderDetail(@RequestBody DeleteRequest deleteRequest, BindingResult bindingResult) {
if (bindingResult.hasErrors()) {
return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL, bindingResult.getFieldError().getDefaultMessage());
}
boolean b = thrOrderDetailService.deleteById(deleteRequest.getId());
if (b)
return ResultVOUtils.success("删除成功");
else return ResultVOUtils.error(500, "无法删除!");
}
public String selectDelect(ThrOrderEntity thrOrderEntity) {
FilterErpOrderRequest filterErpOrderRequest = new FilterErpOrderRequest();
filterErpOrderRequest.setErpOrderId(thrOrderEntity.getBillNo());

@ -26,4 +26,29 @@ public class ThrOrderDetailEntity {
private String relId;
private String sweepCount;
private String ylqxzcrbarmc;
private String zczbhhzbapzbh;
//销售清单号(第二票)
private String secSalesListNo;
//销售发票号(第一票)
private String firstSalesInvNo;
//销售发票号(第二票)
private String secSalesInvNo;
//开票日期
private String invoiceDate;
private String manufactory;
private boolean allowNoBatch;
private boolean allowNoExpire;
private boolean allowNoProduct;
private String code;
private String serialNo;
private Integer codeId;
}

@ -13,6 +13,7 @@ public class ThrOrderEntity {
private String corpId;
private String corpName;
private String billType;
private String billTypeName;
private String billFlag;
private String thirdSysFk;
private Date updateTime;
@ -35,5 +36,6 @@ public class ThrOrderEntity {
private String locStorageCode;
private Integer editStatus;
private String invWarehouseCode;
}

@ -33,6 +33,8 @@ public class ErpOrderResponse {
private String remark2; //备注2
private String remark3; //备注3
private String billTypeName;
public String getBillNo() {
return billNo;
}

@ -83,7 +83,7 @@ public class SyncUdiService {
return ResultVOUtils.error(500, "请输入完整的产品通用名称!");
}
productInfoFilterRequest.setIsNewest(1);
productInfoFilterRequest.setDiType("1");
// productInfoFilterRequest.setDiType("1");
String keyCache = productInfoFilterRequest.toCacheKey();
if (StrUtil.isEmpty(keyCache)) {

@ -120,6 +120,9 @@ public class ProductInfoServiceImpl implements ProductInfoService {
}
if (productInfoFilterRequest.getPage() != null) {
int offset = (productInfoFilterRequest.getPage() - 1) * productInfoFilterRequest.getLimit();
if (offset < 0) {
offset = 0;
}
productInfoFilterRequest.setPage(offset);
productInfoFilterRequest.setLimit(productInfoFilterRequest.getLimit());
} else {

@ -1,5 +1,6 @@
package com.glxp.api.admin.service.thrsys.impl;
import cn.hutool.core.util.StrUtil;
import com.github.pagehelper.PageHelper;
import com.glxp.api.admin.dao.thrsys.ThrOrderDao;
import com.glxp.api.admin.dao.thrsys.ThrOrderDetailDao;
@ -107,6 +108,11 @@ public class ThrOrderServiceImpl implements ThrOrderService {
@Override
public ThrOrderEntity findByUnique(String billNo, String thirdSysFk) {
if (StrUtil.isEmpty(billNo) || StrUtil.isEmpty(thirdSysFk)) {
return null;
}
FilterThrOrderRequest filterThrOrderRequest = new FilterThrOrderRequest();
filterThrOrderRequest.setBillNo(billNo);
filterThrOrderRequest.setThirdSysFk(thirdSysFk);

@ -5,47 +5,59 @@
<select id="filterThrOrder" parameterType="com.glxp.api.admin.req.thrsys.FilterThrOrderRequest"
resultType="com.glxp.api.admin.entity.thrsys.ThrOrderEntity">
SELECT * FROM thr_order
SELECT thr_order.*,basic_bustype_origin.name billTypeName FROM thr_order
left join basic_bustype_origin on thr_order.billType = basic_bustype_origin.action
<where>
<if test="billNo != '' and billNo != null">
AND billNo = #{billNo}
</if>
<if test="id != '' and id !=null">
AND id = #{id}
AND thr_order.id = #{id}
</if>
<if test="billAction != '' and billAction !=null">
AND billType = #{billAction}
</if>
<if test="originType != '' and originType !=null">
AND originType = #{originType}
</if>
<if test="billFlag != '' and billFlag !=null">
AND billFlag = #{billFlag}
</if>
<if test="unitIdFk != '' and unitIdFk !=null">
AND unitIdFk = #{unitIdFk}
</if>
<if test="thirdSysFk != '' and thirdSysFk != null">
AND thirdSysFk = #{thirdSysFk}
</if>
<if test="corpName != '' and corpName != null">
AND corpName like concat('%',#{corpName},'%')
</if>
<if test="lastUpdateTime!=null and lastUpdateTime!=''">
<![CDATA[ and DATE_FORMAT(updateTime, '%Y-%m-%d %H:%i:%S')>= DATE_FORMAT(#{lastUpdateTime}, '%Y-%m-%d %H:%i:%S') ]]>
</if>
<if test="startDate!=null and startDate!=''">
<![CDATA[ and DATE_FORMAT(billdate, '%Y-%m-%d')>= DATE_FORMAT(#{startDate}, '%Y-%m-%d') ]]>
</if>
<if test="endDate!=null and endDate!=''">
<![CDATA[ and DATE_FORMAT(billdate, '%Y-%m-%d') <= DATE_FORMAT(#{endDate}, '%Y-%m-%d') ]]>
</if>
<if test="editStatus!= null">
AND editStatus = #{editStatus}
</if>
<if test="lastUpdateTime!=null and lastUpdateTime!=''">
<![CDATA[ and DATE_FORMAT(thr_order.updateTime, '%Y-%m-%d %H:%i:%S')>= DATE_FORMAT(#{lastUpdateTime}, '%Y-%m-%d %H:%i:%S') ]]>
</if>
</where>
ORDER BY updateTime DESC
ORDER BY thr_order.updateTime DESC
</select>
<insert id="insertThrOrder" keyProperty="id" parameterType="com.glxp.api.admin.entity.thrsys.ThrOrderEntity">
replace
INTO thr_order
(billNo, billdate, corpId, corpName, billType, billFlag, thirdSysFk, updateTime, originType,
(id,billNo, billdate, corpId, corpName, billType, billFlag, thirdSysFk, updateTime, originType, unitIdFk,
startDate, endDate, createUser, reviewUser, address, linkMan, linkTel, remark, remark1, remark2,
remark3)
remark3,locStorageCode,editStatus,invWarehouseCode)
values (
#{id},
#{billNo},
#{billdate},
#{corpId},
@ -55,6 +67,7 @@
#{thirdSysFk},
#{updateTime},
#{originType},
#{unitIdFk},
#{startDate},
#{endDate},
#{createUser},
@ -65,7 +78,10 @@
#{remark},
#{remark1},
#{remark2},
#{remark3}
#{remark3},
#{locStorageCode},
#{editStatus},
#{invWarehouseCode}
)
</insert>
@ -74,7 +90,7 @@
INTO thr_order
(id,billNo, billdate, corpId, corpName, billType, billFlag, thirdSysFk, updateTime, originType,
startDate, endDate, createUser, reviewUser, address, linkMan, linkTel, remark, remark1, remark2,
remark3)
remark3,invWarehouseCode)
values (
#{id},
#{billNo},
@ -96,32 +112,30 @@
#{remark},
#{remark1},
#{remark2},
#{remark3}
#{remark3},
#{invWarehouseCode}
)
</insert>
<insert id="insertThrOrders" keyProperty="id" parameterType="java.util.List">
replace INTO thr_order
(
billNo,billdate,corpId,corpName,billType,billFlag,thirdSysFk,updateTime,originType,
(billNo, billdate, corpId, corpName, billType, billFlag, thirdSysFk, updateTime, originType, unitIdFk,
startDate, endDate, createUser, reviewUser, address, linkMan, linkTel, remark, remark1, remark2,
remark3
)
remark3,locStorageCode,editStatus,invWarehouseCode,ylqxzcrbarmc,zczbhhzbapzbh,manufactory)
values
<foreach collection="thrOrderEntities" item="item" index="index"
separator=",">
(
#{item.billNo},
(#{item.billNo},
#{item.billdate},
#{item.corpId},
#{item.corpName},
#{item.billType},
#{item.billFlag},
#{item.thirdSysFk},#{item.updateTime},#{item.originType}
#{item.thirdSysFk}, #{item.updateTime}, #{item.originType}, #{item.unitIdFk},
#{item.startDate}, #{item.endDate}, #{item.createUser}, #{item.reviewUser},
#{item.address}, #{item.linkMan}, #{item.linkTel}, #{item.remark}, #{item.remark1},
#{item.remark2}, #{item.remark3})
#{item.remark2}, #{item.remark3},#{item.locStorageCode},#{item.editStatus},#{item.invWarehouseCode},
)
</foreach>
</insert>
@ -159,6 +173,10 @@
<if test="remark1 != null">remark1=#{remark1},</if>
<if test="remark2 != null">remark2=#{remark2},</if>
<if test="remark3 != null">remark3=#{remark3},</if>
<if test="locStorageCode != null">locStorageCode=#{locStorageCode},</if>
<if test="editStatus != null">editStatus=#{editStatus},</if>
<if test="invWarehouseCode != null">invWarehouseCode=#{invWarehouseCode},</if>
</trim>
WHERE id = #{id}
</update>

@ -22,7 +22,7 @@
replace
INTO thr_order_detail
(productId, productName, spec, batchNo, expireDate,
productDate, count, reCount, orderIdFk, thirdSysFk, updateTime, price, corpName)
productDate, `count`, reCount, orderIdFk, thirdSysFk, updateTime, price, corpName,ylqxzcrbarmc,zczbhhzbapzbh,manufactory)
values (
#{productId},
#{productName},
@ -36,7 +36,10 @@
#{thirdSysFk},
#{updateTime},
#{price},
#{corpName}
#{corpName},
#{ylqxzcrbarmc},
#{zczbhhzbapzbh},
#{manufactory}
)
</insert>
@ -45,7 +48,7 @@
replace
INTO thr_order_detail
(id,productId, productName, spec, batchNo, expireDate,
productDate, `count`, reCount, orderIdFk, thirdSysFk, updateTime, price, corpName)
productDate, `count`, reCount, orderIdFk, thirdSysFk, updateTime, price, corpName,ylqxzcrbarmc,zczbhhzbapzbh,manufactory)
values (
#{id},
#{productId},
@ -60,14 +63,18 @@
#{thirdSysFk},
#{updateTime},
#{price},
#{corpName}
#{corpName},
#{ylqxzcrbarmc},
#{zczbhhzbapzbh},
#{manufactory}
)
</insert>
<insert id="insertThrOrderDetails" keyProperty="id" parameterType="java.util.List">
replace INTO thr_order_detail
(productId, productName, spec, batchNo, expireDate,
productDate, count, reCount, orderIdFk, thirdSysFk, updateTime, price, corpName)
productDate, `count`, reCount, orderIdFk, thirdSysFk, updateTime
, price, corpName,ylqxzcrbarmc,zczbhhzbapzbh,manufactory)
values
<foreach collection="thrOrderDetailEntities" item="item" index="index"
@ -75,7 +82,7 @@
(#{item.productId}, #{item.productName}, #{item.spec}, #{item.batchNo}, #{item.expireDate},
#{item.productDate}, #{item.count}, #{item.reCount}, #{item.orderIdFk}, #{item.thirdSysFk},
#{item.updateTime},
#{item.price}, #{item.corpName})
#{item.price}, #{item.corpName}, #{item.ylqxzcrbarmc}, #{item.zczbhhzbapzbh}, #{item.manufactory})
</foreach>
</insert>
@ -105,7 +112,11 @@
<if test="thirdSysFk != null">thirdSysFk=#{thirdSysFk},</if>
<if test="updateTime != null">updateTime=#{updateTime},</if>
<if test="price != null">price=#{price},</if>
<if test="corpName != null">corpName=#{corpName},</if>
<if test="corpName != null">corpName=#{corpName},
</if>
<if test="ylqxzcrbarmc != null">ylqxzcrbarmc=#{ylqxzcrbarmc},</if>
<if test="zczbhhzbapzbh != null">zczbhhzbapzbh=#{zczbhhzbapzbh},</if>
<if test="manufactory != null">manufactory=#{manufactory},</if>
</trim>
WHERE id = #{id}
</update>

Loading…
Cancel
Save