|
|
|
@ -60,7 +60,11 @@ public class DmCzplpNewServiceImpl extends ServiceImpl<DmCzplpNewMapper, DmCzplp
|
|
|
|
|
public Map uploadPl(List<PlExcel> list, String project, String isupload, HttpServletRequest req) {
|
|
|
|
|
Map returnMap = new HashMap();
|
|
|
|
|
List<String> pls = list.stream().filter(f -> StringUtils.isNotBlank(f.getDcPL())).map(PlExcel::getDcPL).collect(Collectors.toList());
|
|
|
|
|
List<DmCzplpNew> fdList = this.list(new QueryWrapper<DmCzplpNew>().in("dc_pl", pls).eq("dc_ch",list.get(0).getDcCh()));
|
|
|
|
|
List<String> collect = pls.stream().map(s -> {
|
|
|
|
|
return String.format("%03d",Integer.parseInt(s));
|
|
|
|
|
}).collect(Collectors.toList());
|
|
|
|
|
|
|
|
|
|
List<DmCzplpNew> fdList = this.list(new QueryWrapper<DmCzplpNew>().in("dc_pl", collect).eq("dc_ch",list.get(0).getDcCh()));
|
|
|
|
|
// if(fdList.size()>0){
|
|
|
|
|
// // 是否覆盖之前导入的数据
|
|
|
|
|
// if(!isupload.equals("01")){
|
|
|
|
@ -76,9 +80,10 @@ public class DmCzplpNewServiceImpl extends ServiceImpl<DmCzplpNewMapper, DmCzplp
|
|
|
|
|
int plCount = (int) map.get("plcount");
|
|
|
|
|
String fds = (String) map.get("fds");
|
|
|
|
|
Map<String, Object> stringObjectMap = BeanUtil.beanToMap(plExcel);
|
|
|
|
|
plExcel.setDcPL(String.format("%03d",Integer.parseInt(plExcel.getDcPL())));
|
|
|
|
|
DmCzplpNew dmCzplpNewOld = fdList.stream().filter(fst -> plExcel.getDcPL().equals(fst.getDcPl())).findFirst().orElse(null);
|
|
|
|
|
// 把批量补0
|
|
|
|
|
plExcel.setDcPL(String.format("%03d",Integer.parseInt(plExcel.getDcPL())));
|
|
|
|
|
|
|
|
|
|
if (null != dmCzplpNewOld) {
|
|
|
|
|
this.remove(new QueryWrapper<DmCzplpNew>().eq("dc_pl", plExcel.getDcPL()).eq("dc_ch",plExcel.getDcCh()));
|
|
|
|
|
for (int i = 1; i <plCount; i++) {
|
|
|
|
|