Commit 5226cd48 authored by 李驰骋's avatar 李驰骋

排产相关调整

parent f4a5606a
...@@ -87,27 +87,6 @@ public class BaseController { ...@@ -87,27 +87,6 @@ public class BaseController {
return rspData; return rspData;
} }
// 手动分页 manualPagination
protected static <T> TableDataInfo<T> getManualDataTable(final List<T> list) {
final PaginationHelper<T> paginator = new PaginationHelper<>(list);
List<T> page = new ArrayList<>();
final PageDomain pageDomain = TableSupport.buildPageRequest();
final Integer pageNum = pageDomain.getPageNum();
final Integer pageSize = pageDomain.getPageSize();
if (StringUtils.isNotNull(pageNum) && StringUtils.isNotNull(pageSize)) {
paginator.setPageSize(pageSize);
page = paginator.getPage(pageNum);
} else {
paginator.setPageSize(10);
page = paginator.getPage(1);
}
final TableDataInfo<T> rspData = new TableDataInfo<>(page, new PageInfo<>(list).getTotal());
rspData.setCode(HttpStatus.SUCCESS);
rspData.setMsg("查询成功");
return rspData;
}
/** /**
* 返回成功 * 返回成功
*/ */
......
...@@ -54,8 +54,9 @@ public class CalWorkunitController extends BaseController { ...@@ -54,8 +54,9 @@ public class CalWorkunitController extends BaseController {
// @PreAuthorize("@ss.hasPermi('md:workunit:list')") // @PreAuthorize("@ss.hasPermi('md:workunit:list')")
@GetMapping("/unSelectList") @GetMapping("/unSelectList")
public TableDataInfo unSelectList(CalWorkunit calWorkunit) { public TableDataInfo unSelectList(CalWorkunit calWorkunit) {
startPage();
List<MdWorkunit> list = calWorkunitService.selectUnSelectList(calWorkunit); List<MdWorkunit> list = calWorkunitService.selectUnSelectList(calWorkunit);
return getManualDataTable(list); return getDataTable(list);
} }
@GetMapping("/calWorkunitList") @GetMapping("/calWorkunitList")
......
...@@ -58,10 +58,6 @@ public class MdWorkunitWorkerController extends BaseController { ...@@ -58,10 +58,6 @@ public class MdWorkunitWorkerController extends BaseController {
List<MdWorkunitWorker> list = mdWorkunitWorkerService.selectMdWorkunitWorkerList(mdWorkunitWorker); List<MdWorkunitWorker> list = mdWorkunitWorkerService.selectMdWorkunitWorkerList(mdWorkunitWorker);
return getDataTable(list); return getDataTable(list);
} }
///{id}")
// public AjaxResult getInfo(@PathVariable("id") Long id)
/** /**
* 查询工作单元列表 * 查询工作单元列表
*/ */
...@@ -69,11 +65,12 @@ public class MdWorkunitWorkerController extends BaseController { ...@@ -69,11 +65,12 @@ public class MdWorkunitWorkerController extends BaseController {
@PreAuthorize("@ss.hasPermi('md:workunit:list')") @PreAuthorize("@ss.hasPermi('md:workunit:list')")
@GetMapping("/listByUser") @GetMapping("/listByUser")
public TableDataInfo list(MdWorkunit mdWorkunit) { public TableDataInfo list(MdWorkunit mdWorkunit) {
startPage();
List<MdWorkunitVo> list = mdWorkunitService.selectMdWorkunitList(mdWorkunit); List<MdWorkunitVo> list = mdWorkunitService.selectMdWorkunitList(mdWorkunit);
Set<Long> workunitIds = mdWorkunitWorkerMapper.selectListByQw(new QueryWrapper<MdWorkunitWorker>().eq("user_id", mdWorkunit.getUserId())).stream().map(MdWorkunitWorker::getWorkunitId).filter(Objects::nonNull).collect(Collectors.toSet()); Set<Long> workunitIds = mdWorkunitWorkerMapper.selectListByQw(new QueryWrapper<MdWorkunitWorker>().eq("user_id", mdWorkunit.getUserId())).stream().map(MdWorkunitWorker::getWorkunitId).filter(Objects::nonNull).collect(Collectors.toSet());
List<MdWorkunitVo> collect = list.stream().filter(x -> !workunitIds.contains(x.getWorkunitId())).collect(Collectors.toList()); List<MdWorkunitVo> collect = list.stream().filter(x -> !workunitIds.contains(x.getWorkunitId())).collect(Collectors.toList());
return getManualDataTable(collect); return getDataTable(collect);
} }
/** /**
......
...@@ -75,8 +75,9 @@ public class ProArrangeController extends BaseController { ...@@ -75,8 +75,9 @@ public class ProArrangeController extends BaseController {
@PreAuthorize("@ss.hasPermi('pro:arrange:distinctList')") @PreAuthorize("@ss.hasPermi('pro:arrange:distinctList')")
@PostMapping("/distinctList") @PostMapping("/distinctList")
public TableDataInfo<ProArrange> distinctList(ProArrangeQuery proArrange) { public TableDataInfo<ProArrange> distinctList(ProArrangeQuery proArrange) {
startPage();
List<ProArrange> list = proArrangeService.selectDistictArrangeList(proArrange); List<ProArrange> list = proArrangeService.selectDistictArrangeList(proArrange);
return getManualDataTable(list); return getDataTable(list);
} }
/** /**
......
...@@ -63,6 +63,7 @@ public class ProFeedbackController extends BaseController { ...@@ -63,6 +63,7 @@ public class ProFeedbackController extends BaseController {
*/ */
@GetMapping("/list") @GetMapping("/list")
public TableDataInfo<ProFeedbackVo> list(ProFeedback proFeedback) { public TableDataInfo<ProFeedbackVo> list(ProFeedback proFeedback) {
startPage();
QueryWrapper<ProFeedback> query = new QueryWrapper<>(); QueryWrapper<ProFeedback> query = new QueryWrapper<>();
query.eq(StringUtils.isNotEmpty(proFeedback.getFeedbackType()), "f.feedback_type", proFeedback.getFeedbackType()); query.eq(StringUtils.isNotEmpty(proFeedback.getFeedbackType()), "f.feedback_type", proFeedback.getFeedbackType());
query.eq(StringUtils.isNotEmpty(proFeedback.getStatus()), "f.status", proFeedback.getStatus()); query.eq(StringUtils.isNotEmpty(proFeedback.getStatus()), "f.status", proFeedback.getStatus());
...@@ -105,7 +106,7 @@ public class ProFeedbackController extends BaseController { ...@@ -105,7 +106,7 @@ public class ProFeedbackController extends BaseController {
} }
} }
return getManualDataTable(proFeedbackVoList); return getDataTable(proFeedbackVoList);
} }
/** /**
......
...@@ -115,9 +115,10 @@ public class ProTaskMobController extends BaseController { ...@@ -115,9 +115,10 @@ public class ProTaskMobController extends BaseController {
@ApiOperation("查询状态未完成的生产任务接口") @ApiOperation("查询状态未完成的生产任务接口")
@GetMapping("/getTaskList") @GetMapping("/getTaskList")
public TableDataInfo<ProTask> list(ProTaskQuery proTask) { public TableDataInfo<ProTask> list(ProTaskQuery proTask) {
startPage();
List<ProTask> rst = proTaskService.getTaskList(proTask); List<ProTask> rst = proTaskService.getTaskList(proTask);
return getManualDataTable(rst); return getDataTable(rst);
} }
/** /**
......
...@@ -97,8 +97,9 @@ public class ProWorkorderController extends BaseController { ...@@ -97,8 +97,9 @@ public class ProWorkorderController extends BaseController {
@ApiOperation("工单查询") @ApiOperation("工单查询")
@GetMapping("/list") @GetMapping("/list")
public TableDataInfo<ProWorkorder> list(ProWorkorderQuery proWorkorder) { public TableDataInfo<ProWorkorder> list(ProWorkorderQuery proWorkorder) {
startPage();
List<ProWorkorder> list = proWorkorderService.selectProWorkorderList(proWorkorder); List<ProWorkorder> list = proWorkorderService.selectProWorkorderList(proWorkorder);
return getManualDataTable(list); return getDataTable(list);
} }
/** /**
...@@ -107,6 +108,7 @@ public class ProWorkorderController extends BaseController { ...@@ -107,6 +108,7 @@ public class ProWorkorderController extends BaseController {
@ApiOperation("查询待排产生产工单列表") @ApiOperation("查询待排产生产工单列表")
@GetMapping("/scheduleList") @GetMapping("/scheduleList")
public TableDataInfo<ProWorkorder> scheduleList(ProWorkorderQuery proWorkorder) { public TableDataInfo<ProWorkorder> scheduleList(ProWorkorderQuery proWorkorder) {
startPage();
QueryWrapper<ProWorkorder> query = new QueryWrapper<>(); QueryWrapper<ProWorkorder> query = new QueryWrapper<>();
query.like(StringUtils.isNotEmpty(proWorkorder.getWorkorderCode()), "t1.workorder_code", query.like(StringUtils.isNotEmpty(proWorkorder.getWorkorderCode()), "t1.workorder_code",
proWorkorder.getWorkorderCode()); proWorkorder.getWorkorderCode());
...@@ -120,7 +122,7 @@ public class ProWorkorderController extends BaseController { ...@@ -120,7 +122,7 @@ public class ProWorkorderController extends BaseController {
new String[]{WorkorderStatusEnum.PREPARE.getValue(), WorkorderStatusEnum.PUBLISHED.getValue()}); new String[]{WorkorderStatusEnum.PREPARE.getValue(), WorkorderStatusEnum.PUBLISHED.getValue()});
query.gt("t1.quantity-t1.quantity_scheduled", 0); query.gt("t1.quantity-t1.quantity_scheduled", 0);
List<ProWorkorder> list = proWorkorderService.selectListByQw(query); List<ProWorkorder> list = proWorkorderService.selectListByQw(query);
return getManualDataTable(list); return getDataTable(list);
} }
...@@ -238,6 +240,8 @@ public class ProWorkorderController extends BaseController { ...@@ -238,6 +240,8 @@ public class ProWorkorderController extends BaseController {
/** /**
* 新增生产工单 * 新增生产工单
*/ */
@ApiOperation("生产工单新增")
@PreAuthorize("@ss.hasPermi('mes:pro:workorder:add')") @PreAuthorize("@ss.hasPermi('mes:pro:workorder:add')")
@Log(title = "生产工单", businessType = BusinessType.INSERT) @Log(title = "生产工单", businessType = BusinessType.INSERT)
@PostMapping @PostMapping
...@@ -274,6 +278,7 @@ public class ProWorkorderController extends BaseController { ...@@ -274,6 +278,7 @@ public class ProWorkorderController extends BaseController {
/** /**
* 修改生产工单 * 修改生产工单
*/ */
@ApiOperation("生产工单修改")
@PreAuthorize("@ss.hasPermi('mes:pro:workorder:edit')") @PreAuthorize("@ss.hasPermi('mes:pro:workorder:edit')")
@Log(title = "生产工单", businessType = BusinessType.UPDATE) @Log(title = "生产工单", businessType = BusinessType.UPDATE)
@PutMapping @PutMapping
...@@ -418,7 +423,6 @@ public class ProWorkorderController extends BaseController { ...@@ -418,7 +423,6 @@ public class ProWorkorderController extends BaseController {
} }
@ApiOperation("打样生产工单任务生成")
@PostMapping(value = "/proofMakeProduction") @PostMapping(value = "/proofMakeProduction")
public AjaxResult proofMakeProduction(@RequestBody WorkorderProofMakeProduction production) { public AjaxResult proofMakeProduction(@RequestBody WorkorderProofMakeProduction production) {
proWorkorderService.proofMakeProduction(production); proWorkorderService.proofMakeProduction(production);
......
...@@ -38,8 +38,9 @@ public class ProTaskWorkunitController extends BaseController { ...@@ -38,8 +38,9 @@ public class ProTaskWorkunitController extends BaseController {
@PreAuthorize("@ss.hasPermi('mes:pro:taskWorkunit:list')") @PreAuthorize("@ss.hasPermi('mes:pro:taskWorkunit:list')")
@PostMapping("/list") @PostMapping("/list")
public TableDataInfo<ProTaskWorkunit> list(@RequestBody ProTaskWorkunitQuery proTaskWorkunit) { public TableDataInfo<ProTaskWorkunit> list(@RequestBody ProTaskWorkunitQuery proTaskWorkunit) {
startPage();
List<ProTaskWorkunit> lists = proTaskWorkunitService.schedulingList(proTaskWorkunit); List<ProTaskWorkunit> lists = proTaskWorkunitService.schedulingList(proTaskWorkunit);
return getManualDataTable(lists); return getDataTable(lists);
} }
@ApiOperation("查询任务工作单元列表") @ApiOperation("查询任务工作单元列表")
......
...@@ -174,5 +174,9 @@ public class ProTaskWorkunit extends BaseEntity { ...@@ -174,5 +174,9 @@ public class ProTaskWorkunit extends BaseEntity {
@ApiModelProperty("编排单号") @ApiModelProperty("编排单号")
private String arrangeCode; private String arrangeCode;
@TableField(exist = false)
@ApiModelProperty("工单编号")
private String workorderCode;
private int percent; private int percent;
} }
...@@ -142,15 +142,17 @@ public interface ProTaskWorkunitMapper { ...@@ -142,15 +142,17 @@ public interface ProTaskWorkunitMapper {
"\t, t.workstation_id, t.workstation_code, ws.workstation_name\n" + "\t, t.workstation_id, t.workstation_code, ws.workstation_name\n" +
"\t, t.process_id, t.process_code, t.process_name\n" + "\t, t.process_id, t.process_code, t.process_name\n" +
"\t, t.item_id, t.item_code, t.item_name, t.specification, t.unit_of_measure\n" + "\t, t.item_id, t.item_code, t.item_name, t.specification, t.unit_of_measure\n" +
"\t, ptw.task_workunit_id, ptw.quantity, t.quantity_wait, ptw.quantity_produced, ptw.quantity_changed\n" + "\t, ptw.task_workunit_id, ptw.quantity, ptw.create_by, t.quantity_wait, ptw.quantity_produced, ptw.quantity_changed\n" +
"\t, t.client_id, t.client_code, t.client_name, t.client_nick, t.is_last_process, ptw.schedule_start_date\n" + "\t, t.client_id, t.client_code, t.client_name, t.client_nick, t.is_last_process, ptw.schedule_start_date\n" +
"\t, t.duration, ptw.schedule_end_date, t.color_code, t.request_date\n" + "\t, t.duration, ptw.schedule_end_date, t.color_code, t.request_date\n" +
"\t, t.attr1, t.attr2, t.attr3, t.attr4, t.create_by\n" + "\t, t.attr1, t.attr2, t.attr3, t.attr4\n" +
"\t, t.create_time, t.update_by, t.update_time, ptw.STATUS, ptw.quantity_qualify, ptw.remark\n" + "\t, t.create_time, t.update_by, t.update_time, ptw.STATUS, ptw.quantity_qualify, ptw.remark\n" +
"\t, ptw.quantity_unqualify, mw.workunit_id, mw.workunit_code, mw.workunit_name, t.arrange_code\n" + "\t, ptw.quantity_unqualify, mw.workunit_id, mw.workunit_code, mw.workunit_name, wo.workorder_code\n" +
"\t, (case ptw.STATUS when 'BEGINNING' then 1 when 'PREPARE' then 2 when 'PAUSE' then 3 when 'ERROR_STOP' then 4 end) statusIndex\n" + "\t, (case ptw.STATUS when 'BEGINNING' then 1 when 'PREPARE' then 2 when 'PAUSE' then 3 when 'ERROR_STOP' then 4 end) statusIndex\n" +
"from pro_task_workunit ptw\n" + "from pro_task_workunit ptw\n" +
"\tleft join pro_task t on ptw.task_id = t.task_id\n" + "\tleft join pro_task t on ptw.task_id = t.task_id\n" +
"\tleft join pro_task_workorder tw on t.task_id = tw.task_id\n" +
"\tleft join pro_workorder wo on wo.workorder_id = tw.workorder_id\n" +
"\tleft join pro_process p on t.process_id = p.process_id\n" + "\tleft join pro_process p on t.process_id = p.process_id\n" +
"\tleft join md_workunit mw on ptw.workunit_id = mw.workunit_id\n" + "\tleft join md_workunit mw on ptw.workunit_id = mw.workunit_id\n" +
"\tleft join md_workstation ws on mw.workstation_id = ws.workstation_id\n" + "\tleft join md_workstation ws on mw.workstation_id = ws.workstation_id\n" +
......
...@@ -144,16 +144,6 @@ public class Task { ...@@ -144,16 +144,6 @@ public class Task {
*/ */
private ScheduleStatus scheduleStatus; private ScheduleStatus scheduleStatus;
/*
* 工序要求设备功能点
*/
private ProcessFunction processFunction=new ProcessFunction();
/**
* 工序要求加工属性
*/
private ProcessRequestAttribute processRequestAttribute = new ProcessRequestAttribute();
/* /*
* 作业日历 * 作业日历
*/ */
...@@ -256,14 +246,6 @@ public class Task { ...@@ -256,14 +246,6 @@ public class Task {
private String printingMethod; private String printingMethod;
} }
public void initProcessAttribute(ProProductionSolutionSpecificationSheet specificationSheet){
BeanUtil.copyProperties(specificationSheet, this.getProcessRequestAttribute());
}
public void initProcessFunction(ProProductionSolutionProcess proProductionSolutionProcess){
BeanUtil.copyProperties(proProductionSolutionProcess, this.getProcessFunction());
}
@Override @Override
public boolean equals(Object o) { public boolean equals(Object o) {
if (this == o) return true; if (this == o) return true;
......
...@@ -135,14 +135,6 @@ public class AlgorithmDataSourceImpl implements AlgorithmDataSource { ...@@ -135,14 +135,6 @@ public class AlgorithmDataSourceImpl implements AlgorithmDataSource {
if(productionSolution==null){ if(productionSolution==null){
throw new ServiceException(String.format("生产工单:%s生产版本未找到", firstWorkorder.getWorkorderCode())); throw new ServiceException(String.format("生产工单:%s生产版本未找到", firstWorkorder.getWorkorderCode()));
} }
//查询对应生产版本工序
QueryWrapper<ProProductionSolutionProcess> processQuery2 = new QueryWrapper<>();
processQuery2.eq("production_solution_id", productionSolution.getProductionSolutionId());
List<ProProductionSolutionProcess> solutionProcesses = proProductionSolutionProcessService.selectProProductionSolutionProcessList(processQuery2);
Map<Long, ProProductionSolutionProcess> solutionProcesseMap = solutionProcesses.stream().collect(Collectors.toMap(s->s.getProcessId(),s->s));
//查询对应生产版本规格说明书
ProProductionSolutionSpecificationSheet specificationSheet = proProductionSolutionSpecificationSheetService.selectSpecificationSheetByProductionSolutionId(productionSolution.getProductionSolutionId());
// 工序分组 生成Job及Task // 工序分组 生成Job及Task
Job job = new Job(scheduleJobGroup.getWorkorderCode(), Duration.between(schedulingStartedDate, DateUtil.date(scheduleJobGroup.getDemandDate()).toLocalDateTime())) {{ Job job = new Job(scheduleJobGroup.getWorkorderCode(), Duration.between(schedulingStartedDate, DateUtil.date(scheduleJobGroup.getDemandDate()).toLocalDateTime())) {{
setFixed(false); setFixed(false);
...@@ -189,8 +181,6 @@ public class AlgorithmDataSourceImpl implements AlgorithmDataSource { ...@@ -189,8 +181,6 @@ public class AlgorithmDataSourceImpl implements AlgorithmDataSource {
task.setSetupTime(Duration.ofNanos(routingItem.getLineBreakTime().multiply(BigDecimal.valueOf(unitMultiple)).longValue())); task.setSetupTime(Duration.ofNanos(routingItem.getLineBreakTime().multiply(BigDecimal.valueOf(unitMultiple)).longValue()));
} }
task.getTaskData().put("SeqNo", routingItem.getProcessRef()); task.getTaskData().put("SeqNo", routingItem.getProcessRef());
task.initProcessAttribute(specificationSheet);
task.initProcessFunction(solutionProcesseMap.get(routingItem.getProcessId()));
job.getTasks().add(task); job.getTasks().add(task);
i++; i++;
} }
......
...@@ -151,126 +151,13 @@ public class EquipmentSelectionStrategyImpl implements EquipmentSelectionStrateg ...@@ -151,126 +151,13 @@ public class EquipmentSelectionStrategyImpl implements EquipmentSelectionStrateg
} }
/** /**
* TODO
* 完全匹配工序设备选择 * 完全匹配工序设备选择
* @param task * @param task
* @param equipments * @param equipments
* @return * @return
*/ */
private List<Equipment> matchEquipment(Task task, List<Equipment> equipments) { private List<Equipment> matchEquipment(Task task, List<Equipment> equipments) {
List<Equipment> rst = new ArrayList<>(); return equipments;
for(Equipment equ : equipments){
Equipment.EquipmentAttribute equipmentAttribute = equ.getEquipmentAttribute();
//如果工序存在匹配规则,需匹配相应设备
Task.ProcessRequestAttribute processRequestAttribute = task.getProcessRequestAttribute();
//厚度
if(processRequestAttribute.getThick()!=null&&processRequestAttribute.getThick().compareTo(BigDecimal.ZERO)!=0){
if(equipmentAttribute.getTreatingThicknessMin()!=null&&
equipmentAttribute.getTreatingThicknessMin().compareTo(processRequestAttribute.getThick())>0){
continue;
}
if(equipmentAttribute.getTreatingThicknessMax()!=null&&
equipmentAttribute.getTreatingThicknessMax().compareTo(processRequestAttribute.getThick())<0){
continue;
}
}
//宽度
if(processRequestAttribute.getPrintingWidth()!=null&&
processRequestAttribute.getPrintingWidth().compareTo(BigDecimal.ZERO)!=0){
if(equipmentAttribute.getTreatingWidthMin()!=null&&
equipmentAttribute.getTreatingWidthMin().compareTo(processRequestAttribute.getPrintingWidth())>0){
continue;
}
if(equipmentAttribute.getTreatingWidthMax()!=null&&
equipmentAttribute.getTreatingWidthMax().compareTo(processRequestAttribute.getPrintingWidth())<0){
continue;
}
}
//油槽数
if(processRequestAttribute.getDieSunkOffsetOilTankNum()!=null&&
processRequestAttribute.getDieSunkOffsetOilTankNum().compareTo(BigDecimal.ZERO)!=0){
if(equipmentAttribute.getDieSunkOffsetOilTankNum()!=null&&
equipmentAttribute.getDieSunkOffsetOilTankNum().compareTo(processRequestAttribute.getDieSunkOffsetOilTankNum())<0){
continue;
}
}
//印刷方式
if(StringUtils.isNotEmpty(processRequestAttribute.getPrintingMethod())){
if("双面印刷".equals(processRequestAttribute.getPrintingMethod())){
if(StringUtils.isNotEmpty(equipmentAttribute.getPrintingMethod()) &&
!processRequestAttribute.getPrintingMethod().equals(equipmentAttribute.getPrintingMethod())){
continue;
}
}
}
//设备功能点,需满足工序所属功能点
if(!this.equipmentFunctionMatch(task.getProcessFunction(), equ.getEquipmentFunction())){
continue;
}
rst.add(equ);
}
return rst;
}
//判断设备是否满足工序功能点要求
private boolean equipmentFunctionMatch(Task.ProcessFunction processFunction,
Equipment.EquipmentFunction equipmentFunction){
if("Y".equalsIgnoreCase(processFunction.getSacmForEdgeOpening())){
if(!"Y".equalsIgnoreCase(equipmentFunction.getSacmForEdgeOpening())){
return false;
}
}
if("Y".equalsIgnoreCase(processFunction.getSacmForPasteComposite())){
if(!"Y".equalsIgnoreCase(equipmentFunction.getSacmForPasteComposite())){
return false;
}
}
if("Y".equalsIgnoreCase(processFunction.getSacmForThermalComposite())){
if(!"Y".equalsIgnoreCase(equipmentFunction.getSacmForThermalComposite())){
return false;
}
}
if("Y".equalsIgnoreCase(processFunction.getSacmForLabeling())){
if(!"Y".equalsIgnoreCase(equipmentFunction.getSacmForLabeling())){
return false;
}
}
if("Y".equalsIgnoreCase(processFunction.getSacmForBuckleUp())){
if(!"Y".equalsIgnoreCase(equipmentFunction.getSacmForBuckleUp())){
return false;
}
}
if("Y".equalsIgnoreCase(processFunction.getSacmForCreasing())){
if(!"Y".equalsIgnoreCase(equipmentFunction.getSacmForCreasing())){
return false;
}
}
if("Y".equalsIgnoreCase(processFunction.getSacmForOrgan())){
if(!"Y".equalsIgnoreCase(equipmentFunction.getSacmForOrgan())){
return false;
}
}
if("Y".equalsIgnoreCase(processFunction.getSacmForThermalCutting())){
if(!"Y".equalsIgnoreCase(equipmentFunction.getSacmForThermalCutting())){
return false;
}
}
if("Y".equalsIgnoreCase(processFunction.getSacmForThermalSelfFusion())){
if(!"Y".equalsIgnoreCase(equipmentFunction.getSacmForThermalSelfFusion())){
return false;
}
}
if("Y".equalsIgnoreCase(processFunction.getSacmForMolarTooth())){
if(!"Y".equalsIgnoreCase(equipmentFunction.getSacmForMolarTooth())){
return false;
}
}
if("Y".equalsIgnoreCase(processFunction.getSacmForSlitting())){
if(!"Y".equalsIgnoreCase(equipmentFunction.getSacmForSlitting())){
return false;
}
}
return true;
} }
} }
...@@ -247,7 +247,7 @@ public class ProProductionSolutionServiceImpl implements IProProductionSolutionS ...@@ -247,7 +247,7 @@ public class ProProductionSolutionServiceImpl implements IProProductionSolutionS
BeanUtils.copyProperties(proProductionSolutionProcessVo, proProductionSolutionProcess); BeanUtils.copyProperties(proProductionSolutionProcessVo, proProductionSolutionProcess);
proProductionSolutionProcess.setSerial(k); proProductionSolutionProcess.setSerial(k);
if (proProductionSolutionProcessVo.getQuantity() == null) { if (proProductionSolutionProcessVo.getQuantity() == null) {
proProductionSolutionProcess.setQuantity(new BigDecimal("1000.000")); proProductionSolutionProcess.setQuantity(new BigDecimal("1"));
} }
if (StringUtils.isEmpty(proProductionSolutionProcessVo.getUnitOfMeasure())) { if (StringUtils.isEmpty(proProductionSolutionProcessVo.getUnitOfMeasure())) {
proProductionSolutionProcess.setUnitOfMeasure(proProductionSolutionVo.getUnitOfMeasure()); proProductionSolutionProcess.setUnitOfMeasure(proProductionSolutionVo.getUnitOfMeasure());
......
...@@ -391,6 +391,7 @@ public class ProTaskWorkunitServiceImpl implements IProTaskWorkunitService { ...@@ -391,6 +391,7 @@ public class ProTaskWorkunitServiceImpl implements IProTaskWorkunitService {
query.eq(proTaskWorkunit.getWorkCenterId() != null, "ws.workstation_id", proTaskWorkunit.getWorkCenterId()); query.eq(proTaskWorkunit.getWorkCenterId() != null, "ws.workstation_id", proTaskWorkunit.getWorkCenterId());
query.eq(proTaskWorkunit.getWorkunitId() != null, "mw.workunit_id", proTaskWorkunit.getWorkunitId()); query.eq(proTaskWorkunit.getWorkunitId() != null, "mw.workunit_id", proTaskWorkunit.getWorkunitId());
query.eq(proTaskWorkunit.getWorkshopId() != null, "ws.workshop_id", proTaskWorkunit.getWorkshopId()); query.eq(proTaskWorkunit.getWorkshopId() != null, "ws.workshop_id", proTaskWorkunit.getWorkshopId());
query.like(StringUtils.isNotEmpty(proTaskWorkunit.getWorkorderCode()), "wo.workorder_code", proTaskWorkunit.getWorkorderCode());
query.like(StringUtils.isNotEmpty(proTaskWorkunit.getTaskCode()), "t.task_code", proTaskWorkunit.getTaskCode()); query.like(StringUtils.isNotEmpty(proTaskWorkunit.getTaskCode()), "t.task_code", proTaskWorkunit.getTaskCode());
query.like(StringUtils.isNotEmpty(proTaskWorkunit.getWorkunitName()), "mw.workunit_name", proTaskWorkunit.getWorkunitName()); query.like(StringUtils.isNotEmpty(proTaskWorkunit.getWorkunitName()), "mw.workunit_name", proTaskWorkunit.getWorkunitName());
query.like(StringUtils.isNotEmpty(proTaskWorkunit.getItemName()), "t.item_name", proTaskWorkunit.getItemName()); query.like(StringUtils.isNotEmpty(proTaskWorkunit.getItemName()), "t.item_name", proTaskWorkunit.getItemName());
...@@ -402,60 +403,6 @@ public class ProTaskWorkunitServiceImpl implements IProTaskWorkunitService { ...@@ -402,60 +403,6 @@ public class ProTaskWorkunitServiceImpl implements IProTaskWorkunitService {
query.eq(StringUtils.isNotEmpty(proTaskWorkunit.getArrangeCode()), "t.arrange_code", proTaskWorkunit.getArrangeCode()); query.eq(StringUtils.isNotEmpty(proTaskWorkunit.getArrangeCode()), "t.arrange_code", proTaskWorkunit.getArrangeCode());
query.orderByAsc("schedule_start_date"); query.orderByAsc("schedule_start_date");
List<ProTaskWorkunit> list = proTaskWorkunitService.selectTaskWorkUnitJoinTask(query); List<ProTaskWorkunit> list = proTaskWorkunitService.selectTaskWorkUnitJoinTask(query);
if (CollectionUtil.isEmpty(list)) { return list;
return list;
}
Set<String> arrangeSet = list.stream().map(ProTaskWorkunit::getArrangeCode).collect(Collectors.toSet());
QueryWrapper<ProArrange> proArrangeQueryWrapper = new QueryWrapper<>();
proArrangeQueryWrapper.in("arrange_code", arrangeSet);
List<ProArrange> proArranges = proArrangeMapper.selectListByQw(proArrangeQueryWrapper);
Set<String> createBySet = proArranges.stream().map(BaseEntity::getCreateBy).collect(Collectors.toSet());
QueryWrapper<SysUser> queryWrapper = new QueryWrapper<>();
queryWrapper.in(CollectionUtil.isNotEmpty(createBySet), "user_name", createBySet);
List<SysUser> sysApiLogs = sysUserMapper.selectListByQw(queryWrapper);
Map<String, List<SysUser>> userMap = sysApiLogs.stream().collect(Collectors.groupingBy(SysUser::getUserName));
Map<String, List<ProArrange>> arrangeMap = proArranges.stream().collect(Collectors.groupingBy(ProArrange::getArrangeCode));
List<ProTaskWorkunit> objects = new ArrayList<>();
String workorderCode = proTaskWorkunit.getWorkorderCode();
String arrangeUsername = proTaskWorkunit.getArrangeUsername();
if (StringUtils.isNotEmpty(proTaskWorkunit.getArrangeUsername()) || StringUtils.isNotEmpty(workorderCode)) {
for (ProTaskWorkunit taskWorkunit : list) {
String arrangeCode = taskWorkunit.getArrangeCode();
List<ProArrange> proArranges1 = arrangeMap.get(arrangeCode);
if (proArranges1 != null && proArranges1.size() > 0) {
for (ProArrange proArrange : proArranges1) {
if (StringUtils.isNotEmpty(arrangeUsername) && StringUtils.isNotEmpty(workorderCode)) {
List<SysUser> sysUsers = userMap.get(proArrange.getCreateBy());
if (sysUsers.size() > 0) {
SysUser sysUser = sysUsers.get(0);
if (Objects.equals(proArrange.getArrangeCode(), proTaskWorkunit.getArrangeCode()) && arrangeUsername.toLowerCase().contains(sysUser.getNickName().toLowerCase())) {
objects.add(taskWorkunit);
}
}
} else if (StringUtils.isNotEmpty(arrangeUsername) && StringUtils.isEmpty(workorderCode)) {
List<SysUser> sysUsers = userMap.get(proArrange.getCreateBy());
if (sysUsers.size() > 0) {
SysUser sysUser = sysUsers.get(0);
if (arrangeUsername.toLowerCase().contains(sysUser.getNickName().toLowerCase())) {
objects.add(taskWorkunit);
}
}
} else if (StringUtils.isNotEmpty(workorderCode) && StringUtils.isEmpty(arrangeUsername)) {
if (Objects.equals(proArrange.getWorkorderCode(), workorderCode)) {
objects.add(taskWorkunit);
}
}
}
} else {
objects.add(taskWorkunit);
}
}
} else {
objects.addAll(list);
}
return objects;
} }
} }
...@@ -49,6 +49,7 @@ public class TmToolMachinesController extends BaseController { ...@@ -49,6 +49,7 @@ public class TmToolMachinesController extends BaseController {
@PreAuthorize("@ss.hasPermi('tm:tmToolMachines:list')") @PreAuthorize("@ss.hasPermi('tm:tmToolMachines:list')")
@GetMapping("/warehouse/list") @GetMapping("/warehouse/list")
public TableDataInfo warehouselist(TmToolMachines tmToolMachines) { public TableDataInfo warehouselist(TmToolMachines tmToolMachines) {
startPage();
List<TmToolMachines> collect = tmToolMachinesService.selectTmToolMachinesVoList(tmToolMachines); List<TmToolMachines> collect = tmToolMachinesService.selectTmToolMachinesVoList(tmToolMachines);
List<TmToolMachines> list = collect.stream().filter(s -> StringUtils.isNotEmpty(s.getToolRequestUseId())).collect(Collectors.toList()); List<TmToolMachines> list = collect.stream().filter(s -> StringUtils.isNotEmpty(s.getToolRequestUseId())).collect(Collectors.toList());
Set<String> objects = new HashSet<>(); Set<String> objects = new HashSet<>();
...@@ -62,7 +63,7 @@ public class TmToolMachinesController extends BaseController { ...@@ -62,7 +63,7 @@ public class TmToolMachinesController extends BaseController {
} }
} }
} }
return getManualDataTable(objects1); return getDataTable(objects1);
} }
......
...@@ -54,6 +54,7 @@ public class TmToolRequestController extends BaseController { ...@@ -54,6 +54,7 @@ public class TmToolRequestController extends BaseController {
@PreAuthorize("@ss.hasPermi('tm:tmToolRequest:list')") @PreAuthorize("@ss.hasPermi('tm:tmToolRequest:list')")
@GetMapping("/list/unused") @GetMapping("/list/unused")
public TableDataInfo unUselist(TmToolRequest tmToolRequest) { public TableDataInfo unUselist(TmToolRequest tmToolRequest) {
startPage();
List<TmToolRequest> list = tmToolRequestService.selectTmToolRequestList(tmToolRequest); List<TmToolRequest> list = tmToolRequestService.selectTmToolRequestList(tmToolRequest);
Set<Long> collect = list.stream().map(TmToolRequest::getToolRequestId).collect(Collectors.toSet()); Set<Long> collect = list.stream().map(TmToolRequest::getToolRequestId).collect(Collectors.toSet());
Set<Long> set = tmToolRequestUseMapper.selectListByQw(new QueryWrapper<TmToolRequestUse>().in("tool_request_id", collect)).stream().map(TmToolRequestUse::getToolRequestId).collect(Collectors.toSet()); Set<Long> set = tmToolRequestUseMapper.selectListByQw(new QueryWrapper<TmToolRequestUse>().in("tool_request_id", collect)).stream().map(TmToolRequestUse::getToolRequestId).collect(Collectors.toSet());
...@@ -63,7 +64,7 @@ public class TmToolRequestController extends BaseController { ...@@ -63,7 +64,7 @@ public class TmToolRequestController extends BaseController {
objects.add(toolRequest); objects.add(toolRequest);
} }
} }
return getManualDataTable(objects); return getDataTable(objects);
} }
/** /**
......
...@@ -19,6 +19,8 @@ ...@@ -19,6 +19,8 @@
<result property="quantityUnqualify" column="quantity_unqualify"/> <result property="quantityUnqualify" column="quantity_unqualify"/>
<result property="quantityChanged" column="quantity_changed"/> <result property="quantityChanged" column="quantity_changed"/>
<result property="status" column="status"/> <result property="status" column="status"/>
<result property="createBy" column="create_by"/>
<result property="createTime" column="create_time"/>
<result property="remark" column="remark"/> <result property="remark" column="remark"/>
</resultMap> </resultMap>
...@@ -38,6 +40,8 @@ ...@@ -38,6 +40,8 @@
ptw.schedule_start_date, ptw.schedule_start_date,
ptw.schedule_end_date, ptw.schedule_end_date,
ptw.status, ptw.status,
ptw.create_by,
ptw.create_time,
ptw.remark ptw.remark
from pro_task_workunit ptw from pro_task_workunit ptw
left join md_workunit mw left join md_workunit mw
...@@ -98,6 +102,8 @@ ...@@ -98,6 +102,8 @@
<if test="scheduleStartDate != null">schedule_start_date,</if> <if test="scheduleStartDate != null">schedule_start_date,</if>
<if test="scheduleEndDate != null">schedule_end_date,</if> <if test="scheduleEndDate != null">schedule_end_date,</if>
<if test="remark != null">remark,</if> <if test="remark != null">remark,</if>
<if test="createBy != null">create_by,</if>
<if test="createTime != null">create_time,</if>
</trim> </trim>
<trim prefix="values (" suffix=")" suffixOverrides=","> <trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="taskId != null">#{taskId},</if> <if test="taskId != null">#{taskId},</if>
...@@ -113,6 +119,8 @@ ...@@ -113,6 +119,8 @@
<if test="scheduleStartDate != null">#{scheduleStartDate},</if> <if test="scheduleStartDate != null">#{scheduleStartDate},</if>
<if test="scheduleEndDate != null">#{scheduleEndDate},</if> <if test="scheduleEndDate != null">#{scheduleEndDate},</if>
<if test="remark != null">remark,</if> <if test="remark != null">remark,</if>
<if test="createBy != null">#{createBy},</if>
<if test="createTime != null">#{createTime},</if>
</trim> </trim>
</insert> </insert>
...@@ -133,6 +141,8 @@ ...@@ -133,6 +141,8 @@
<if test="scheduleStartDate != null">schedule_start_date = #{scheduleStartDate},</if> <if test="scheduleStartDate != null">schedule_start_date = #{scheduleStartDate},</if>
<if test="scheduleEndDate != null">schedule_end_date = #{scheduleEndDate},</if> <if test="scheduleEndDate != null">schedule_end_date = #{scheduleEndDate},</if>
<if test="remark != null">remark = #{remark},</if> <if test="remark != null">remark = #{remark},</if>
<if test="createBy != null">create_by = #{createBy},</if>
<if test="createTime != null">create_time = #{createTime},</if>
</trim> </trim>
where task_workunit_id = #{taskWorkunitId} where task_workunit_id = #{taskWorkunitId}
</update> </update>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment