修改交班落地数据逻辑

This commit is contained in:
19991905653 2024-04-03 11:36:00 +08:00
parent 2c46de7e9d
commit a2bd783a21
3 changed files with 20 additions and 15 deletions

View File

@ -19,6 +19,7 @@ public class TbOrderDetail implements Serializable {
private Integer productSkuId; private Integer productSkuId;
private Integer num; private Integer num;
private Integer returnNum;
private String productName; private String productName;
private String status; private String status;

View File

@ -70,11 +70,11 @@ public class DutyService {
ShopUserDuty shopUserDuty = shopUserDutyMapper.selectByShopIdAndTrade(shopId,day); ShopUserDuty shopUserDuty = shopUserDutyMapper.selectByShopIdAndTrade(shopId,day);
// ShopUserDuty shopUserDuty = shopUserDutyMapper.selectByTokenIdAndTradeDay(tokenId, day, orderInfo.getShopId()); // ShopUserDuty shopUserDuty = shopUserDutyMapper.selectByTokenIdAndTradeDay(tokenId, day, orderInfo.getShopId());
BigDecimal cashAmount = BigDecimal.ZERO; BigDecimal cashAmount = BigDecimal.ZERO;
if (orderInfo.getPayType().equals("cash")) {
cashAmount = orderInfo.getPayAmount();
}
if (type.equals("create")) { if (type.equals("create")) {
if (orderInfo.getPayType().equals("cash")) {
cashAmount = orderInfo.getPayAmount();
}
if (Objects.isNull(shopUserDuty)) { if (Objects.isNull(shopUserDuty)) {
shopUserDuty = new ShopUserDuty(userId, tbToken.getCreateTime(), 1, orderInfo.getOrderAmount(), loginName, "0", shopUserDuty = new ShopUserDuty(userId, tbToken.getCreateTime(), 1, orderInfo.getOrderAmount(), loginName, "0",
orderInfo.getOrderAmount(), shopId, BigDecimal.ZERO, cashAmount, BigDecimal.ZERO, ""); orderInfo.getOrderAmount(), shopId, BigDecimal.ZERO, cashAmount, BigDecimal.ZERO, "");

View File

@ -8,6 +8,7 @@
<result column="product_id" jdbcType="INTEGER" property="productId"/> <result column="product_id" jdbcType="INTEGER" property="productId"/>
<result column="product_sku_id" jdbcType="INTEGER" property="productSkuId"/> <result column="product_sku_id" jdbcType="INTEGER" property="productSkuId"/>
<result column="num" jdbcType="INTEGER" property="num"/> <result column="num" jdbcType="INTEGER" property="num"/>
<result column="return_num" jdbcType="INTEGER" property="returnNum"/>
<result column="product_name" jdbcType="VARCHAR" property="productName"/> <result column="product_name" jdbcType="VARCHAR" property="productName"/>
<result column="product_sku_name" jdbcType="VARCHAR" property="productSkuName"/> <result column="product_sku_name" jdbcType="VARCHAR" property="productSkuName"/>
<result column="product_img" jdbcType="VARCHAR" property="productImg"/> <result column="product_img" jdbcType="VARCHAR" property="productImg"/>
@ -20,7 +21,7 @@
</resultMap> </resultMap>
<sql id="Base_Column_List"> <sql id="Base_Column_List">
id, order_id, shop_id, product_id, product_sku_id, num, product_name, product_sku_name, id, order_id, shop_id, product_id, product_sku_id, num, product_name, product_sku_name,
product_img, create_time, update_time, price, price_amount,status,pack_amount product_img, create_time, update_time, price, price_amount,status,pack_amount,return_num
</sql> </sql>
<select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap"> <select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
select select
@ -154,6 +155,9 @@
<if test="num != null"> <if test="num != null">
num = #{num,jdbcType=INTEGER}, num = #{num,jdbcType=INTEGER},
</if> </if>
<if test="returnNum != null">
return_num = #{returnNum,jdbcType=INTEGER},
</if>
<if test="productName != null"> <if test="productName != null">
product_name = #{productName,jdbcType=VARCHAR}, product_name = #{productName,jdbcType=VARCHAR},
</if> </if>
@ -205,13 +209,13 @@
</update> </update>
<update id="updateBatchOrderDetail" parameterType="com.chaozhanggui.system.cashierservice.entity.po.OrderDetailPo"> <update id="updateBatchOrderDetail" parameterType="com.chaozhanggui.system.cashierservice.entity.po.OrderDetailPo">
<foreach collection="list" item="item" index="index" open="" close="" separator=";"> <foreach collection="list" item="item" index="index" open="" close="" separator=";">
update tb_order_detail update tb_order_detail
set status= #{item.status} set status= #{item.status}
where id = #{item.id} where id = #{item.id}
</foreach> </foreach>
</update> </update>
<select id="selectAllByOrderIdAndStatus" resultMap="BaseResultMap"> <select id="selectAllByOrderIdAndStatus" resultMap="BaseResultMap">
select * from tb_order_detail where status='closed' and order_id=#{orderId} and id in select * from tb_order_detail where status='closed' and order_id=#{orderId} and id in
@ -230,10 +234,10 @@
<insert id="batchInsert"> <insert id="batchInsert">
insert into tb_order_detail (order_id, shop_id, insert into tb_order_detail (order_id, shop_id,
product_id, product_sku_id, num, product_id, product_sku_id, num,
product_name, product_sku_name, product_img, product_name, product_sku_name, product_img,
create_time, update_time, price, create_time, update_time, price,
price_amount,pack_amount,status) values price_amount,pack_amount,status) values
<foreach collection="list" separator="," item="item"> <foreach collection="list" separator="," item="item">
(#{orderId},#{item.shopId},#{item.productId},#{item.productSkuId},#{item.num},#{item.productName},#{item.productSkuName},#{item.productImg},#{item.createTime},#{item.updateTime},#{item.price},#{item.priceAmount},#{item.packAmount},#{item.status}) (#{orderId},#{item.shopId},#{item.productId},#{item.productSkuId},#{item.num},#{item.productName},#{item.productSkuName},#{item.productImg},#{item.createTime},#{item.updateTime},#{item.price},#{item.priceAmount},#{item.packAmount},#{item.status})
</foreach> </foreach>