|
|
@ -1,6 +1,5 @@ |
|
|
|
package org.jeecg.modules.maker.service.impl; |
|
|
|
package org.jeecg.modules.maker.service.impl; |
|
|
|
|
|
|
|
|
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
|
|
|
|
|
|
|
import org.jeecg.modules.maker.entity.ZyMaker; |
|
|
|
import org.jeecg.modules.maker.entity.ZyMaker; |
|
|
|
import org.jeecg.modules.maker.mapper.ZyMakerMapper; |
|
|
|
import org.jeecg.modules.maker.mapper.ZyMakerMapper; |
|
|
|
import org.jeecg.modules.maker.service.IZyMakerService; |
|
|
|
import org.jeecg.modules.maker.service.IZyMakerService; |
|
|
@ -18,8 +17,8 @@ import org.springframework.util.StringUtils; |
|
|
|
import javax.annotation.Resource; |
|
|
|
import javax.annotation.Resource; |
|
|
|
import java.util.ArrayList; |
|
|
|
import java.util.ArrayList; |
|
|
|
import java.util.Collections; |
|
|
|
import java.util.Collections; |
|
|
|
|
|
|
|
import java.util.HashSet; |
|
|
|
import java.util.List; |
|
|
|
import java.util.List; |
|
|
|
import java.util.regex.Pattern; |
|
|
|
|
|
|
|
import java.util.stream.Collectors; |
|
|
|
import java.util.stream.Collectors; |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
@ -41,18 +40,41 @@ public class ZyMakerServiceImpl extends ServiceImpl<ZyMakerMapper, ZyMaker> impl |
|
|
|
|
|
|
|
|
|
|
|
////点击制单 点击后按产品模块分解成制单写入制单表
|
|
|
|
////点击制单 点击后按产品模块分解成制单写入制单表
|
|
|
|
@Override |
|
|
|
@Override |
|
|
|
public void listMakerAdd() { |
|
|
|
public int listMakerAdd() { |
|
|
|
|
|
|
|
int distinct = 0; |
|
|
|
//先拿到所有产品 产品暂定为服装款式里面的数据
|
|
|
|
//先拿到所有产品 产品暂定为服装款式里面的数据
|
|
|
|
List<WorkOrder> workOrderList = workOrderService.list(); |
|
|
|
List<WorkOrder> workOrderList = workOrderService.list(); |
|
|
|
for (WorkOrder workOrder : workOrderList) { |
|
|
|
|
|
|
|
ZyMaker maker = new ZyMaker(); |
|
|
|
List<ZyMaker> makerList = this.list(); |
|
|
|
//制单编号 工单编号(22)+顺序号(2)
|
|
|
|
List<String> workOrderCollect = workOrderList.stream().map(WorkOrder::getProductCode).collect(Collectors.toList()); |
|
|
|
maker.setCode(getMakerCode(workOrder.getProductCode())); |
|
|
|
//List<String> collect = makerList.stream().map(ZyMaker::getWorkerCode).collect(Collectors.toList());
|
|
|
|
//工单编号
|
|
|
|
//HashSet<String> codeHashSet = new HashSet<>(collect);
|
|
|
|
maker.setWorkerCode(workOrder.getProductCode()); |
|
|
|
HashSet<String> codeHashSet = makerList.stream().map(ZyMaker::getWorkerCode).collect(Collectors.toCollection(HashSet::new)); |
|
|
|
this.save(maker); |
|
|
|
|
|
|
|
|
|
|
|
for (String productCode : workOrderCollect) { |
|
|
|
|
|
|
|
if (codeHashSet.add(productCode)) { |
|
|
|
|
|
|
|
distinct = distinct + 1; |
|
|
|
|
|
|
|
ZyMaker maker = new ZyMaker(); |
|
|
|
|
|
|
|
//制单编号 工单编号(22)+顺序号(2)
|
|
|
|
|
|
|
|
String code =productCode+getMakerCode(productCode); |
|
|
|
|
|
|
|
maker.setCode(code); |
|
|
|
|
|
|
|
//工单编号
|
|
|
|
|
|
|
|
maker.setWorkerCode(productCode); |
|
|
|
|
|
|
|
this.save(maker); |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// for (WorkOrder workOrder : workOrderList) {
|
|
|
|
|
|
|
|
// ZyMaker maker = new ZyMaker();
|
|
|
|
|
|
|
|
// //制单编号 工单编号(22)+顺序号(2)
|
|
|
|
|
|
|
|
// String code = workOrder.getProductCode()+getMakerCode(workOrder.getProductCode());
|
|
|
|
|
|
|
|
// maker.setCode(code);
|
|
|
|
|
|
|
|
// //工单编号
|
|
|
|
|
|
|
|
// maker.setWorkerCode(workOrder.getProductCode());
|
|
|
|
|
|
|
|
// this.save(maker);
|
|
|
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return distinct; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
@Override |
|
|
|