diff --git a/ruoyi-admin/src/main/java/com/ruoyi/check/difference/controller/CheckDifferenceRecordController.java b/ruoyi-admin/src/main/java/com/ruoyi/check/difference/controller/CheckDifferenceRecordController.java index a6989b0..3665d28 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/check/difference/controller/CheckDifferenceRecordController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/check/difference/controller/CheckDifferenceRecordController.java @@ -26,6 +26,7 @@ import lombok.extern.slf4j.Slf4j; import org.springframework.beans.BeanUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.security.access.prepost.PreAuthorize; +import org.springframework.transaction.annotation.Transactional; import org.springframework.web.bind.annotation.*; import java.util.ArrayList; @@ -127,6 +128,7 @@ public class CheckDifferenceRecordController extends BaseController { @PreAuthorize("@ss.hasPermi('check:difference:audit')") @Log(title = "盘点差异", businessType = BusinessType.UPDATE) @PutMapping("/audit") + @Transactional(rollbackFor = Exception.class) public AjaxResult audit(@RequestBody String[] checkGuids) { List records = new ArrayList<>(); for (String checkGuid : checkGuids) { @@ -214,6 +216,8 @@ public class CheckDifferenceRecordController extends BaseController { newStock.setSpare8(checkDifferenceRecordAddInfo.getSpare14()); // 最后设置库存ID newStock.setStockId(basJobIdService.getJobId("KC")); + newStock.setSpare7("1"); + newStock.setStackingId(DateUtil.formatDateTime(DateUtil.date())); basStockService.insertBasStock(newStock); diff --git a/ruoyi-admin/src/main/resources/mapper/stock/BasStockMapper.xml b/ruoyi-admin/src/main/resources/mapper/stock/BasStockMapper.xml index 9c5acd9..d68f86c 100644 --- a/ruoyi-admin/src/main/resources/mapper/stock/BasStockMapper.xml +++ b/ruoyi-admin/src/main/resources/mapper/stock/BasStockMapper.xml @@ -166,7 +166,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" insert into bas_stock - stock_id, + stock_id, cargo_space_id, stock_status, product_status, @@ -191,9 +191,20 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" spare5, spare6, product_id, - + product_name, + voltage, + power, + phase, + net_weight, + gross_weight, + distribution, + model, + order_id, + spare7, + spare8, + - #{stockId}, + #{stockId}, #{cargoSpaceId}, #{stockStatus}, #{productStatus}, @@ -218,16 +229,18 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" #{spare5}, #{spare6}, #{productId}, - - - - INSERT INTO bas_stock - (stock_id,cargo_space_id,stock_status,product_status,lot_no,in_date,back_date,product_guid,quantity,job_id,tray_code,out_quantity,stockin_detail_id,stockin_id,in_type,in_class_id,warehouse_id,stacking_id,spare1,spare2,spare3,spare4,spare5,spare6,product_id,product_name,voltage,power,phase,net_weight,gross_weight,distribution,model,order_id,spare7,spare8) - VALUES - - (#{item.stockId},#{item.cargoSpaceId},#{item.stockStatus},#{item.productStatus},#{item.lotNo},#{item.inDate},#{item.backDate},#{item.productGuid},#{item.quantity},#{item.jobId},#{item.trayCode},#{item.outQuantity},#{item.stockinDetailId},#{item.stockinId},#{item.inType},#{item.inClassId},#{item.warehouseId},#{item.stackingId},#{item.spare1},#{item.spare2},#{item.spare3},#{item.spare4},#{item.spare5},#{item.spare6},#{item.productId} - ,#{item.productName},#{item.voltage},#{item.power},#{item.phase},#{item.netWeight},#{item.grossWeight},#{item.distribution},#{item.model},#{item.orderId},#{item.spare7},#{item.spare8}) - + #{productName}, + #{voltage}, + #{power}, + #{phase}, + #{netWeight}, + #{grossWeight}, + #{distribution}, + #{model}, + #{orderId}, + #{spare7}, + #{spare8}, + @@ -257,9 +270,30 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" spare5 = #{spare5}, spare6 = #{spare6}, product_id = #{productId}, + product_name = #{productName}, + voltage = #{voltage}, + power = #{power}, + phase = #{phase}, + net_weight = #{netWeight}, + gross_weight = #{grossWeight}, + distribution = #{distribution}, + model = #{model}, + order_id = #{orderId}, + spare7 = #{spare7}, + spare8 = #{spare8}, where stock_id = #{stockId} + + INSERT INTO bas_stock + (stock_id,cargo_space_id,stock_status,product_status,lot_no,in_date,back_date,product_guid,quantity,job_id,tray_code,out_quantity,stockin_detail_id,stockin_id,in_type,in_class_id,warehouse_id,stacking_id,spare1,spare2,spare3,spare4,spare5,spare6,product_id,product_name,voltage,power,phase,net_weight,gross_weight,distribution,model,order_id,spare7,spare8) + VALUES + + (#{item.stockId},#{item.cargoSpaceId},#{item.stockStatus},#{item.productStatus},#{item.lotNo},#{item.inDate},#{item.backDate},#{item.productGuid},#{item.quantity},#{item.jobId},#{item.trayCode},#{item.outQuantity},#{item.stockinDetailId},#{item.stockinId},#{item.inType},#{item.inClassId},#{item.warehouseId},#{item.stackingId},#{item.spare1},#{item.spare2},#{item.spare3},#{item.spare4},#{item.spare5},#{item.spare6},#{item.productId} + ,#{item.productName},#{item.voltage},#{item.power},#{item.phase},#{item.netWeight},#{item.grossWeight},#{item.distribution},#{item.model},#{item.orderId},#{item.spare7},#{item.spare8}) + + + update bas_stock set stock_status = #{stockStatus} where tray_code = #{trayCode}