feat(sip): 优化发货清单导入提示信息并完善订单信息导出
- 在 DeliveryList 模型中添加 deliveryCode 字段,用于显示发货单号 - 修改 DeliveryListMapper.xml 中的查询语句,关联 order_delivery 表获取发货单号 - 优化 DeliveryListServiceImpl 中的导入校验逻辑,提供更详细的错误提示信息- 在 OrderInfo 模型中为 projectCode、orderType 和 status 字段添加 Excel 注解,优化订单信息导出 - 修改 ProjectProductInfoMapper.xml 中的插入语句,使用 values() 函数更新重复记录master
parent
5a0eca0ff6
commit
735dc7c5d1
|
@ -58,6 +58,7 @@ public class DeliveryList extends BaseEntity
|
|||
private Date deletedAt;
|
||||
|
||||
private String productName;
|
||||
private String deliveryCode;
|
||||
private String description;
|
||||
|
||||
|
||||
|
|
|
@ -27,6 +27,7 @@ public class OrderInfo extends BaseEntity
|
|||
private Long id;
|
||||
|
||||
/** 关联项目编号 */
|
||||
@Excel(name = "项目编号")
|
||||
private String projectCode;
|
||||
|
||||
/** 合同编号,唯一 */
|
||||
|
@ -66,7 +67,7 @@ public class OrderInfo extends BaseEntity
|
|||
private String customerEmail;
|
||||
|
||||
/** 合同类型:1-直签合同,2-代理商合同 */
|
||||
@Excel(name = "合同类型:1-直签合同,2-代理商合同")
|
||||
@Excel(name = "合同类型",dictType="order_type")
|
||||
private String orderType;
|
||||
|
||||
/** 代表处编码 */
|
||||
|
@ -83,7 +84,7 @@ public class OrderInfo extends BaseEntity
|
|||
private Date orderDate;
|
||||
|
||||
/** 合同状态:0-有效,1-无效 */
|
||||
@Excel(name = "合同状态:0-有效,1-无效")
|
||||
@Excel(name = "合同状态",readConverterExp="0=有效,1=无效")
|
||||
private Long status;
|
||||
|
||||
/** 创建时间 */
|
||||
|
|
|
@ -132,8 +132,13 @@ public class DeliveryListServiceImpl implements IDeliveryListService {
|
|||
list.setCreateBy(ShiroUtils.getUserId().toString());
|
||||
}
|
||||
List<DeliveryList> deliveryLists = deliveryListMapper.listBySerialNumberList(deliveryList,deliveryId);
|
||||
if (!deliveryLists.isEmpty()){
|
||||
return AjaxResult.error("产品序列号为[" + deliveryLists.stream().map(DeliveryList::getSerialNumber).collect(Collectors.joining(",")) + "]的产品已存在,请确认后重试;");
|
||||
if (CollUtil.isNotEmpty(deliveryLists)) {
|
||||
StringBuilder errMsg = new StringBuilder();
|
||||
for (DeliveryList list : deliveryLists) {
|
||||
errMsg.append(StringUtils.format("产品序列号为[{}]的产品在发货单号为[{}]发货记录已存在,请确认后重试;\n", list.getSerialNumber(), list.getDeliveryCode()));
|
||||
}
|
||||
|
||||
return AjaxResult.error(errMsg.toString());
|
||||
}
|
||||
deliveryListMapper.insertBatch(deliveryList);
|
||||
return AjaxResult.success("导入成功");
|
||||
|
|
|
@ -44,14 +44,17 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
where id = #{id}
|
||||
</select>
|
||||
<select id="listBySerialNumberList" resultType="com.ruoyi.sip.domain.DeliveryList">
|
||||
<include refid="selectDeliveryListVo"/>
|
||||
where serial_number in
|
||||
select t1.id, t1.delivery_id, t1.product_code, t1.serial_number, t1.remark, t1.created_at, t1.updated_at, t1.deleted_at
|
||||
,t2.delivery_code
|
||||
from delivery_list t1
|
||||
left join order_delivery t2 on t1.delivery_id=t2.id
|
||||
where t1.serial_number in
|
||||
<foreach item="item" index="index" collection="list"
|
||||
open="(" separator="," close=")">
|
||||
#{item.serialNumber}
|
||||
</foreach>
|
||||
<if test="deliveryId!=null">
|
||||
and delivery_id !=#{deliveryId}
|
||||
and t1.delivery_id !=#{deliveryId}
|
||||
</if>
|
||||
</select>
|
||||
<select id="listNumberInfo" resultType="com.ruoyi.sip.vo.DeliveryInfoVo">
|
||||
|
|
|
@ -93,10 +93,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
#{item.quantity}, #{item.cataloguePrice}, #{item.catalogueAllPrice}, #{item.price}, #{item.allPrice},
|
||||
#{item.guidanceDiscount}, #{item.discount}, #{item.remark})
|
||||
</foreach>
|
||||
ON DUPLICATE KEY UPDATE product_bom_code = #{productBomCode}, model = #{model},
|
||||
product_code = #{productCode}, product_desc = #{productDesc}, quantity = #{quantity}, catalogue_price = #{cataloguePrice},
|
||||
catalogue_all_price = #{catalogueAllPrice}, price = #{price}, all_price = #{allPrice}, guidance_discount = #{guidanceDiscount},
|
||||
discount = #{discount}, remark = #{remark}
|
||||
ON DUPLICATE KEY UPDATE product_bom_code = values(product_bom_code), model = values(model),
|
||||
product_code = values(product_code), product_desc = values(product_desc), quantity = values(quantity), catalogue_price = values(catalogue_price),
|
||||
catalogue_all_price = values(catalogue_all_price), price = values(price), all_price = values(all_price), guidance_discount = values(guidance_discount),
|
||||
discount = values(discount), remark = values(remark)
|
||||
</insert>
|
||||
|
||||
<update id="updateProjectProductInfo" parameterType="ProjectProductInfo">
|
||||
|
|
Loading…
Reference in New Issue