| | |
| | | import com.alibaba.fastjson.TypeReference; |
| | | import com.baomidou.dynamic.datasource.annotation.DS; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.example.erp.dto.pp.*; |
| | | import com.example.erp.entity.pp.DamageDetails; |
| | | import com.example.erp.entity.pp.Report; |
| | | import com.example.erp.entity.sd.BasicData; |
| | | import com.example.erp.entity.sd.OrderDetail; |
| | | import com.example.erp.entity.sd.OrderGlassDetail; |
| | | import com.example.erp.entity.sd.ProductDetail; |
| | | import com.example.erp.mapper.pp.FlowCardMapper; |
| | | import com.example.erp.mapper.pp.ProductionSchedulingMapper; |
| | | import com.example.erp.mapper.pp.ReportMapper; |
| | | import com.example.erp.mapper.pp.ReportingWorkMapper; |
| | | import com.example.erp.mapper.pp.*; |
| | | import com.example.erp.mapper.sd.*; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.util.StringUtils; |
| | | |
| | |
| | | private final BasicDataMapper basicDataMapper; |
| | | private final ProductDetailMapper productDetailMapper; |
| | | private final OrderDetailMapper orderDetailMapper; |
| | | private final DamageDetailsMapper damageDetailsMapper; |
| | | |
| | | FlowCardMapper flowCardMapper; |
| | | private ReportingWorkMapper reportingWorkMapper; |
| | |
| | | ProductionSchedulingMapper productionSchedulingMapper, FlowCardMapper flowCardMapper, |
| | | OrderGlassDetailMapper orderGlassDetailMapper, BasicDataMapper basicDataMapper, |
| | | ProductDetailMapper productDetailMapper, OrderDetailMapper orderDetailMapper, |
| | | ReportingWorkMapper reportingWorkMapper) { |
| | | ReportingWorkMapper reportingWorkMapper, DamageDetailsMapper damageDetailsMapper) { |
| | | this.reportMapper = reportMapper; |
| | | this.orderProcessDetailMapper = orderProcessDetailMapper; |
| | | this.productionSchedulingMapper = productionSchedulingMapper; |
| | |
| | | this.productDetailMapper = productDetailMapper; |
| | | this.orderDetailMapper = orderDetailMapper; |
| | | this.reportingWorkMapper = reportingWorkMapper; |
| | | this.damageDetailsMapper = damageDetailsMapper; |
| | | } |
| | | |
| | | //流程卡进度方法 |
| | |
| | | Map<String, String> data = JSON.parseObject(dataList.get(i).get("reportWorkQuantity"), |
| | | new TypeReference<Map<String, String>>() { |
| | | }); |
| | | Map<String, String> dataShow = JSON.parseObject(dataList.get(i).get("reportWorkQuantityShow"), |
| | | new TypeReference<Map<String, String>>() { |
| | | }); |
| | | //判断后工序此流程卡号是否有次破 |
| | | List<DamageDetails> hasBreak = damageDetailsMapper |
| | | .selectList(new LambdaQueryWrapper<DamageDetails>() |
| | | .eq(DamageDetails::getProcessId, dataList.get(i).get("processId")) |
| | | .eq(DamageDetails::getOrderNumber, dataList.get(i).get("order_number")) |
| | | .eq(DamageDetails::getTechnologyNumber, dataList.get(i).get("technology_number")) |
| | | .eq(DamageDetails::getPatchStatus, 0) |
| | | .gt(DamageDetails::getBreakageQuantity,0) |
| | | |
| | | ); |
| | | if(!hasBreak.isEmpty()){ |
| | | int finalI = i; |
| | | data.forEach((thisProcess, index)->{ |
| | | String behindProcess = orderProcessDetailMapper.getBehindProcess( |
| | | dataList.get(finalI).get("processId"), |
| | | String.valueOf(dataList.get(finalI).get("order_number")), |
| | | String.valueOf(dataList.get(finalI).get("technology_number")), |
| | | thisProcess, |
| | | orderId |
| | | ); |
| | | System.out.println(behindProcess); |
| | | System.out.println("--------"); |
| | | if(behindProcess!=null &&!behindProcess.isEmpty()){ |
| | | Integer behindDamageSum = damageDetailsMapper.getBehindDamageSum( |
| | | dataList.get(finalI).get("processId"), |
| | | String.valueOf(dataList.get(finalI).get("order_number")), |
| | | String.valueOf(dataList.get(finalI).get("technology_number")), |
| | | behindProcess |
| | | ); |
| | | if(behindDamageSum>0){ |
| | | data.put(thisProcess, String.valueOf(Integer.parseInt(data.get(thisProcess) )- behindDamageSum)); |
| | | dataShow.put(thisProcess, String.valueOf(Integer.parseInt(dataShow.get(thisProcess) )- behindDamageSum)); |
| | | } |
| | | |
| | | } |
| | | }); |
| | | |
| | | } |
| | | |
| | | |
| | | |
| | | Integer max = orderGlassDetailMapper |
| | | .getMaxTechnologyNumberByGroup(dataList.get(i).get("order_id"), |
| | | String.valueOf(dataList.get(i).get("order_number")), |
| | |
| | | } |
| | | } |
| | | dataList.get(i).put("reportWorkQuantity",JSON.toJSONString(data)); |
| | | dataList.get(i).put("reportWorkQuantityShow",JSON.toJSONString(dataShow)); |
| | | |
| | | } |
| | | } |