机具领用导入模板优化

This commit is contained in:
hayu 2026-01-06 15:28:29 +08:00
parent 38a49ad0a8
commit 075a7f53f6
2 changed files with 30 additions and 33 deletions

View File

@ -312,13 +312,10 @@
mt2.`NAME` mt2.`NAME`
FROM mm_type mt FROM mm_type mt
LEFT JOIN mm_type mt2 on mt2.ID = mt.PARENT_ID LEFT JOIN mm_type mt2 on mt2.ID = mt.PARENT_ID
LEFT JOIN mm_type mt3 on mt3.ID = mt2.PARENT_ID
LEFT JOIN mm_type mt4 on mt4.ID = mt3.PARENT_ID
WHERE mt.`name` = #{maModel} WHERE mt.`name` = #{maModel}
and mt.`level` = '4' and mt.`level` = '4'
and mt2.`NAME` = #{maType} and mt2.`NAME` = #{maType}
and mt3.`NAME` = #{secondName} limit 1
and mt4.`NAME` = #{firstName}
</select> </select>
<select id="getUserByUserName" resultType="com.bonus.lease.beans.ReceiveDetailsBean"> <select id="getUserByUserName" resultType="com.bonus.lease.beans.ReceiveDetailsBean">
SELECT id as customerSrepId, SELECT id as customerSrepId,

View File

@ -412,16 +412,16 @@ public class ReceiveDetailsController extends BaseController<ReceiveDetailsBean>
private Map<String, Object> outMachineTypeBeanToMap(int i, MachineTypeBean bean) { private Map<String, Object> outMachineTypeBeanToMap(int i, MachineTypeBean bean) {
Map<String, Object> maps = new LinkedHashMap<String, Object>(); Map<String, Object> maps = new LinkedHashMap<String, Object>();
maps.put("id", i + 1); maps.put("id", i + 1);
maps.put("firstName", bean.getFirstName()); // maps.put("firstName", bean.getFirstName());
maps.put("secondName", bean.getSecondName()); // maps.put("secondName", bean.getSecondName());
maps.put("parentName", bean.getParentName()); maps.put("parentName", bean.getParentName());
maps.put("name", bean.getName()); maps.put("name", bean.getName());
maps.put("unit", bean.getUnit()); // maps.put("unit", bean.getUnit());
maps.put("nums", bean.getNums()); // maps.put("nums", bean.getNums());
maps.put("buyPrice", bean.getBuyPrice()); // maps.put("buyPrice", bean.getBuyPrice());
maps.put("leasePrice", bean.getLeasePrice()); // maps.put("leasePrice", bean.getLeasePrice());
maps.put("payPrice", bean.getPayPrice()); // maps.put("payPrice", bean.getPayPrice());
maps.put("isTest", bean.getIsTest()); // maps.put("isTest", bean.getIsTest());
maps.put("customerSrep", ""); maps.put("customerSrep", "");
maps.put("machinesNum", ""); maps.put("machinesNum", "");
return maps; return maps;
@ -430,16 +430,16 @@ public class ReceiveDetailsController extends BaseController<ReceiveDetailsBean>
private List<String> machineTypeHeader() { private List<String> machineTypeHeader() {
ArrayList<String> list = new ArrayList<String>(); ArrayList<String> list = new ArrayList<String>();
list.add("序号"); list.add("序号");
list.add("施工机具类型"); // list.add("施工机具类型");
list.add("设备分类"); // list.add("设备分类");
list.add("机具类型"); list.add("机具类型");
list.add("规格型号"); list.add("规格型号");
list.add("计量单位"); // list.add("计量单位");
list.add("库存量"); // list.add("库存量");
list.add("原值(元)"); // list.add("原值(元)");
list.add("租赁价格(元)"); // list.add("租赁价格(元)");
list.add("丢失赔偿价格(元)"); // list.add("丢失赔偿价格(元)");
list.add("是否只计数"); // list.add("是否只计数");
list.add("客服代表"); list.add("客服代表");
list.add("领料数量"); list.add("领料数量");
return list; return list;
@ -522,32 +522,32 @@ public class ReceiveDetailsController extends BaseController<ReceiveDetailsBean>
StringBuilder rowErrorMsg = new StringBuilder(); StringBuilder rowErrorMsg = new StringBuilder();
// 低版本POI兼容手动判断单元格是否为null无MissingCellPolicy // 低版本POI兼容手动判断单元格是否为null无MissingCellPolicy
Cell firstNameCell = row.getCell(1); // Cell firstNameCell = row.getCell(1);
String firstName = getCellStringValue(firstNameCell); // String firstName = getCellStringValue(firstNameCell);
bean.setFirstName(firstName); // bean.setFirstName(firstName);
//
// Cell secondNameCell = row.getCell(2);
// String secondName = getCellStringValue(secondNameCell);
// bean.setSecondName(secondName);
Cell secondNameCell = row.getCell(2); Cell maTypeCell = row.getCell(1);
String secondName = getCellStringValue(secondNameCell);
bean.setSecondName(secondName);
Cell maTypeCell = row.getCell(3);
String maType = getCellStringValue(maTypeCell); String maType = getCellStringValue(maTypeCell);
bean.setMaType(maType); bean.setMaType(maType);
Cell maModelCell = row.getCell(4); Cell maModelCell = row.getCell(2);
String maModel = getCellStringValue(maModelCell); String maModel = getCellStringValue(maModelCell);
bean.setMaModel(maModel); bean.setMaModel(maModel);
Cell customerSrepCell = row.getCell(11); Cell customerSrepCell = row.getCell(3);
String customerSrep = getCellStringValue(customerSrepCell); String customerSrep = getCellStringValue(customerSrepCell);
bean.setCustomerSrep(customerSrep); bean.setCustomerSrep(customerSrep);
Cell machinesNumCell = row.getCell(12); Cell machinesNumCell = row.getCell(4);
String machinesNum = getCellStringValue(machinesNumCell); String machinesNum = getCellStringValue(machinesNumCell);
bean.setMachinesNum(machinesNum); bean.setMachinesNum(machinesNum);
//如果施工机具类型设备分类物资名称规格型号客户代表领料数量中有一个为空则跳过该行数据 //如果施工机具类型设备分类物资名称规格型号客户代表领料数量中有一个为空则跳过该行数据
if (StringHelper.isEmpty(firstName) || StringHelper.isEmpty(secondName) || StringHelper.isEmpty(maType) || StringHelper.isEmpty(maModel) || StringHelper.isEmpty(customerSrep) || StringHelper.isEmpty(machinesNum)) { if (StringHelper.isEmpty(maType) || StringHelper.isEmpty(maModel) || StringHelper.isEmpty(customerSrep) || StringHelper.isEmpty(machinesNum)) {
continue; continue;
} }
@ -574,7 +574,7 @@ public class ReceiveDetailsController extends BaseController<ReceiveDetailsBean>
} }
} }
// 8. 施工机具类型+设备分类+物资名称+规格型号存在性校验 // 8. 物资名称+规格型号存在性校验
if (rowErrorMsg.length() == 0) { if (rowErrorMsg.length() == 0) {
ReceiveDetailsBean receiveDetailsBean = service.getMaTypeByNameAndModel(bean); ReceiveDetailsBean receiveDetailsBean = service.getMaTypeByNameAndModel(bean);
if (receiveDetailsBean == null) { if (receiveDetailsBean == null) {