修改 出库失败报错

master
wanghao 4 months ago
parent a7d899583f
commit 6703d73c7c

@ -89,11 +89,23 @@ public class ApiController {
public AjaxResult outStoreSubmit(@RequestBody OutStoreDto outStoreDto) {
try {
List<String> epcList = outStoreDto.getEpcList();
int size = epcList.size();
//int i=0;
for (String epc:epcList ) {
String tag = apiService.selectLedgerbyEpcForOutStore(epc);
if (tag!=null){
apiService.submitInsertRecordOut(outStoreDto,epc);
apiService.updataLedgerFoyOut(outStoreDto,epc);
//i++;
}
}
/* int size = epcList.size();
Iterator<String> iterator = epcList.iterator();
while (iterator.hasNext()) {
String epc = iterator.next();
String tag = apiService.selectLedgerbyEpcForOutStore(epc);
if (tag != null) {
iterator.remove();
}
@ -103,9 +115,9 @@ public class ApiController {
if (i>0){
apiService.submitInsertRecordOut(outStoreDto);
apiService.updataLedger(outStoreDto);
}
}*/
return success("本次入库成功:" + size1 +"条,屏蔽重复入库:"+ i +"条");
return success();
}catch (Exception e){
return error();
}

@ -19,7 +19,7 @@ public interface ApiMapper {
int submintInsertLedger(@Param("inStore") InStoreDto inStore);
int submitInsertRecordOut(@Param("outStoreDto") OutStoreDto outStoreDto);
int submitInsertRecordOut(@Param("outStoreDto") OutStoreDto outStoreDto,@Param("epc") String epc);
int updataLedger(@Param("outStoreDto") OutStoreDto outStoreDto);
@ -51,4 +51,6 @@ public interface ApiMapper {
String selectLedgerbyEpcForInStore(String epc);
String selectLedgerbyEpcForOutStore(String epc);
int updataLedgerFoyOut(@Param("outStoreDto") OutStoreDto outStoreDto, @Param("epc") String epc);
}

@ -28,8 +28,8 @@ public class ApiService {
return mapper.submintInsertLedger(inStore);
}
public int submitInsertRecordOut(OutStoreDto outStoreDto) {
return mapper.submitInsertRecordOut(outStoreDto);
public int submitInsertRecordOut(OutStoreDto outStoreDto,String epc) {
return mapper.submitInsertRecordOut(outStoreDto,epc);
}
public int updataLedger(OutStoreDto outStoreDto) {
@ -91,4 +91,8 @@ public class ApiService {
public String selectLedgerbyEpcForOutStore(String epc) {
return mapper.selectLedgerbyEpcForOutStore(epc);
}
public int updataLedgerFoyOut(OutStoreDto outStoreDto,String epc) {
return mapper.updataLedgerFoyOut(outStoreDto,epc);
}
}

@ -14,7 +14,7 @@
select rifd_code from ledger_rfid where rifd_code = #{epc} limit 1
</select>
<insert id="submintInsertRecordIn">
INSERT ignore into bg_wheel_chocks.record_in (epc_code, batch_code, location_code,manufacturer_id,
INSERT ignore into record_in (epc_code, batch_code, location_code,manufacturer_id,
manufacturer_Name,
create_by,create_time)
VALUES
@ -26,7 +26,7 @@
<insert id="submintInsertLedger">
INSERT ignore into bg_wheel_chocks.ledger_rfid (manufacturer_id, rifd_code, batch_code, location_code)
INSERT ignore into ledger_rfid (manufacturer_id, rifd_code, batch_code, location_code)
VALUES
<foreach collection="inStore.epclist" item="item" separator=",">
(#{inStore.manufacturerId},#{item},#{inStore.binchCode},#{inStore.selectLocationText})
@ -36,14 +36,17 @@
<!-- -->
<insert id="submitInsertRecordOut">
INSERT INTO bg_wheel_chocks.record_out (epc_code, location_code, use_user, create_by) VALUES
INSERT INTO record_out (epc_code, location_code, use_user, create_by)
VALUES
<foreach collection="outStoreDto.epcList" item="epc" separator=",">
(#{epc}, #{outStoreDto.areaCode}, #{outStoreDto.useUser}, #{outStoreDto.submitUser})
(
#{epc}, #{outStoreDto.areaCode}, #{outStoreDto.useUser}, #{outStoreDto.submitUser}
)
</foreach>
</insert>
<update id="updataLedger">
UPDATE bg_wheel_chocks.ledger_rfid
UPDATE ledger_rfid
SET
location_type = '2',
location_code = #{outStoreDto.areaCode},
@ -53,6 +56,14 @@
#{epc}
</foreach>
</update>
<update id="updataLedgerFoyOut">
UPDATE ledger_rfid
SET
location_type = '2',
location_code = #{outStoreDto.areaCode},
update_time = now()
WHERE rifd_code =#{epc}
</update>
<select id="storeCheckSelect" resultType="com.ruoyi.api.domain.StockDto">
select row_number() over (order by location_code) as 'index',
@ -65,7 +76,7 @@
</select>
<insert id="insertCheckInfo">
INSERT INTO bg_wheel_chocks.record_store_check_info (check_id, epc_code, location_code, check_state)
INSERT INTO record_store_check_info (check_id, epc_code, location_code, check_state)
VALUES
<foreach collection="list" item="item" separator=",">
(#{id}, #{item.epcCode},#{item.locationCode},#{item.state})
@ -98,7 +109,7 @@
where rifd_code = #{epc}
</select>
<update id="updataLedgerForBf">
UPDATE bg_wheel_chocks.ledger_rfid
UPDATE ledger_rfid
SET is_scrap = #{state},
update_time=now()
WHERE rifd_code = #{epc}
@ -114,7 +125,7 @@
from ledger_rfid lf
left join sys_dict_data sdd on sdd.dict_value = is_scrap and sdd.dict_type = 'bf_y_n'
left join sys_dict_data sdd1 on sdd1.dict_value = location_type and sdd1.dict_type = 'store_tag'
left join bg_wheel_chocks.record_invalidated ri on lf.rifd_code = ri.epc
left join record_invalidated ri on lf.rifd_code = ri.epc
where rifd_code = #{epc}
limit 1
</select>
@ -153,14 +164,14 @@
</select>
<insert id="insertWasreOutRecord">
INSERT INTO bg_wheel_chocks.record_waste_out (epc_code, location_code, create_by) VALUES
INSERT INTO record_waste_out (epc_code, location_code, create_by) VALUES
<foreach collection="list" item="item" separator=",">
( #{item.epcCode},#{item.locationCode},#{user})
</foreach>
</insert>
<update id="updataLedgerForWasreOut" >
UPDATE bg_wheel_chocks.ledger_rfid
UPDATE ledger_rfid
SET location_type = null,
location_code = null,
is_scrap = '3',

Loading…
Cancel
Save