opt:报工bom批量插入
This commit is contained in:
@@ -9,4 +9,6 @@ import java.util.List;
|
|||||||
public interface ReceiveOutReturnDetailMapper extends BaseMapper<ReceiveOutReturnDetail> {
|
public interface ReceiveOutReturnDetailMapper extends BaseMapper<ReceiveOutReturnDetail> {
|
||||||
|
|
||||||
List<ReceiveOutReturnDetail> getDetailById(Long id);
|
List<ReceiveOutReturnDetail> getDetailById(Long id);
|
||||||
|
|
||||||
|
void saveBatch(List<ReceiveOutReturnDetail> list);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,56 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||||
<mapper namespace="org.nl.wms.warehouse_manage.stockReturn.receiveOutRetur.mapper.ReceiveOutReturnDetailMapper">
|
<mapper namespace="org.nl.wms.warehouse_manage.stockReturn.receiveOutRetur.mapper.ReceiveOutReturnDetailMapper">
|
||||||
|
<insert id="saveBatch">
|
||||||
|
INSERT INTO receive_out_return_detail (
|
||||||
|
return_id,
|
||||||
|
seq,
|
||||||
|
materialno,
|
||||||
|
unitno,
|
||||||
|
qty,
|
||||||
|
baseqty,
|
||||||
|
warehouseno,
|
||||||
|
srcbillno,
|
||||||
|
srcbillid,
|
||||||
|
srcbillentryid,
|
||||||
|
entrycomment,
|
||||||
|
auxptyno,
|
||||||
|
tracknumber,
|
||||||
|
lotnumber,
|
||||||
|
stockerno,
|
||||||
|
stockername,
|
||||||
|
iobillcode,
|
||||||
|
update_time,
|
||||||
|
status,
|
||||||
|
remark,
|
||||||
|
last_status
|
||||||
|
) VALUES
|
||||||
|
<foreach collection="list" item="item" separator=",">
|
||||||
|
(
|
||||||
|
#{item.returnId},
|
||||||
|
#{item.seq},
|
||||||
|
#{item.materialno},
|
||||||
|
#{item.unitno},
|
||||||
|
#{item.qty},
|
||||||
|
#{item.baseqty},
|
||||||
|
#{item.warehouseno},
|
||||||
|
#{item.srcbillno},
|
||||||
|
#{item.srcbillid},
|
||||||
|
#{item.srcbillentryid},
|
||||||
|
#{item.entrycomment},
|
||||||
|
#{item.auxptyno},
|
||||||
|
#{item.tracknumber},
|
||||||
|
#{item.lotnumber},
|
||||||
|
#{item.stockerno},
|
||||||
|
#{item.stockername},
|
||||||
|
#{item.iobillcode},
|
||||||
|
#{item.updateTime},
|
||||||
|
#{item.status},
|
||||||
|
#{item.remark},
|
||||||
|
#{item.last_status}
|
||||||
|
)
|
||||||
|
</foreach>
|
||||||
|
</insert>
|
||||||
|
|
||||||
<select id="getDetailById"
|
<select id="getDetailById"
|
||||||
resultType="org.nl.wms.warehouse_manage.stockReturn.receiveOutRetur.dao.ReceiveOutReturnDetail">
|
resultType="org.nl.wms.warehouse_manage.stockReturn.receiveOutRetur.dao.ReceiveOutReturnDetail">
|
||||||
|
|||||||
@@ -217,6 +217,7 @@ public class ReceiveOutReturnServiceImpl extends ServiceImpl<ReceiveOutReturnMap
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
String now = DateUtil.now();
|
String now = DateUtil.now();
|
||||||
|
List<ReceiveOutReturnDetail> list = new ArrayList<>();
|
||||||
for (ReceiveOutRequest.Entrys entry : entrys) {
|
for (ReceiveOutRequest.Entrys entry : entrys) {
|
||||||
ReceiveOutReturnDetail detail = new ReceiveOutReturnDetail();
|
ReceiveOutReturnDetail detail = new ReceiveOutReturnDetail();
|
||||||
detail.setReturnId(returnId);
|
detail.setReturnId(returnId);
|
||||||
@@ -239,8 +240,9 @@ public class ReceiveOutReturnServiceImpl extends ServiceImpl<ReceiveOutReturnMap
|
|||||||
detail.setStatus(entry.getStatus());
|
detail.setStatus(entry.getStatus());
|
||||||
detail.setUpdateTime(now);
|
detail.setUpdateTime(now);
|
||||||
detail.setIobillcode(ioBillCode);
|
detail.setIobillcode(ioBillCode);
|
||||||
receiveOutReturnDetailMapper.insert(detail);
|
list.add(detail);
|
||||||
}
|
}
|
||||||
|
receiveOutReturnDetailMapper.saveBatch(list);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void saveDetails(Long returnId, List<ReceiveOutReturnDetail> details) {
|
private void saveDetails(Long returnId, List<ReceiveOutReturnDetail> details) {
|
||||||
|
|||||||
Reference in New Issue
Block a user