修改盘点审核
This commit is contained in:
@@ -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<CheckDifferenceRecord> 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);
|
||||
|
||||
|
||||
|
||||
@@ -166,7 +166,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<insert id="insertBasStock" parameterType="BasStock">
|
||||
insert into bas_stock
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="stockId != null and stockId != ''">stock_id,</if>
|
||||
<if test="stockId != null">stock_id,</if>
|
||||
<if test="cargoSpaceId != null">cargo_space_id,</if>
|
||||
<if test="stockStatus != null">stock_status,</if>
|
||||
<if test="productStatus != null">product_status,</if>
|
||||
@@ -191,9 +191,20 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<if test="spare5 != null">spare5,</if>
|
||||
<if test="spare6 != null">spare6,</if>
|
||||
<if test="productId != null">product_id,</if>
|
||||
</trim>
|
||||
<if test="productName != null">product_name,</if>
|
||||
<if test="voltage != null">voltage,</if>
|
||||
<if test="power != null">power,</if>
|
||||
<if test="phase != null">phase,</if>
|
||||
<if test="netWeight != null">net_weight,</if>
|
||||
<if test="grossWeight != null">gross_weight,</if>
|
||||
<if test="distribution != null">distribution,</if>
|
||||
<if test="model != null">model,</if>
|
||||
<if test="orderId != null">order_id,</if>
|
||||
<if test="spare7 != null">spare7,</if>
|
||||
<if test="spare8 != null">spare8,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="stockId != null and stockId != ''">#{stockId},</if>
|
||||
<if test="stockId != null">#{stockId},</if>
|
||||
<if test="cargoSpaceId != null">#{cargoSpaceId},</if>
|
||||
<if test="stockStatus != null">#{stockStatus},</if>
|
||||
<if test="productStatus != null">#{productStatus},</if>
|
||||
@@ -218,16 +229,18 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<if test="spare5 != null">#{spare5},</if>
|
||||
<if test="spare6 != null">#{spare6},</if>
|
||||
<if test="productId != null">#{productId},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
<insert id="insertBasStockList">
|
||||
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
|
||||
<foreach collection="list" item="item" separator=",">
|
||||
(#{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})
|
||||
</foreach>
|
||||
<if test="productName != null">#{productName},</if>
|
||||
<if test="voltage != null">#{voltage},</if>
|
||||
<if test="power != null">#{power},</if>
|
||||
<if test="phase != null">#{phase},</if>
|
||||
<if test="netWeight != null">#{netWeight},</if>
|
||||
<if test="grossWeight != null">#{grossWeight},</if>
|
||||
<if test="distribution != null">#{distribution},</if>
|
||||
<if test="model != null">#{model},</if>
|
||||
<if test="orderId != null">#{orderId},</if>
|
||||
<if test="spare7 != null">#{spare7},</if>
|
||||
<if test="spare8 != null">#{spare8},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateBasStock" parameterType="BasStock">
|
||||
@@ -257,9 +270,30 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<if test="spare5 != null">spare5 = #{spare5},</if>
|
||||
<if test="spare6 != null">spare6 = #{spare6},</if>
|
||||
<if test="productId != null">product_id = #{productId},</if>
|
||||
<if test="productName != null">product_name = #{productName},</if>
|
||||
<if test="voltage != null">voltage = #{voltage},</if>
|
||||
<if test="power != null">power = #{power},</if>
|
||||
<if test="phase != null">phase = #{phase},</if>
|
||||
<if test="netWeight != null">net_weight = #{netWeight},</if>
|
||||
<if test="grossWeight != null">gross_weight = #{grossWeight},</if>
|
||||
<if test="distribution != null">distribution = #{distribution},</if>
|
||||
<if test="model != null">model = #{model},</if>
|
||||
<if test="orderId != null">order_id = #{orderId},</if>
|
||||
<if test="spare7 != null">spare7 = #{spare7},</if>
|
||||
<if test="spare8 != null">spare8 = #{spare8},</if>
|
||||
</trim>
|
||||
where stock_id = #{stockId}
|
||||
</update>
|
||||
<insert id="insertBasStockList">
|
||||
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
|
||||
<foreach collection="list" item="item" separator=",">
|
||||
(#{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})
|
||||
</foreach>
|
||||
</insert>
|
||||
|
||||
<update id="updateStockStatusByTrayCode">
|
||||
update bas_stock set stock_status = #{stockStatus} where tray_code = #{trayCode}
|
||||
</update>
|
||||
|
||||
Reference in New Issue
Block a user