| | |
| | | import cn.hutool.json.JSONArray; |
| | | import cn.hutool.json.JSONObject; |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.fasterxml.jackson.databind.ObjectMapper; |
| | | import com.github.yulichang.base.MPJBaseServiceImpl; |
| | |
| | | import com.mes.damage.entity.Damage; |
| | | import com.mes.damage.entity.DamagePrint; |
| | | import com.mes.damage.entity.dto.DamageDTO; |
| | | import com.mes.damage.entity.request.DamageRequest; |
| | | import com.mes.damage.entity.vo.FlowCardDamageVO; |
| | | import com.mes.damage.entity.vo.GlassDamageVO; |
| | | import com.mes.damage.mapper.DamageMapper; |
| | | import com.mes.damage.service.DamageService; |
| | | import com.mes.glassinfo.entity.GlassInfo; |
| | | import com.mes.glassinfo.mapper.GlassInfoMapper; |
| | | import com.mes.opctask.entity.LoadGlassDeviceTaskHistory; |
| | | import com.mes.pp.entity.DamageDetails; |
| | | import com.mes.pp.entity.ReportingWork; |
| | | import com.mes.pp.entity.ReportingWorkDetail; |
| | |
| | | */ |
| | | @Override |
| | | public void insertDamage(Damage damage) { |
| | | List<Damage> damage1 = null; |
| | | if (Const.GLASS_STATE_DAMAGE.equals(damage.getType()) || Const.GLASS_STATE_TAKE.equals(damage.getType())) { |
| | | damage1 = baseMapper.selectList( |
| | | new LambdaQueryWrapper<Damage>() |
| | | .in(Damage::getType, Const.GLASS_STATE_DAMAGE, Const.GLASS_STATE_TAKE) |
| | | .notIn(Damage::getStatus, 7, 8) |
| | | .lt(Damage::getStatus, 7) |
| | | .eq(Damage::getGlassId, damage.getGlassId()) |
| | | ); |
| | | } else { |
| | | damage1 = baseMapper.selectList( |
| | | new LambdaQueryWrapper<Damage>() |
| | | .notIn(Damage::getType, Const.GLASS_STATE_DAMAGE, Const.GLASS_STATE_TAKE) |
| | | .eq(Damage::getLine, damage.getLine()) |
| | | .eq(Damage::getWorkingProcedure, damage.getWorkingProcedure()) |
| | | .eq(Damage::getGlassId, damage.getGlassId()) |
| | | ); |
| | | } |
| | | if (damage1 == null || damage1.size() == 0) { |
| | | LambdaQueryWrapper<GlassInfo> glassInfoSelectWrapper = new LambdaQueryWrapper<>(); |
| | | glassInfoSelectWrapper.eq(GlassInfo::getGlassId, damage.getGlassId()); |
| | | GlassInfo glassInfo = glassInfoMapper.selectOne(glassInfoSelectWrapper); |
| | |
| | | if (damage.getType() == null) { |
| | | damage.setType(1); |
| | | } |
| | | List<Damage> damage1 = null; |
| | | if (Const.GLASS_STATE_DAMAGE.equals(damage.getType()) || Const.GLASS_STATE_TAKE.equals(damage.getType())) { |
| | | damage1 = baseMapper.selectList( |
| | | new LambdaQueryWrapper<Damage>() |
| | | .in(Damage::getType, Const.GLASS_STATE_DAMAGE, Const.GLASS_STATE_TAKE) |
| | | .notIn(Damage::getStatus, 7, 8) |
| | | .lt(Damage::getStatus, 7) |
| | | .eq(Damage::getGlassId, damage.getGlassId()) |
| | | ); |
| | | } else { |
| | | damage1 = baseMapper.selectList( |
| | | new LambdaQueryWrapper<Damage>() |
| | | .notIn(Damage::getType, Const.GLASS_STATE_DAMAGE, Const.GLASS_STATE_TAKE) |
| | | .eq(Damage::getLine, damage.getLine()) |
| | | .eq(Damage::getWorkingProcedure, damage.getWorkingProcedure()) |
| | | .eq(Damage::getGlassId, damage.getGlassId()) |
| | | ); |
| | | } |
| | | if (damage1 == null || damage1.size() == 0) { |
| | | if (damage.getType() == 1 && submitReport(damage)) { |
| | | damage.setStatus(3); |
| | | } else { |
| | | damage.setStatus(1); |
| | | } |
| | | baseMapper.insert(damage); |
| | | } else { |
| | | if (damage.getType() == 1) { |
| | | //重复进入 |
| | | damage.setStatus(9); |
| | | baseMapper.insert(damage); |
| | | } |
| | | } |
| | | } |
| | | |
| | |
| | | // 目标系统的API URL |
| | | |
| | | |
| | | String url1 = ERP_URL + "/reportingWork/mesReportingWork"; |
| | | String url1 = ERP_URL + "/reportingWork/mesReportingWorkRedis"; |
| | | String url2 = ERP_URL + "/reportingWork/mesSaveReportingWorkWorn"; |
| | | String url; |
| | | if (type) { |
| | |
| | | result.put("detail", detailsJsonArray); |
| | | } |
| | | JSONObject reportingWorkJson = new JSONObject(objectMapper.writeValueAsString(reportingWork)); |
| | | reportingWorkJson.put("reportingWorkTime", reportingWork.getReportingWorkTime().format(DateTimeFormatter.ISO_LOCAL_DATE_TIME)); |
| | | DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss"); |
| | | reportingWorkJson.put("reportingWorkTime", reportingWork.getReportingWorkTime().format(formatter)); |
| | | // 将 JSON 对象和数组添加到结果对象中 |
| | | result.put("title", reportingWorkJson); |
| | | |
| | |
| | | int code = jsonResponse.getInt("code"); |
| | | String message = jsonResponse.getStr("data"); |
| | | log.info("报工情况:{},{}", code, message); |
| | | if (code == 200 && message.equals("true")) { |
| | | if (code == 200) { |
| | | return true; |
| | | } else { |
| | | return false; |
| | |
| | | public List<Damage> queryUnTempByFlowCardId(String flowCardId) { |
| | | return baseMapper.queryUnTempByFlowCardId(flowCardId); |
| | | } |
| | | |
| | | @Override |
| | | public List<GlassDamageVO> queryProgress(DamageRequest damageRequest) { |
| | | return baseMapper.queryProgress(damageRequest); |
| | | } |
| | | |
| | | @Override |
| | | public List<FlowCardDamageVO> queryFlowCardIdProgress(DamageRequest damageRequest) { |
| | | return baseMapper.queryFlowCardIdProgress(damageRequest); |
| | | } |
| | | } |