|
@ -27,6 +27,7 @@ import org.nl.wms.sch.group.service.dto.SchBaseVehiclematerialgroupQuery; |
|
|
import org.nl.wms.sch.point.service.ISchBasePointService; |
|
|
import org.nl.wms.sch.point.service.ISchBasePointService; |
|
|
import org.nl.wms.sch.point.service.dao.SchBasePoint; |
|
|
import org.nl.wms.sch.point.service.dao.SchBasePoint; |
|
|
import org.nl.wms.sch.process_flow.service.ProcessFlowService; |
|
|
import org.nl.wms.sch.process_flow.service.ProcessFlowService; |
|
|
|
|
|
import org.nl.wms.sch.task.service.ISchBaseTaskService; |
|
|
import org.springframework.beans.factory.annotation.Autowired; |
|
|
import org.springframework.beans.factory.annotation.Autowired; |
|
|
import org.springframework.stereotype.Service; |
|
|
import org.springframework.stereotype.Service; |
|
|
|
|
|
|
|
@ -49,19 +50,13 @@ public class SchBaseVehiclematerialgroupServiceImpl extends ServiceImpl<SchBaseV |
|
|
private IMdBaseMaterialService iMdBaseMaterialService; |
|
|
private IMdBaseMaterialService iMdBaseMaterialService; |
|
|
@Autowired |
|
|
@Autowired |
|
|
private ProcessFlowService processFlowService; |
|
|
private ProcessFlowService processFlowService; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Autowired |
|
|
@Autowired |
|
|
private ISchBasePointService pointService; |
|
|
private ISchBasePointService pointService; |
|
|
|
|
|
|
|
|
@Override |
|
|
@Override |
|
|
public IPage<SchBaseVehiclematerialgroup> queryAll(SchBaseVehiclematerialgroupQuery whereJson, PageQuery page) { |
|
|
public IPage<SchBaseVehiclematerialgroup> queryAll(SchBaseVehiclematerialgroupQuery whereJson, PageQuery page) { |
|
|
IPage<SchBaseVehiclematerialgroup> pages = new Page<>(page.getPage() + 1, page.getSize()); |
|
|
IPage<SchBaseVehiclematerialgroup> pages = new Page<>(page.getPage() + 1, page.getSize()); |
|
|
IPage<SchBaseVehiclematerialgroup> schBaseVehiclematerialgroupIPage = vehiclematerialgroupMapper.selectPage(pages, Wrappers.lambdaQuery(SchBaseVehiclematerialgroup.class) |
|
|
IPage<SchBaseVehiclematerialgroup> schBaseVehiclematerialgroupIPage = vehiclematerialgroupMapper.selectAllByPage(pages, whereJson); |
|
|
.eq(StrUtil.isNotBlank(whereJson.getVehicle_code()), SchBaseVehiclematerialgroup::getVehicle_code, whereJson.getVehicle_code()) |
|
|
|
|
|
.eq(StrUtil.isNotBlank(whereJson.getWorkshop_code()), SchBaseVehiclematerialgroup::getWorkshop_code, whereJson.getWorkshop_code()) |
|
|
|
|
|
.eq(StrUtil.isNotBlank(whereJson.getJob_name()), SchBaseVehiclematerialgroup::getJob_name, whereJson.getJob_name()) |
|
|
|
|
|
.eq(StrUtil.isNotBlank(whereJson.getRegion_code()), SchBaseVehiclematerialgroup::getRegion_code, whereJson.getRegion_code())); |
|
|
|
|
|
schBaseVehiclematerialgroupIPage.getRecords().forEach(item -> { |
|
|
schBaseVehiclematerialgroupIPage.getRecords().forEach(item -> { |
|
|
if (StrUtil.isNotBlank(item.getMaterial_id())) { |
|
|
if (StrUtil.isNotBlank(item.getMaterial_id())) { |
|
|
MdBaseMaterial mdBaseMaterial = iMdBaseMaterialService.getOne(Wrappers.lambdaQuery(MdBaseMaterial.class) |
|
|
MdBaseMaterial mdBaseMaterial = iMdBaseMaterialService.getOne(Wrappers.lambdaQuery(MdBaseMaterial.class) |
|
@ -73,11 +68,23 @@ public class SchBaseVehiclematerialgroupServiceImpl extends ServiceImpl<SchBaseV |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
if (StrUtil.isNotBlank(item.getRegion_code())) { |
|
|
if (StrUtil.isNotBlank(item.getRegion_code())) { |
|
|
// item.setRegion_name(pointService.list(Wrappers.lambdaQuery(SchBasePoint.class).eq(SchBasePoint::getRegion_code, item.getRegion_code())).get(0).getRegion_name());
|
|
|
|
|
|
item.setRegion_name(item.getRegion_code()); |
|
|
item.setRegion_name(item.getRegion_code()); |
|
|
|
|
|
} else { |
|
|
|
|
|
item.setRegion_name("未知"); |
|
|
|
|
|
} |
|
|
|
|
|
SchBasePoint one = pointService.getOne(Wrappers.lambdaQuery(SchBasePoint.class) |
|
|
|
|
|
.eq(SchBasePoint::getVehicle_code, item.getVehicle_code())); |
|
|
|
|
|
if (ObjectUtil.isNotEmpty(one)) { |
|
|
|
|
|
item.setTheLocation(one.getPoint_name()); |
|
|
|
|
|
} |
|
|
|
|
|
List<SchBaseVehiclematerialgroup> schBaseVehiclematerialgroups = vehiclematerialgroupMapper.selectList(Wrappers.lambdaQuery(SchBaseVehiclematerialgroup.class) |
|
|
|
|
|
.eq(SchBaseVehiclematerialgroup::getVehicle_code, item.getVehicle_code()) |
|
|
|
|
|
.ne(SchBaseVehiclematerialgroup::getGroup_id, item.getGroup_id())); |
|
|
|
|
|
if (CollUtil.isNotEmpty(schBaseVehiclematerialgroups)) { |
|
|
|
|
|
item.setHasChildren(true); |
|
|
|
|
|
item.setChildren(schBaseVehiclematerialgroups); |
|
|
} |
|
|
} |
|
|
}); |
|
|
}); |
|
|
// pages = vehiclematerialgroupMapper.selectPageLeftJoin(pages, whereJson);
|
|
|
|
|
|
return schBaseVehiclematerialgroupIPage; |
|
|
return schBaseVehiclematerialgroupIPage; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
@ -158,7 +165,7 @@ public class SchBaseVehiclematerialgroupServiceImpl extends ServiceImpl<SchBaseV |
|
|
} |
|
|
} |
|
|
}); |
|
|
}); |
|
|
maps = maps.stream().sorted(Comparator.comparingLong(order -> { |
|
|
maps = maps.stream().sorted(Comparator.comparingLong(order -> { |
|
|
if(ObjectUtil.isNotEmpty(order.get("due_date"))){ |
|
|
if (ObjectUtil.isNotEmpty(order.get("due_date"))) { |
|
|
return getTime(StrUtil.toString(order.get("due_date"))); |
|
|
return getTime(StrUtil.toString(order.get("due_date"))); |
|
|
} |
|
|
} |
|
|
return 0; |
|
|
return 0; |
|
@ -166,7 +173,15 @@ public class SchBaseVehiclematerialgroupServiceImpl extends ServiceImpl<SchBaseV |
|
|
return maps; |
|
|
return maps; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
private Long getTime(String dateString){ |
|
|
@Override |
|
|
|
|
|
public List<SchBaseVehiclematerialgroup> selectByVehicleCode(JSONObject entity) { |
|
|
|
|
|
List<SchBaseVehiclematerialgroup> schBaseVehiclematerialgroups = vehiclematerialgroupMapper.selectList(Wrappers.lambdaQuery(SchBaseVehiclematerialgroup.class) |
|
|
|
|
|
.eq(SchBaseVehiclematerialgroup::getVehicle_code, entity.getString("vehicle_code")) |
|
|
|
|
|
.ne(SchBaseVehiclematerialgroup::getGroup_id, entity.getString("group_id"))); |
|
|
|
|
|
return schBaseVehiclematerialgroups; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
private Long getTime(String dateString) { |
|
|
String pattern = "yyyy-MM-dd HH:mm:ss"; |
|
|
String pattern = "yyyy-MM-dd HH:mm:ss"; |
|
|
java.util.Date date = DateUtil.parse(dateString, pattern); |
|
|
java.util.Date date = DateUtil.parse(dateString, pattern); |
|
|
long timestamp = date.getTime(); |
|
|
long timestamp = date.getTime(); |
|
|