bug修改
This commit is contained in:
@@ -19,7 +19,7 @@ public class Mtd extends BaseEntity
|
|||||||
private Long Id;
|
private Long Id;
|
||||||
|
|
||||||
/** 物料号 */
|
/** 物料号 */
|
||||||
@Excel(name = "物料号")
|
@Excel(name = "物料编号")
|
||||||
private String mid;
|
private String mid;
|
||||||
|
|
||||||
/** 物料描述 */
|
/** 物料描述 */
|
||||||
|
|||||||
@@ -89,4 +89,7 @@ public interface PcdeDetailMapper
|
|||||||
|
|
||||||
String selectWarehouseCodeByPcode(String pcode);
|
String selectWarehouseCodeByPcode(String pcode);
|
||||||
|
|
||||||
|
String selectEncodedIdByPcodeAndWarehouse(@Param("pcode") String pcode,
|
||||||
|
@Param("warehouseCode") String warehouseCode);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -7,6 +7,8 @@ import java.util.concurrent.ConcurrentLinkedQueue;
|
|||||||
import java.util.concurrent.atomic.AtomicInteger;
|
import java.util.concurrent.atomic.AtomicInteger;
|
||||||
|
|
||||||
import com.zg.common.exception.ServiceException;
|
import com.zg.common.exception.ServiceException;
|
||||||
|
import com.zg.common.utils.StringUtils;
|
||||||
|
import com.zg.project.wisdom.domain.GysJh;
|
||||||
import com.zg.project.wisdom.domain.vo.PlanToMtdVO;
|
import com.zg.project.wisdom.domain.vo.PlanToMtdVO;
|
||||||
import com.zg.project.wisdom.mapper.GysJhMapper;
|
import com.zg.project.wisdom.mapper.GysJhMapper;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
@@ -67,9 +69,37 @@ public class MtdServiceImpl implements IMtdService
|
|||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
|
@Transactional(rollbackFor = Exception.class)
|
||||||
public int insertMtd(Mtd mtd)
|
public int insertMtd(Mtd mtd)
|
||||||
{
|
{
|
||||||
return mtdMapper.insertMtd(mtd);
|
if (mtd == null || StringUtils.isBlank(mtd.getMid())) {
|
||||||
|
throw new ServiceException("物料号不能为空");
|
||||||
|
}
|
||||||
|
|
||||||
|
// 1️⃣ 先新增物料字典
|
||||||
|
int rows = mtdMapper.insertMtd(mtd);
|
||||||
|
|
||||||
|
// 2️⃣ 新增成功后,开始“反查供应计划”
|
||||||
|
if (rows > 0 && StringUtils.isNotBlank(mtd.getUnt())) {
|
||||||
|
|
||||||
|
String wlNo = mtd.getMid().trim();
|
||||||
|
String dw = mtd.getUnt().trim();
|
||||||
|
|
||||||
|
// 3️⃣ 根据物料号查询供应计划(可能多条)
|
||||||
|
List<GysJh> jhList = gysJhMapper.selectByWlNo(wlNo);
|
||||||
|
|
||||||
|
if (jhList != null && !jhList.isEmpty()) {
|
||||||
|
for (GysJh jh : jhList) {
|
||||||
|
|
||||||
|
// 4️⃣ 只处理「供应计划中单位为空」的记录
|
||||||
|
if (StringUtils.isBlank(jh.getDw())) {
|
||||||
|
gysJhMapper.updateDwById(jh.getId(), dw);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return rows;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -22,6 +22,10 @@ public class GysJh extends BaseEntity
|
|||||||
/** 主键ID */
|
/** 主键ID */
|
||||||
private Long id;
|
private Long id;
|
||||||
|
|
||||||
|
/** 行号 */
|
||||||
|
@Excel(name = "行号")
|
||||||
|
private String xh;
|
||||||
|
|
||||||
/** 序号 */
|
/** 序号 */
|
||||||
@Excel(name = "序号")
|
@Excel(name = "序号")
|
||||||
private Long indexNo;
|
private Long indexNo;
|
||||||
@@ -62,25 +66,24 @@ public class GysJh extends BaseEntity
|
|||||||
@Excel(name = "合同单价")
|
@Excel(name = "合同单价")
|
||||||
private BigDecimal htDj;
|
private BigDecimal htDj;
|
||||||
|
|
||||||
|
/** 合同数量 */
|
||||||
|
@Excel(name = "合同数量")
|
||||||
|
private BigDecimal htQty;
|
||||||
|
|
||||||
/** SAP订单编号 */
|
/** SAP订单编号 */
|
||||||
@Excel(name = "SAP订单编号")
|
@Excel(name = "SAP订单编号")
|
||||||
private String sapNo;
|
private String sapNo;
|
||||||
|
|
||||||
/** 行号 */
|
|
||||||
@Excel(name = "行号")
|
|
||||||
private String xh;
|
|
||||||
|
|
||||||
/** 计划交货数量 */
|
/** 计划交货数量 */
|
||||||
|
@Excel(name = "计划交货数量")
|
||||||
private BigDecimal jhQty;
|
private BigDecimal jhQty;
|
||||||
|
|
||||||
/** 合同数量 */
|
|
||||||
private BigDecimal htQty;
|
|
||||||
/** 计量单位 */
|
/** 计量单位 */
|
||||||
@Excel(name = "计量单位")
|
@Excel(name = "计量单位")
|
||||||
private String dw;
|
private String dw;
|
||||||
|
|
||||||
/** 0:未到货,1:已入库,2部分入库 */
|
/** 0:未到货,1:已入库,2部分入库 */
|
||||||
@Excel(name = "0:未到货,1:已入库,2部分入库")
|
// @Excel(name = "0:未到货,1:已入库,2部分入库")
|
||||||
private String status;
|
private String status;
|
||||||
|
|
||||||
/** 身份码 */
|
/** 身份码 */
|
||||||
|
|||||||
@@ -109,10 +109,11 @@ public class RkInfo extends BaseEntity {
|
|||||||
private Date returnTime;
|
private Date returnTime;
|
||||||
|
|
||||||
/** 理货员 */
|
/** 理货员 */
|
||||||
@Excel(name = "理货员")
|
// @Excel(name = "理货员")
|
||||||
private String lihuoY;
|
private String lihuoY;
|
||||||
|
|
||||||
/** 理货员名称(联查显示用,导出专用) */
|
/** 理货员名称(联查显示用,导出专用) */
|
||||||
|
@Excel(name = "理货员")
|
||||||
private String lihuoYName;
|
private String lihuoYName;
|
||||||
|
|
||||||
/** 单据号 */
|
/** 单据号 */
|
||||||
|
|||||||
@@ -120,5 +120,16 @@ public interface GysJhMapper
|
|||||||
*/
|
*/
|
||||||
List<PlanToMtdVO> selectMissingMtdItems();
|
List<PlanToMtdVO> selectMissingMtdItems();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据物料号查询供应计划(用于回填单位)
|
||||||
|
*/
|
||||||
|
List<GysJh> selectByWlNo(@Param("wlNo") String wlNo);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据主键更新单位
|
||||||
|
*/
|
||||||
|
int updateDwById(@Param("id") Long id,
|
||||||
|
@Param("dw") String dw);
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -14,6 +14,8 @@ import com.zg.common.exception.ServiceException;
|
|||||||
import com.zg.common.utils.DateUtils;
|
import com.zg.common.utils.DateUtils;
|
||||||
import com.zg.common.utils.SecurityUtils;
|
import com.zg.common.utils.SecurityUtils;
|
||||||
import com.zg.common.utils.StringUtils;
|
import com.zg.common.utils.StringUtils;
|
||||||
|
import com.zg.project.information.domain.Mtd;
|
||||||
|
import com.zg.project.information.mapper.MtdMapper;
|
||||||
import com.zg.project.inventory.AutoInventory.mapper.InventoryMatchScanMapper;
|
import com.zg.project.inventory.AutoInventory.mapper.InventoryMatchScanMapper;
|
||||||
import com.zg.project.inventory.Task.mapper.InventoryTaskMapper;
|
import com.zg.project.inventory.Task.mapper.InventoryTaskMapper;
|
||||||
import com.zg.project.inventory.domain.dto.QueryDTO;
|
import com.zg.project.inventory.domain.dto.QueryDTO;
|
||||||
@@ -74,6 +76,8 @@ public class RkInfoServiceImpl implements IRkInfoService
|
|||||||
@Autowired
|
@Autowired
|
||||||
private PcdeDetailMapper pcdeDetailMapper;
|
private PcdeDetailMapper pcdeDetailMapper;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private MtdMapper mtdMapper;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询库存单据主
|
* 查询库存单据主
|
||||||
@@ -459,13 +463,23 @@ public class RkInfoServiceImpl implements IRkInfoService
|
|||||||
rk.setFycde1(item.getFycde1());
|
rk.setFycde1(item.getFycde1());
|
||||||
rk.setFycde2(item.getFycde2());
|
rk.setFycde2(item.getFycde2());
|
||||||
|
|
||||||
|
if (StringUtils.isBlank(rk.getDw()) && StringUtils.isNotBlank(item.getWlNo())) {
|
||||||
|
Mtd mtd = mtdMapper.selectMtdByMid(item.getWlNo().trim());
|
||||||
|
if (mtd != null && StringUtils.isNotBlank(mtd.getUnt())) {
|
||||||
|
rk.setDw(mtd.getUnt());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// 库位编码前端不传,就不设置库位相关字段(并且不查 encodedId)
|
// 库位编码前端不传,就不设置库位相关字段(并且不查 encodedId)
|
||||||
if (StringUtils.isNotBlank(item.getPcode())) {
|
if (StringUtils.isNotBlank(item.getPcode())) {
|
||||||
// pcode 有值:允许设置/绑定库位
|
// pcode 有值:允许设置/绑定库位
|
||||||
rk.setPcode(item.getPcode());
|
rk.setPcode(item.getPcode());
|
||||||
|
|
||||||
// 只有有 pcode 才查 pcodeId
|
// 只有有 pcode 才查 pcodeId
|
||||||
String encodedId = pcdeDetailMapper.selectEncodedIdByPcode(item.getPcode());
|
String encodedId = pcdeDetailMapper.selectEncodedIdByPcodeAndWarehouse(
|
||||||
|
item.getPcode(),
|
||||||
|
dto.getWarehouseCode()
|
||||||
|
);
|
||||||
rk.setPcodeId(encodedId);
|
rk.setPcodeId(encodedId);
|
||||||
|
|
||||||
// 这些字段如果前端没传,保持 null;如果传了就写入
|
// 这些字段如果前端没传,保持 null;如果传了就写入
|
||||||
|
|||||||
@@ -7,9 +7,9 @@ spring:
|
|||||||
# 主库数据源
|
# 主库数据源
|
||||||
master:
|
master:
|
||||||
# url: jdbc:mysql://101.132.133.142:3306/wisdom?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
|
# url: jdbc:mysql://101.132.133.142:3306/wisdom?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
|
||||||
url: jdbc:mysql://192.168.1.28:3306/wisdom?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
|
# url: jdbc:mysql://192.168.1.28:3306/wisdom?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
|
||||||
# url: jdbc:mysql://192.168.1.192:3306/wisdom?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
|
# url: jdbc:mysql://192.168.1.192:3306/wisdom?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
|
||||||
# url: jdbc:mysql://192.168.1.251:3306/wisdom?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
|
url: jdbc:mysql://192.168.1.251:3306/wisdom?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
|
||||||
# url: jdbc:mysql://localhost:3306/wisdom?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
|
# url: jdbc:mysql://localhost:3306/wisdom?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
|
||||||
username: root
|
username: root
|
||||||
password: shzg
|
password: shzg
|
||||||
|
|||||||
@@ -182,6 +182,15 @@
|
|||||||
LIMIT 1
|
LIMIT 1
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
|
<select id="selectEncodedIdByPcodeAndWarehouse" resultType="java.lang.String">
|
||||||
|
SELECT encoded_id
|
||||||
|
FROM pcde_detail
|
||||||
|
WHERE pcode = #{pcode}
|
||||||
|
AND warehouse_code = #{warehouseCode}
|
||||||
|
AND is_delete = '0'
|
||||||
|
LIMIT 1
|
||||||
|
</select>
|
||||||
|
|
||||||
<!-- 单条插入 -->
|
<!-- 单条插入 -->
|
||||||
<insert id="insertPcdeDetail"
|
<insert id="insertPcdeDetail"
|
||||||
parameterType="PcdeDetail"
|
parameterType="PcdeDetail"
|
||||||
|
|||||||
@@ -239,5 +239,17 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||||||
</foreach>
|
</foreach>
|
||||||
</delete>
|
</delete>
|
||||||
|
|
||||||
|
<select id="selectByWlNo" resultMap="GysJhResult">
|
||||||
|
SELECT *
|
||||||
|
FROM gys_jh
|
||||||
|
WHERE wl_no = #{wlNo}
|
||||||
|
AND is_delete = '0'
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<update id="updateDwById">
|
||||||
|
UPDATE gys_jh
|
||||||
|
SET dw = #{dw}
|
||||||
|
WHERE id = #{id}
|
||||||
|
</update>
|
||||||
</mapper>
|
</mapper>
|
||||||
|
|
||||||
|
|||||||
@@ -354,10 +354,10 @@
|
|||||||
AND ri.xj LIKE concat('%', #{xj}, '%')
|
AND ri.xj LIKE concat('%', #{xj}, '%')
|
||||||
</if>
|
</if>
|
||||||
<if test="billNo != null and billNo != ''">
|
<if test="billNo != null and billNo != ''">
|
||||||
AND ri.bill_no LIKE concat('%', #{billNo}, '%')
|
AND ri.bill_no = #{billNo}
|
||||||
</if>
|
</if>
|
||||||
<if test="billNoCk != null and billNoCk != ''">
|
<if test="billNoCk != null and billNoCk != ''">
|
||||||
AND ri.bill_no_ck LIKE concat('%', #{billNoCk}, '%')
|
AND ri.bill_no_ck = #{billNoCk}
|
||||||
</if>
|
</if>
|
||||||
<if test="xmNo != null and xmNo != ''">
|
<if test="xmNo != null and xmNo != ''">
|
||||||
AND ri.xm_no LIKE concat('%', #{xmNo}, '%')
|
AND ri.xm_no LIKE concat('%', #{xmNo}, '%')
|
||||||
|
|||||||
Reference in New Issue
Block a user