Merge remote-tracking branch 'origin/master'
| | |
| | | import lombok.AllArgsConstructor; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import java.io.IOException; |
| | | import java.time.LocalDateTime; |
| | | import java.time.format.DateTimeFormatter; |
| | | import java.util.List; |
| | |
| | | public Result<?> labelPrinting(String ids) { |
| | | return Result.success(insOrderService.labelPrinting(ids)); |
| | | } |
| | | |
| | | @ValueClassify("è´¹ç¨ç»è®¡") |
| | | @ApiOperation(value = "è´¹ç¨ç»è®¡å¯¼åº") |
| | | @PostMapping("/export") |
| | | public void export(@RequestBody Map<String, Object> data,HttpServletResponse response) throws Exception { |
| | | CostStatisticsDto costStatisticsDto = JackSonUtil.unmarshal(JackSonUtil.marshal(data.get("entity")), CostStatisticsDto.class); |
| | | insOrderService.export(costStatisticsDto,response); |
| | | } |
| | | } |
| | |
| | | package com.yuanchu.mom.dto; |
| | | |
| | | import com.alibaba.excel.annotation.ExcelIgnore; |
| | | import com.alibaba.excel.annotation.ExcelProperty; |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import com.yuanchu.mom.annotation.ValueTableShow; |
| | |
| | | |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | @ValueTableShow(value = 1, name = "ä¸åæ¶é´") |
| | | @ExcelProperty(value ={"ä¸å¤©ç§ææ£æµä¸å¿æ ·åç»è®°è¡¨","ZTT/QR-30-01-01","æ¥æ"}) |
| | | private LocalDateTime createTime; |
| | | |
| | | @ValueTableShow(value = 2, name = "å§æç¼å·") |
| | | @ExcelProperty(value ={"ä¸å¤©ç§ææ£æµä¸å¿æ ·åç»è®°è¡¨","ZTT/QR-30-01-01","æ£éªç¼å·"}) |
| | | private String entrustCode; |
| | | |
| | | @ValueTableShow(value = 3, name = "æ ·ååç§°") |
| | | @ExcelProperty(value ={"ä¸å¤©ç§ææ£æµä¸å¿æ ·åç»è®°è¡¨","æ ·ååç§°"}) |
| | | private String sample; |
| | | |
| | | @ValueTableShow(value = 4, name = "è§æ ¼åå·") |
| | | @ExcelProperty(value ={"ä¸å¤©ç§ææ£æµä¸å¿æ ·åç»è®°è¡¨","è§æ ¼åå·"}) |
| | | private String model; |
| | | |
| | | @ValueTableShow(value = 5, name = "æ ·åæ°é") |
| | | @ExcelProperty(value ={"ä¸å¤©ç§ææ£æµä¸å¿æ ·åç»è®°è¡¨","æ ·åæ°é"}) |
| | | private Integer num; |
| | | |
| | | @ValueTableShow(value = 6, name = "æ»ä»·") |
| | | @ExcelProperty(value ={"ä¸å¤©ç§ææ£æµä¸å¿æ ·åç»è®°è¡¨","æ»ä»·"}) |
| | | private BigDecimal price; |
| | | |
| | | @ValueTableShow(value = 7, name = "è¯éªé¡¹ç®") |
| | | @ExcelProperty(value ={"ä¸å¤©ç§ææ£æµä¸å¿æ ·åç»è®°è¡¨","è¯éªé¡¹ç®"}) |
| | | private String inspectionItem; |
| | | |
| | | @ValueTableShow(value = 8, name = "å§æåä½") |
| | | @ExcelProperty(value ={"ä¸å¤©ç§ææ£æµä¸å¿æ ·åç»è®°è¡¨","å§æåä½"}) |
| | | private String company; |
| | | |
| | | @ValueTableShow(value = 9, name = "å§æäºº") |
| | | @ExcelProperty(value ={"ä¸å¤©ç§ææ£æµä¸å¿æ ·åç»è®°è¡¨","å§æäºº"}) |
| | | private String name; |
| | | |
| | | @ExcelProperty(value ={"ä¸å¤©ç§ææ£æµä¸å¿æ ·åç»è®°è¡¨","ç产åä½"}) |
| | | private String production; |
| | | |
| | | @ExcelProperty(value ={"ä¸å¤©ç§ææ£æµä¸å¿æ ·åç»è®°è¡¨","å·¥ç¨åç§°"}) |
| | | private String engineering; |
| | | |
| | | @ExcelIgnore |
| | | private Integer createUser; |
| | | |
| | | @ExcelIgnore |
| | | private Integer insSampleId; |
| | | |
| | | @ExcelIgnore |
| | | private Double cost;//å·¥æ¶ |
| | | |
| | | @TableField(exist = false,select = false) |
| | | @ExcelIgnore |
| | | private String dates; |
| | | |
| | | |
| | |
| | | private Integer insFibersId; |
| | | |
| | | private Integer standardMethodListId; |
| | | |
| | | //è¿åç20度常温ç计ç®å¼(温度循ç¯) |
| | | @TableField(exist = false ,select = false) |
| | | private String complue; |
| | | } |
| | |
| | | import com.yuanchu.mom.dto.*; |
| | | import com.yuanchu.mom.pojo.InsOrder; |
| | | |
| | | import javax.servlet.ServletException; |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import java.io.IOException; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | |
| | | int updateStatus(Integer id); |
| | | |
| | | List<SampleProductDto3> labelPrinting(String ids); |
| | | |
| | | void export(CostStatisticsDto costStatisticsDto,HttpServletResponse response)throws IOException, ServletException; |
| | | } |
| | |
| | | public Map<String, Object> selectInsOrderPlanList(Page page, InsOrderPlanDTO insOrderPlanDTO) { |
| | | Map<String, Object> map = new HashMap<>(); |
| | | map.put("head", PrintChina.printChina(InsOrderPlanVO.class)); |
| | | Map<String, Integer> map1 = getLook.selectPowerByMethodAndUserId(null); |
| | | Integer userId = map1.get("userId"); |
| | | if (ObjectUtil.isNotEmpty(insOrderPlanDTO.getUserId())) { |
| | | Integer userId = null; |
| | | if (ObjectUtil.isNotEmpty(insOrderPlanDTO.getUserId()) ) { |
| | | Map<String, Integer> map1 = getLook.selectPowerByMethodAndUserId(null); |
| | | userId = map1.get("userId"); |
| | | insOrderPlanDTO.setUserId(userId.longValue()); |
| | | } |
| | | IPage<InsOrderPlanVO> insOrderPage = insSampleMapper.findInsSampleAndOrder(page, QueryWrappers.queryWrappers(insOrderPlanDTO), userId); |
| | |
| | | List<String> collect = new ArrayList<>(); |
| | | List<InsSample> insSamples = insSampleMapper.selectList(Wrappers.<InsSample>lambdaQuery().eq(InsSample::getInsOrderId, orderId).select(InsSample::getId)); |
| | | List<Integer> ids = insSamples.stream().map(a -> a.getId()).collect(Collectors.toList()); |
| | | List<InsProduct> insProducts = insProductMapper.selectList(Wrappers.<InsProduct>lambdaQuery().in(InsProduct::getInsSampleId, ids).eq(InsProduct::getSonLaboratory, laboratory).eq(InsProduct::getState, 1).eq(InsProduct::getInsResult, 0)); |
| | | List<InsProduct> insProducts = insProductMapper.selectList(Wrappers.<InsProduct>lambdaQuery() |
| | | .in(InsProduct::getInsSampleId, ids) |
| | | .eq(InsProduct::getSonLaboratory, laboratory) |
| | | .eq(InsProduct::getState, 1) |
| | | .eq(InsProduct::getInsResult, 0)); |
| | | if (insProducts.size() > 0) { |
| | | collect = insProducts.stream().map(insProduct -> { |
| | | return insProduct.getInspectionItem() + "-" + insProduct.getInspectionItemSubclass(); |
| | |
| | | if (ObjectUtils.isNotEmpty(insProductResult)) { |
| | | insProduct.setInsProductResult(insProductResult); |
| | | } |
| | | //æ±åçæ¡ä»¶ä¸1次循ç¯20度常温ç计ç®å¼ |
| | | InsProductResult insProductResult1 = insProductResultMapper.selectOne(Wrappers.<InsProductResult>lambdaQuery().eq(InsProductResult::getInsProductId,insProductMapper.selectOne(Wrappers.<InsProduct>lambdaQuery() |
| | | .eq(InsProduct::getInsSampleId,sampleId) |
| | | .eq(InsProduct::getInspectionItem, "1") |
| | | .eq(InsProduct::getInspectionItemSubclass, "20â(常温)") |
| | | .eq(InsProduct::getInspectionItemClass, insProduct.getInspectionItemClass()) |
| | | .eq(InsProduct::getInsFiberId, fiber.getId())).getId() )); |
| | | if (!insProductResult1.getComValue().equals("[]")) { |
| | | insProduct.setComplue(insProductResult1.getComValue().split(":")[1].split("\"")[1]); |
| | | } |
| | | productVo.setInsProduct(insProduct); |
| | | productVos.add(productVo); |
| | | } |
| | |
| | | productVo.setColor(fiber.getColor()); |
| | | productVo.setBushColor(fiber.getBushColor()); |
| | | insProduct.setInsProductResult(insProductResult); |
| | | //æ±åçæ¡ä»¶ä¸1次循ç¯20度常温ç计ç®å¼ |
| | | InsProductResult insProductResult1 = insProductResultMapper.selectOne(Wrappers.<InsProductResult>lambdaQuery().eq(InsProductResult::getInsProductId,insProductMapper.selectOne(Wrappers.<InsProduct>lambdaQuery() |
| | | .eq(InsProduct::getInsSampleId,sampleId) |
| | | .eq(InsProduct::getInspectionItem, "1") |
| | | .eq(InsProduct::getInspectionItemSubclass, "20â(常温)") |
| | | .eq(InsProduct::getInspectionItemClass, insProduct.getInspectionItemClass()) |
| | | .eq(InsProduct::getInsFiberId, fiber.getId())).getId() )); |
| | | if (!insProductResult1.getComValue().equals("[]")) { |
| | | insProduct.setComplue(insProductResult1.getComValue().split(":")[1].split("\"")[1]); |
| | | } |
| | | productVo.setInsProduct(insProduct); |
| | | productVos.add(productVo); |
| | | } |
| | |
| | | JSONObject insValue = JSON.parseObject(JSON.toJSONString(o)); |
| | | Map<String, Object> map = new HashMap<>(); |
| | | map.put("v", JSON.parseObject(JSON.toJSONString(insValue.get("v"))).get("v")); |
| | | map.put("r", JSON.toJSONString(insValue.get("r"))); |
| | | map.put("c", JSON.toJSONString(insValue.get("c"))); |
| | | try { |
| | | if ((insValue.get("u") == null || insValue.get("u").equals("")) && StrUtil.isNotEmpty(JSON.parseObject(JSON.toJSONString(insValue.get("v"))).get("v").toString())) { |
| | | map.put("u", userId + ""); |
| | |
| | | map2.put(product.getTemplateId(), standardTemplateService.getStandTempThingById(product.getTemplateId()) + ""); |
| | | thing = map2.get(product.getTemplateId()); |
| | | } |
| | | // thing = map2.get(product.getTemplateId()); |
| | | if (StrUtil.isNotEmpty(thing)) { |
| | | JSONObject sheet = JSON.parseObject(JSON.toJSONString(JSON.parseArray(JSON.toJSONString(JSON.parseObject(thing).get("data"))).get(0))); |
| | | JSONObject config = JSON.parseObject(JSON.toJSONString(sheet.get("config"))); |
| | |
| | | public int submitPlan(Integer orderId, String laboratory, Integer verifyUser) { |
| | | List<InsSample> insSamples = insSampleMapper.selectList(Wrappers.<InsSample>lambdaQuery().eq(InsSample::getInsOrderId, orderId).select(InsSample::getId)); |
| | | List<Integer> ids = insSamples.stream().map(a -> a.getId()).collect(Collectors.toList()); |
| | | List<InsProduct> insProducts = insProductMapper.selectList(Wrappers.<InsProduct>lambdaQuery().in(InsProduct::getInsSampleId, ids).eq(InsProduct::getSonLaboratory, laboratory).eq(InsProduct::getState, 1).isNull(InsProduct::getInsResult).isNull(InsProduct::getInsFiberId).isNull(InsProduct::getInsFibersId)); |
| | | List<InsProduct> insProducts = insProductMapper.selectList(Wrappers.<InsProduct>lambdaQuery() |
| | | .in(InsProduct::getInsSampleId, ids) |
| | | .eq(InsProduct::getSonLaboratory, laboratory) |
| | | .eq(InsProduct::getState, 1) |
| | | .isNull(InsProduct::getInsResult) |
| | | .isNull(InsProduct::getInsFiberId) |
| | | .isNull(InsProduct::getInsFibersId)); |
| | | insProducts.addAll(insProductMapper.selectFiberInsProduct(ids, laboratory)); |
| | | if (insProducts.size() > 0) { |
| | | String str = ""; |
| | |
| | | |
| | | import cn.hutool.core.util.ObjectUtil; |
| | | import cn.hutool.core.util.StrUtil; |
| | | import com.alibaba.excel.EasyExcel; |
| | | import com.alibaba.excel.ExcelWriter; |
| | | import com.alibaba.excel.write.metadata.WriteSheet; |
| | | import com.alibaba.excel.write.style.column.LongestMatchColumnWidthStyleStrategy; |
| | | import com.alibaba.fastjson.JSON; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.core.toolkit.ObjectUtils; |
| | |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | |
| | | import javax.servlet.ServletException; |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import java.io.IOException; |
| | | import java.net.URLEncoder; |
| | | import java.time.LocalDate; |
| | | import java.time.LocalDateTime; |
| | | import java.time.format.DateTimeFormatter; |
| | |
| | | Integer roleId = user.getRoleId(); |
| | | //è·åå½å人æå±å®éªå®¤id |
| | | String departLimsId = user.getDepartLimsId(); |
| | | String laboratory=null; |
| | | if (ObjectUtils.isNotEmpty(departLimsId) && !departLimsId.equals("")){ |
| | | String laboratory = null; |
| | | if (ObjectUtils.isNotEmpty(departLimsId) && !departLimsId.equals("")) { |
| | | String[] split = departLimsId.split(","); |
| | | //æ¥è¯¢å¯¹åºæ¶æåç§°(éä¿¡å®éªå®¤,çµåå®éªå®¤,æ£æµå) |
| | | String departLims=baseMapper.seldepLimsId(Integer.parseInt(split[split.length - 1])); |
| | | if (departLims.contains("å®éªå®¤")){ |
| | | laboratory=departLims; |
| | | //æ¥è¯¢å¯¹åºæ¶æåç§°(éä¿¡å®éªå®¤,çµåå®éªå®¤,æ£æµå) |
| | | String departLims = baseMapper.seldepLimsId(Integer.parseInt(split[split.length - 1])); |
| | | if (departLims.contains("å®éªå®¤")) { |
| | | laboratory = departLims; |
| | | } |
| | | } |
| | | //夿æ¯å¦æ¯å
¨é¨æé |
| | |
| | | } |
| | | } |
| | | } |
| | | map.put("body", insOrderMapper.selectInsOrderPage(page, QueryWrappers.queryWrappers(sampleOrderDto),laboratory)); |
| | | map.put("body", insOrderMapper.selectInsOrderPage(page, QueryWrappers.queryWrappers(sampleOrderDto), laboratory)); |
| | | return map; |
| | | } |
| | | |
| | |
| | | //夿ç循ç¯é¡¹ç®çæ·»å 忏©åè¯éªé¡¹ç®çæ·»å |
| | | else if (product.getInspectionItem().equals("ç循ç¯") || product.getInspectionItem().equals("温åè¯éª")) { |
| | | List<InsProduct> insProductess = new ArrayList<>(); |
| | | product.setId(null); |
| | | product.setInsSampleId(sampleId); |
| | | insProductess.add(product); |
| | | List<InsProduct> insProductes = new ArrayList<>(); |
| | | List<InsProduct> insProducts = new ArrayList<>(); |
| | |
| | | insProduct.setInspectionItemType("0"); |
| | | insProduct.setInspectionValueType("1"); |
| | | insProducts.add(insProduct); |
| | | insProductes.add(insProduct); |
| | | insProductess.add(insProduct); |
| | | } |
| | | //çå¾ªç¯ææå¤æ¬¡å¾ªç¯æ¬¡æ° |
| | | if (product.getInspectionItem().equals("ç循ç¯")) { |
| | |
| | | insProductess.add(insProduct1); |
| | | } |
| | | } |
| | | if (count > 1) { |
| | | //循ç¯è¶
è¿1次 |
| | | for (int j = 2; j <= count; j++) { |
| | | for (InsProduct insProduct : insProductes) { |
| | | InsProduct insProduct1 = new InsProduct(); |
| | | BeanUtils.copyProperties(insProduct, insProduct1); |
| | | insProduct1.setInspectionItem(j + "");//å¾ªç¯æ¬¡æ° |
| | | insProductess.add(insProduct1); |
| | | } |
| | | if (count > 1) { |
| | | //循ç¯è¶
è¿1次 |
| | | for (int j = 2; j <= count; j++) { |
| | | for (InsProduct insProduct : insProductes) { |
| | | InsProduct insProduct1 = new InsProduct(); |
| | | BeanUtils.copyProperties(insProduct, insProduct1); |
| | | insProduct1.setInspectionItem(j + "");//å¾ªç¯æ¬¡æ° |
| | | insProductess.add(insProduct1); |
| | | } |
| | | } |
| | | } |
| | | insProductService.saveBatch(insProductess); |
| | | } |
| | | else { |
| | | } else { |
| | | if (!is) { |
| | | switch (type) { |
| | | case 1: |
| | |
| | | map.put("head", PrintChina.printChina(CostStatisticsDto.class)); |
| | | Map<String, Integer> map1 = getLook.selectPowerByMethodAndUserId("costStatistics"); |
| | | if (map1.get("look") == 1) costStatisticsDto.setCreateUser(map1.get("userId")); |
| | | IPage<CostStatisticsDto> costStatisticsDtoIPage = insOrderMapper.selectCostStatistics(page, QueryWrappers.queryWrappers(costStatisticsDto).ge("create_time", split[0]).le("create_time", split[1] + " 23:59:59")); |
| | | List<CostStatisticsDto> costStatisticsDtoList = costStatisticsDtoIPage.getRecords(); |
| | | for (CostStatisticsDto statisticsDto : costStatisticsDtoList) { |
| | | statisticsDto.setNum(1); |
| | | } |
| | | List<CostStatisticsDto> costStatisticsDtoList1 = deduplicateAndSumCounts(costStatisticsDtoList); |
| | | costStatisticsDtoIPage.setRecords(costStatisticsDtoList1); |
| | | map.put("body", costStatisticsDtoIPage); |
| | | return map; |
| | | } |
| | | private static List<CostStatisticsDto> deduplicateAndSumCounts(List<CostStatisticsDto> list) { |
| | | // 使ç¨ä¸ä¸ª Map æ¥åæ¾å·²ç»åºç°è¿ç inspectionItem + entrustCode + sample çç»å |
| | | Map<String, CostStatisticsDto> map = new HashMap<>(); |
| | | // éåå表è¿è¡å»éåè®¡æ° |
| | | for (CostStatisticsDto dto : list) { |
| | | String key = dto.getInspectionItem() + dto.getEntrustCode() + dto.getSample(); |
| | | if (map.containsKey(key)) { |
| | | // 妿已ç»åå¨ï¼åç´¯å æ°é |
| | | CostStatisticsDto existingDto = map.get(key); |
| | | existingDto.setNum(existingDto.getNum() + dto.getNum()); |
| | | existingDto.setPrice(existingDto.getPrice().add(dto.getPrice())); |
| | | IPage<CostStatisticsDto> dtoIPage = insOrderMapper.selectCostStatistics(page, QueryWrappers.queryWrappers(costStatisticsDto).ge("create_time", split[0]).le("create_time", split[1] + " 23:59:59")); |
| | | List<CostStatisticsDto> collect = dtoIPage.getRecords().stream().map(dto -> { |
| | | Set<String> uniqueTags = new HashSet<>(); |
| | | if (dto.getInspectionItem().contains(",")) { |
| | | for (String s : dto.getInspectionItem().split(",")) { |
| | | uniqueTags.add(s.split("@")[0]); |
| | | } |
| | | } else { |
| | | // 妿ä¸åå¨ï¼åæ¾å
¥ Map ä¸ |
| | | map.put(key, dto); |
| | | uniqueTags.add(dto.getInspectionItem().split("@")[0]); |
| | | } |
| | | } |
| | | // å° Map ä¸çå¼è½¬ä¸º List è¿å |
| | | return new ArrayList<>(map.values()); |
| | | dto.setInspectionItem(uniqueTags.toString()); |
| | | return dto; |
| | | }).collect(Collectors.toList()); |
| | | dtoIPage.setRecords(collect); |
| | | map.put("body", dtoIPage); |
| | | return map; |
| | | } |
| | | |
| | | @Override |
| | |
| | | costStatisticsDto.setDates(null); |
| | | List<CostStatisticsDto> costStatisticsDtos = insOrderMapper.selectCostStatistics2(QueryWrappers.queryWrappers(costStatisticsDto).ge("create_time", split[0]).le("create_time", split[1] + " 23:59:59")); |
| | | double totalPrice = costStatisticsDtos.stream() |
| | | .filter(distinctByKey(dto -> Arrays.asList(dto.getEntrustCode(), dto.getSample(), dto.getCost()))) |
| | | .filter(dto -> dto.getPrice() != null) // è¿æ»¤æä»·æ ¼ä¸º null ç对象 |
| | | .mapToDouble(value -> value.getPrice().doubleValue()) |
| | | .mapToDouble(value -> value.getPrice().doubleValue() * value.getNum()) |
| | | .sum(); |
| | | map.put("total", totalPrice); |
| | | return map; |
| | | } |
| | | public static <T> Predicate<T> distinctByKey(Function<? super T, ?> keyExtractor) { |
| | | Map<Object, Boolean> seen = new ConcurrentHashMap<>(); |
| | | return t -> seen.putIfAbsent(keyExtractor.apply(t), Boolean.TRUE) == null; |
| | | } |
| | | |
| | | @Override |
| | |
| | | }).collect(Collectors.toList()); |
| | | return sampleProductDto3s; |
| | | } |
| | | |
| | | @Override |
| | | public void export(CostStatisticsDto costStatisticsDto,HttpServletResponse response) throws IOException { |
| | | //æ¥è¯¢å¯¼åºçè´¹ç¨ç»è®¡æ°æ® |
| | | String dates = costStatisticsDto.getDates(); |
| | | String[] split = dates.replaceAll("\\[", "").replaceAll("]", "").replaceAll("\"", "").split(","); |
| | | costStatisticsDto.setDates(null); |
| | | List<CostStatisticsDto> costStatisticsDtos = insOrderMapper.selectCostStatistics2(QueryWrappers.queryWrappers(costStatisticsDto).ge("create_time", split[0]).le("create_time", split[1] + " 23:59:59")); |
| | | costStatisticsDtos = costStatisticsDtos.stream().map(dto -> { |
| | | Set<String> uniqueTags = new HashSet<>(); |
| | | if (dto.getInspectionItem().contains(",")) { |
| | | for (String s : dto.getInspectionItem().split(",")) { |
| | | uniqueTags.add(s.split("@")[0]); |
| | | } |
| | | } else { |
| | | uniqueTags.add(dto.getInspectionItem().split("@")[0]); |
| | | } |
| | | dto.setInspectionItem(uniqueTags.toString()); |
| | | return dto; |
| | | }).collect(Collectors.toList()); |
| | | |
| | | response.setContentType("application/vnd.ms-excel"); |
| | | response.setCharacterEncoding("UTF-8"); |
| | | // è¿éURLEncoder.encodeå¯ä»¥é²æ¢ä¸æä¹±ç å½ç¶åeasyexcel没æå
³ç³» |
| | | String fileName = URLEncoder.encode("æ ·åè´¹ç¨ç»è®¡å¯¼åº", "UTF-8"); |
| | | response.setHeader("Content-disposition", "attachment;filename=" + fileName + ".xlsx"); |
| | | try { |
| | | // æ°å»ºExcelWriter |
| | | ExcelWriter excelWriter = EasyExcel.write(response.getOutputStream()).registerWriteHandler(new LongestMatchColumnWidthStyleStrategy()).build(); |
| | | |
| | | WriteSheet mainSheet = EasyExcel.writerSheet( "æ ·åè´¹ç¨ç»è®¡å¯¼åº").head(CostStatisticsDto.class).build(); |
| | | excelWriter.write(costStatisticsDtos, mainSheet); |
| | | |
| | | // å
³éæµ |
| | | excelWriter.finish(); |
| | | } catch (IOException e) { |
| | | throw new RuntimeException("导åºå¤±è´¥"); |
| | | } |
| | | } |
| | | } |
| | | |
| | | |
| | |
| | | @ValueTableShow(value = 5,name = "ç¶æ") |
| | | private String insState; |
| | | |
| | | @ValueTableShow(value = 5,name = "è´è´£äºº") |
| | | private String userName; |
| | | |
| | | private Integer userId; |
| | | |
| | | @ValueTableShow(value = 8,name = "æ£éªå¼å§æ¶é´") |
| | | private String insTime; |
| | | |
| | |
| | | @ValueTableShow(value = 8,name = "çç±") |
| | | private String verifyTell; |
| | | |
| | | private Integer userId; |
| | | |
| | | private String sonLaboratory; |
| | | |
| | |
| | | </select> |
| | | <select id="selectCostStatistics" resultType="com.yuanchu.mom.dto.CostStatisticsDto"> |
| | | select * from ( |
| | | SELECT |
| | | <!--SELECT |
| | | i.id, |
| | | i.entrust_code, |
| | | i.create_time, |
| | |
| | | SEPARATOR ',') inspection_item2 from ins_product where state = 1 GROUP BY ins_sample_id,man_hour_group) b GROUP |
| | | BY b.ins_sample_id) c ON c.ins_sample_id = isa.id |
| | | where (i.state = 1 or i.state = 3 or i.state = 4) |
| | | ) a |
| | | ) a--> |
| | | SELECT A.id, |
| | | A.entrust_code, |
| | | A.create_time, |
| | | A.sample, |
| | | A.model, |
| | | A.inspection_item, |
| | | A.company, |
| | | A.`name`, |
| | | COUNT(1) num, |
| | | SUM(A.price) price, |
| | | SUM(A.cost) cost |
| | | FROM |
| | | (SELECT |
| | | i.id, |
| | | i.entrust_code, |
| | | i.create_time, |
| | | isa.sample, |
| | | isa.sample_code, |
| | | isa.model, |
| | | c.price, |
| | | c.cost, |
| | | c.inspection_item, |
| | | cus.company, |
| | | u.`name`, |
| | | i.create_user, |
| | | c.ins_sample_id |
| | | FROM |
| | | ins_order i |
| | | LEFT JOIN ins_sample isa ON isa.ins_order_id = i.id |
| | | LEFT JOIN `user` u ON u.id = i.user_id |
| | | left join custom cus on cus.id = u.company |
| | | LEFT JOIN (select SUM(b.price) price, sum(b.man_hour) cost,b.ins_sample_id, |
| | | GROUP_CONCAT(b.inspection_item2 |
| | | SEPARATOR ',') |
| | | inspection_item from (select * , |
| | | GROUP_CONCAT(CONCAT(inspection_item,'@',inspection_item_subclass) SEPARATOR ',')inspection_item2 from ins_product where state = 1 and template_id IS NOT NULL GROUP BY ins_sample_id,man_hour_group) b GROUP |
| | | BY b.ins_sample_id) c ON c.ins_sample_id = isa.id |
| | | where (i.state = 1 or i.state = 3 or i.state = 4) and c.ins_sample_id IS not NULL)A |
| | | GROUP BY |
| | | A.id, |
| | | A.entrust_code, |
| | | A.create_time, |
| | | A.sample, |
| | | A.model, |
| | | A.inspection_item, |
| | | A.company, |
| | | A.`name` |
| | | ) B |
| | | <if test="ew.customSqlSegment != null and ew.customSqlSegment != ''"> |
| | | ${ew.customSqlSegment} |
| | | </if> |
| | |
| | | |
| | | <select id="selectCostStatistics2" resultType="com.yuanchu.mom.dto.CostStatisticsDto"> |
| | | select * from ( |
| | | SELECT |
| | | <!--SELECT |
| | | i.id, |
| | | i.entrust_code, |
| | | i.create_time, |
| | |
| | | SEPARATOR ',') inspection_item2 from ins_product where state = 1 GROUP BY ins_sample_id,man_hour_group) b GROUP |
| | | BY b.ins_sample_id) c ON c.ins_sample_id = isa.id |
| | | where (i.state = 1 or i.state = 3 or i.state = 4) |
| | | ) a |
| | | ) a--> |
| | | SELECT A.id, |
| | | A.entrust_code, |
| | | A.create_time, |
| | | A.sample, |
| | | A.model, |
| | | A.inspection_item, |
| | | A.company, |
| | | A.`name`, |
| | | production, |
| | | engineering, |
| | | COUNT(1) num, |
| | | SUM(A.price) price, |
| | | SUM(A.cost) cost |
| | | FROM |
| | | (SELECT |
| | | i.id, |
| | | i.entrust_code, |
| | | i.create_time, |
| | | isa.sample, |
| | | isa.sample_code, |
| | | isa.model, |
| | | c.price, |
| | | c.cost, |
| | | c.inspection_item, |
| | | cus.company, |
| | | u.`name`, |
| | | i.create_user, |
| | | c.ins_sample_id, |
| | | production, |
| | | engineering |
| | | FROM |
| | | ins_order i |
| | | LEFT JOIN ins_sample isa ON isa.ins_order_id = i.id |
| | | LEFT JOIN `user` u ON u.id = i.user_id |
| | | left join custom cus on cus.id = u.company |
| | | LEFT JOIN (select SUM(b.price) price, sum(b.man_hour) cost,b.ins_sample_id, |
| | | GROUP_CONCAT(b.inspection_item2 |
| | | SEPARATOR ',') |
| | | inspection_item from (select * , |
| | | GROUP_CONCAT(CONCAT(inspection_item,'',inspection_item_subclass) SEPARATOR ',')inspection_item2 from ins_product where state = 1 and template_id IS NOT NULL GROUP BY ins_sample_id,man_hour_group) b GROUP |
| | | BY b.ins_sample_id) c ON c.ins_sample_id = isa.id |
| | | where (i.state = 1 or i.state = 3 or i.state = 4) and c.ins_sample_id IS not NULL)A |
| | | GROUP BY |
| | | A.id, |
| | | A.entrust_code, |
| | | A.create_time, |
| | | A.sample, |
| | | A.model, |
| | | A.inspection_item, |
| | | A.company, |
| | | A.`name`, |
| | | production, |
| | | engineering |
| | | ORDER BY |
| | | A.id, |
| | | A.entrust_code, |
| | | A.create_time, |
| | | A.sample, |
| | | A.model, |
| | | A.inspection_item, |
| | | A.company, |
| | | A.`name`, |
| | | production, |
| | | engineering) B |
| | | <if test="ew.customSqlSegment != null and ew.customSqlSegment != ''"> |
| | | ${ew.customSqlSegment} |
| | | </if> |
| | |
| | | <select id="findInsSampleAndOrder" resultType="com.yuanchu.mom.vo.InsOrderPlanVO"> |
| | | select * from(select * from( |
| | | SELECT |
| | | a.*,ios.ins_state,ios.verify_tell,isu2.order_user_id,(ios.verify_user = #{userId}) verify_user |
| | | a.*,ios.ins_state,ios.verify_tell,isu2.order_user_id,<!--(ios.verify_user = #{userId})--> verify_user |
| | | FROM |
| | | ( |
| | | SELECT |
| | |
| | | io.send_time, |
| | | group_concat(distinct isa.sample,' ') sample, |
| | | isu.user_id, |
| | | user.name userName, |
| | | ip.son_laboratory, |
| | | io.ins_time |
| | | FROM |
| | | ins_order io |
| | | LEFT JOIN ins_sample isa ON isa.ins_order_id = io.id |
| | | LEFT JOIN ( SELECT * FROM ins_sample_user GROUP BY ins_sample_id, user_id ) isu ON isu.ins_sample_id = io.id |
| | | LEFT JOIN ( <!--SELECT * FROM ins_sample_user GROUP BY ins_sample_id, user_id --> |
| | | SELECT * |
| | | FROM ins_sample_user u |
| | | WHERE (ins_sample_id, id) IN ( |
| | | SELECT ins_sample_id, MAX(id) |
| | | FROM ins_sample_user |
| | | GROUP BY ins_sample_id |
| | | ) |
| | | ORDER BY ins_sample_id, id |
| | | ) isu ON isu.ins_sample_id = io.id |
| | | LEFT JOIN ins_product ip ON ip.ins_sample_id = isa.id |
| | | LEFT JOIN user ON isu.user_id = user.id |
| | | WHERE |
| | | io.state = 1 |
| | | # AND io.ins_state != 5 |
| | | and send_time is not null |
| | | and (isu.user_id = #{userId} OR isu.user_id is NULL) |
| | | <if test="userId !=null and userId!=''"> |
| | | and (isu.user_id = #{userId} OR isu.user_id is NULL ) |
| | | </if> |
| | | OR isu.user_id is NULL |
| | | |
| | | GROUP BY |
| | | ip.son_laboratory, |
| | | io.id |
| | | ) a |
| | | LEFT JOIN ins_order_state ios ON ios.ins_order_id = a.id AND ios.laboratory = a.son_laboratory |
| | | left join (SELECT td.user_id order_user_id, td.ins_sample_id FROM ins_sample_user td,(SELECT max(id) id FROM |
| | | ins_sample_user GROUP BY ins_sample_id) md where td.id = md.id and user_id = #{userId}) isu2 on |
| | | ins_sample_user GROUP BY ins_sample_id) md where td.id = md.id |
| | | <if test="userId !=null and userId!=''"> |
| | | and user_id = #{userId} OR user_id is NULL |
| | | </if> |
| | | OR user_id is NULL |
| | | ) isu2 on |
| | | isu2.ins_sample_id = a.id |
| | | ORDER BY |
| | | a.user_id DESC, |
| | | <!--a.user_id DESC,--> |
| | | a.type DESC, |
| | | a.id |
| | | ) b |
| | |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.yuanchu.mom.annotation.ValueClassify; |
| | | import com.yuanchu.mom.dto.AuxiliaryWorkingHoursDayDto; |
| | | import com.yuanchu.mom.dto.HoursDay; |
| | | import com.yuanchu.mom.pojo.AuxiliaryWorkingHours; |
| | | import com.yuanchu.mom.pojo.AuxiliaryWorkingHoursDay; |
| | | import com.yuanchu.mom.service.AuxiliaryWorkingHoursDayService; |
| | |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.time.LocalDateTime; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | |
| | | @ValueClassify("å·¥æ¶ç®¡ç") |
| | | @ApiOperation(value = "æ¹åå·¥æ¶ç»è®¡çè¾
å©å·¥æ¶") |
| | | @PostMapping("/approve") |
| | | public Result approve(@RequestBody AuxiliaryWorkingHoursDay auxiliaryWorkingHoursDay) { |
| | | return Result.success(auxiliaryWorkingHoursDayService.checkOrApprove(auxiliaryWorkingHoursDay)); |
| | | public Result approve(@RequestBody HoursDay hoursDay ) { |
| | | return Result.success(auxiliaryWorkingHoursDayService.checkOrApprove(hoursDay)); |
| | | } |
| | | |
| | | @ValueClassify("å·¥æ¶ç®¡ç") |
| | | @ApiOperation(value = "å®¡æ ¸å·¥æ¶ç»è®¡çè¾
å©å·¥æ¶") |
| | | @PostMapping("/check") |
| | | public Result check(@RequestBody AuxiliaryWorkingHoursDay auxiliaryWorkingHoursDay ) { |
| | | return Result.success(auxiliaryWorkingHoursDayService.checkOrApprove(auxiliaryWorkingHoursDay)); |
| | | public Result check(@RequestBody HoursDay hoursDay ) { |
| | | return Result.success(auxiliaryWorkingHoursDayService.checkOrApprove(hoursDay)); |
| | | } |
| | | |
| | | @ValueClassify("å·¥æ¶ç®¡ç") |
| | |
| | | import com.yuanchu.mom.annotation.ValueTableShow; |
| | | import com.yuanchu.mom.pojo.AuxiliaryCorrectionHours; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Builder; |
| | | import lombok.Data; |
| | | |
| | | import java.text.DecimalFormat; |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.yuanchu.mom.dto; |
| | | |
| | | import com.yuanchu.mom.pojo.AuxiliaryWorkingHoursDay; |
| | | import lombok.Data; |
| | | |
| | | import java.util.List; |
| | | |
| | | @Data |
| | | public class HoursDay { |
| | | |
| | | private List<AuxiliaryWorkingHoursDay> auxiliaryWorkingHoursDays; |
| | | } |
| | |
| | | |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.yuanchu.mom.dto.AuxiliaryWorkingHoursDayDto; |
| | | import com.yuanchu.mom.dto.HoursDay; |
| | | import com.yuanchu.mom.pojo.AuxiliaryWorkingHours; |
| | | import com.yuanchu.mom.pojo.AuxiliaryWorkingHoursDay; |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | |
| | | import java.time.LocalDateTime; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | |
| | | |
| | | AuxiliaryWorkingHoursDay selectAuxiliaryWorkingHoursByNumber(String number); |
| | | |
| | | int checkOrApprove(AuxiliaryWorkingHoursDay auxiliaryWorkingHoursDay); |
| | | boolean checkOrApprove(HoursDay hoursDay); |
| | | |
| | | int updateAuxiliaryWorkingHoursDay(AuxiliaryWorkingHoursDay auxiliaryWorkingHoursDay); |
| | | |
| | |
| | | import com.yuanchu.mom.pojo.User; |
| | | import com.yuanchu.mom.service.AuxiliaryOriginalHoursService; |
| | | import com.yuanchu.mom.utils.QueryWrappers; |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import javax.annotation.Resource; |
| | |
| | | import java.io.IOException; |
| | | import java.net.URLEncoder; |
| | | import java.text.DecimalFormat; |
| | | import java.util.ArrayList; |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import java.util.*; |
| | | import java.util.stream.Collectors; |
| | | |
| | | @Service |
| | |
| | | originalHoursDtoIPage.setSize(page.getSize()); |
| | | originalHoursDtoIPage.setCurrent(page.getCurrent()); |
| | | List<AuxiliaryOriginalHoursDto> auxiliaryOriginalHoursDtos = new ArrayList<>(); |
| | | Map<String, AuxiliaryOriginalHoursDto> data1 = new HashMap<>(); |
| | | Map<String, AuxiliaryOriginalHoursDto> data2 = new HashMap<>(); |
| | | //产éå·¥æ¶ |
| | | List<Map<String, Object>> maps = auxiliaryOutputWorkingHoursMapper.totalHours(auxiliaryOriginalHoursLookDto.getMonth(), ids); |
| | | if (ObjectUtils.isNotEmpty(maps)) { |
| | | auxiliaryOriginalHoursDtos.addAll(getData(maps, "产éå·¥æ¶").values()); |
| | | data1 = getData(maps, "产éå·¥æ¶"); |
| | | auxiliaryOriginalHoursDtos.addAll(data1.values()); |
| | | } |
| | | //è¾
å©å·¥æ¶ |
| | | List<Map<String, Object>> maps1 = auxiliaryWorkingHoursDayMapper.totalHours(auxiliaryOriginalHoursLookDto.getMonth(), ids); |
| | | if (ObjectUtils.isNotEmpty(maps1)) { |
| | | auxiliaryOriginalHoursDtos.addAll(getData(maps1, "è¾
å©å·¥æ¶").values()); |
| | | data2 = getData(maps1, "è¾
å©å·¥æ¶"); |
| | | auxiliaryOriginalHoursDtos.addAll(data2.values()); |
| | | } |
| | | //å çå·¥æ¶ |
| | | //æ»å·¥æ¶ |
| | | List<Map<String, Object>> maps2 = auxiliaryOriginalHoursMapper.totalHours(auxiliaryOriginalHoursLookDto.getMonth(), ids); |
| | | //æ»å·¥æ¶=产éå·¥æ¶+è¾
å©å·¥æ¶+å çå·¥æ¶ |
| | | Map<String, AuxiliaryOriginalHoursDto> data4 = new HashMap<String, AuxiliaryOriginalHoursDto>(); |
| | | Map<String, AuxiliaryOriginalHoursDto> data3 = data1; |
| | | if (data1.size()>0) { |
| | | if (data2.size() > 0) { |
| | | for (Map.Entry<String, AuxiliaryOriginalHoursDto> entry : data2.entrySet()) { |
| | | String key = entry.getKey(); |
| | | AuxiliaryOriginalHoursDto value = entry.getValue(); |
| | | if (data3.containsKey(key)) { |
| | | for (Map.Entry<String, AuxiliaryOriginalHoursDto> dtoEntry : data3.entrySet()) { |
| | | if (dtoEntry.getKey().equals(key)) { |
| | | AuxiliaryOriginalHoursDto auxiliaryOriginalHoursDto = new AuxiliaryOriginalHoursDto(); |
| | | AuxiliaryOriginalHoursDto hoursDto = data3.get(key); |
| | | BeanUtils.copyProperties(hoursDto, auxiliaryOriginalHoursDto); |
| | | auxiliaryOriginalHoursDto.setType("æ»å·¥æ¶"); |
| | | auxiliaryOriginalHoursDto.setOneHours((ObjectUtils.isNotEmpty(auxiliaryOriginalHoursDto.getOneHours()) ? auxiliaryOriginalHoursDto.getOneHours() : 0) + (ObjectUtils.isNotEmpty(value.getOneHours()) ? value.getOneHours() : 0)); |
| | | auxiliaryOriginalHoursDto.setTwoHours((ObjectUtils.isNotEmpty(auxiliaryOriginalHoursDto.getTwoHours()) ? auxiliaryOriginalHoursDto.getTwoHours() : 0) + (ObjectUtils.isNotEmpty(value.getTwoHours()) ? value.getTwoHours() : 0)); |
| | | auxiliaryOriginalHoursDto.setThreeHours((ObjectUtils.isNotEmpty(auxiliaryOriginalHoursDto.getThreeHours()) ? auxiliaryOriginalHoursDto.getThreeHours() : 0) + (ObjectUtils.isNotEmpty(value.getThreeHours()) ? value.getThreeHours() : 0)); |
| | | auxiliaryOriginalHoursDto.setFourHours((ObjectUtils.isNotEmpty(auxiliaryOriginalHoursDto.getFourHours()) ? auxiliaryOriginalHoursDto.getFourHours() : 0) + (ObjectUtils.isNotEmpty(value.getFourHours()) ? value.getFourHours() : 0)); |
| | | auxiliaryOriginalHoursDto.setFiveHours((ObjectUtils.isNotEmpty(auxiliaryOriginalHoursDto.getFiveHours()) ? auxiliaryOriginalHoursDto.getFiveHours() : 0) + (ObjectUtils.isNotEmpty(value.getFiveHours()) ? value.getFiveHours() : 0)); |
| | | auxiliaryOriginalHoursDto.setSixHours((ObjectUtils.isNotEmpty(auxiliaryOriginalHoursDto.getSixHours()) ? auxiliaryOriginalHoursDto.getSixHours() : 0) + (ObjectUtils.isNotEmpty(value.getSixHours()) ? value.getSixHours() : 0)); |
| | | auxiliaryOriginalHoursDto.setSevenHours((ObjectUtils.isNotEmpty(auxiliaryOriginalHoursDto.getSevenHours()) ? auxiliaryOriginalHoursDto.getSevenHours() : 0) + (ObjectUtils.isNotEmpty(value.getSevenHours()) ? value.getSevenHours() : 0)); |
| | | auxiliaryOriginalHoursDto.setEightHours((ObjectUtils.isNotEmpty(auxiliaryOriginalHoursDto.getEightHours()) ? auxiliaryOriginalHoursDto.getEightHours() : 0) + (ObjectUtils.isNotEmpty(value.getEightHours()) ? value.getEightHours() : 0)); |
| | | auxiliaryOriginalHoursDto.setNineHours((ObjectUtils.isNotEmpty(auxiliaryOriginalHoursDto.getNineHours()) ? auxiliaryOriginalHoursDto.getNineHours() : 0) + (ObjectUtils.isNotEmpty(value.getNineHours()) ? value.getNineHours() : 0)); |
| | | auxiliaryOriginalHoursDto.setTenHours((ObjectUtils.isNotEmpty(auxiliaryOriginalHoursDto.getTenHours()) ? auxiliaryOriginalHoursDto.getTenHours() : 0) + (ObjectUtils.isNotEmpty(value.getTenHours()) ? value.getTenHours() : 0)); |
| | | auxiliaryOriginalHoursDto.setElevenHours((ObjectUtils.isNotEmpty(auxiliaryOriginalHoursDto.getElevenHours()) ? auxiliaryOriginalHoursDto.getElevenHours() : 0) + (ObjectUtils.isNotEmpty(value.getElevenHours()) ? value.getElevenHours() : 0)); |
| | | auxiliaryOriginalHoursDto.setTwelveHours((ObjectUtils.isNotEmpty(auxiliaryOriginalHoursDto.getTwelveHours()) ? auxiliaryOriginalHoursDto.getTwelveHours() : 0) + (ObjectUtils.isNotEmpty(value.getTwelveHours()) ? value.getTwelveHours() : 0)); |
| | | auxiliaryOriginalHoursDto.setThirteenHours((ObjectUtils.isNotEmpty(auxiliaryOriginalHoursDto.getThirteenHours()) ? auxiliaryOriginalHoursDto.getThirteenHours() : 0) + (ObjectUtils.isNotEmpty(value.getThirteenHours()) ? value.getThirteenHours() : 0)); |
| | | auxiliaryOriginalHoursDto.setFourteenHours((ObjectUtils.isNotEmpty(auxiliaryOriginalHoursDto.getFourteenHours()) ? auxiliaryOriginalHoursDto.getFourteenHours() : 0) + (ObjectUtils.isNotEmpty(value.getFourteenHours()) ? value.getFourteenHours() : 0)); |
| | | auxiliaryOriginalHoursDto.setFifteenHours((ObjectUtils.isNotEmpty(auxiliaryOriginalHoursDto.getFifteenHours()) ? auxiliaryOriginalHoursDto.getFifteenHours() : 0) + (ObjectUtils.isNotEmpty(value.getFifteenHours()) ? value.getFifteenHours() : 0)); |
| | | auxiliaryOriginalHoursDto.setSixteenHours((ObjectUtils.isNotEmpty(auxiliaryOriginalHoursDto.getSixteenHours()) ? auxiliaryOriginalHoursDto.getSixteenHours() : 0) + (ObjectUtils.isNotEmpty(value.getSixteenHours()) ? value.getSixteenHours() : 0)); |
| | | auxiliaryOriginalHoursDto.setSeventeenHours((ObjectUtils.isNotEmpty(auxiliaryOriginalHoursDto.getSeventeenHours()) ? auxiliaryOriginalHoursDto.getSeventeenHours() : 0) + (ObjectUtils.isNotEmpty(value.getSeventeenHours()) ? value.getSeventeenHours() : 0)); |
| | | auxiliaryOriginalHoursDto.setEighteenHours((ObjectUtils.isNotEmpty(auxiliaryOriginalHoursDto.getEighteenHours()) ? auxiliaryOriginalHoursDto.getEighteenHours() : 0) + (ObjectUtils.isNotEmpty(value.getEighteenHours()) ? value.getEighteenHours() : 0)); |
| | | auxiliaryOriginalHoursDto.setNineteenHours((ObjectUtils.isNotEmpty(auxiliaryOriginalHoursDto.getNineteenHours()) ? auxiliaryOriginalHoursDto.getNineteenHours() : 0) + (ObjectUtils.isNotEmpty(value.getNineteenHours()) ? value.getNineteenHours() : 0)); |
| | | auxiliaryOriginalHoursDto.setTwelveHours((ObjectUtils.isNotEmpty(auxiliaryOriginalHoursDto.getTwelveHours()) ? auxiliaryOriginalHoursDto.getTwelveHours() : 0) + (ObjectUtils.isNotEmpty(value.getTwelveHours()) ? value.getTwelveHours() : 0)); |
| | | auxiliaryOriginalHoursDto.setTwentyOneHours((ObjectUtils.isNotEmpty(auxiliaryOriginalHoursDto.getTwentyOneHours()) ? auxiliaryOriginalHoursDto.getTwentyOneHours() : 0) + (ObjectUtils.isNotEmpty(value.getTwentyOneHours()) ? value.getTwentyOneHours() : 0)); |
| | | auxiliaryOriginalHoursDto.setTwentyTwoHours((ObjectUtils.isNotEmpty(auxiliaryOriginalHoursDto.getTwentyTwoHours()) ? auxiliaryOriginalHoursDto.getTwentyTwoHours() : 0) + (ObjectUtils.isNotEmpty(value.getTwentyTwoHours()) ? value.getTwentyTwoHours() : 0)); |
| | | auxiliaryOriginalHoursDto.setTwentyThreeHours((ObjectUtils.isNotEmpty(auxiliaryOriginalHoursDto.getTwentyThreeHours()) ? auxiliaryOriginalHoursDto.getTwentyThreeHours() : 0) + (ObjectUtils.isNotEmpty(value.getTwentyThreeHours()) ? value.getTwentyThreeHours() : 0)); |
| | | auxiliaryOriginalHoursDto.setTwentyFourHours((ObjectUtils.isNotEmpty(auxiliaryOriginalHoursDto.getTwentyFourHours()) ? auxiliaryOriginalHoursDto.getTwentyFourHours() : 0) + (ObjectUtils.isNotEmpty(value.getTwentyFourHours()) ? value.getTwentyFourHours() : 0)); |
| | | auxiliaryOriginalHoursDto.setTwentyFiveHours((ObjectUtils.isNotEmpty(auxiliaryOriginalHoursDto.getTwentyFiveHours()) ? auxiliaryOriginalHoursDto.getTwentyFiveHours() : 0) + (ObjectUtils.isNotEmpty(value.getTwentyFiveHours()) ? value.getTwentyFiveHours() : 0)); |
| | | auxiliaryOriginalHoursDto.setTwentySixHours((ObjectUtils.isNotEmpty(auxiliaryOriginalHoursDto.getTwentySixHours()) ? auxiliaryOriginalHoursDto.getTwentySixHours() : 0) + (ObjectUtils.isNotEmpty(value.getTwentySixHours()) ? value.getTwentySixHours() : 0)); |
| | | auxiliaryOriginalHoursDto.setTwentySevenHours((ObjectUtils.isNotEmpty(auxiliaryOriginalHoursDto.getTwentySevenHours()) ? auxiliaryOriginalHoursDto.getTwentySevenHours() : 0) + (ObjectUtils.isNotEmpty(value.getTwentySevenHours()) ? value.getTwentySevenHours() : 0)); |
| | | auxiliaryOriginalHoursDto.setTwentyEightHours((ObjectUtils.isNotEmpty(auxiliaryOriginalHoursDto.getTwentyEightHours()) ? auxiliaryOriginalHoursDto.getTwentyEightHours() : 0) + (ObjectUtils.isNotEmpty(value.getTwentyEightHours()) ? value.getTwentyEightHours() : 0)); |
| | | auxiliaryOriginalHoursDto.setTwentyNineHours((ObjectUtils.isNotEmpty(auxiliaryOriginalHoursDto.getTwentyNineHours()) ? auxiliaryOriginalHoursDto.getTwentyNineHours() : 0) + (ObjectUtils.isNotEmpty(value.getTwentyNineHours()) ? value.getTwentyNineHours() : 0)); |
| | | auxiliaryOriginalHoursDto.setThirtyHours((ObjectUtils.isNotEmpty(auxiliaryOriginalHoursDto.getThirtyHours()) ? auxiliaryOriginalHoursDto.getThirtyHours() : 0) + (ObjectUtils.isNotEmpty(value.getThirtyHours()) ? value.getThirtyHours() : 0)); |
| | | auxiliaryOriginalHoursDto.setThirtyOneHours((ObjectUtils.isNotEmpty(auxiliaryOriginalHoursDto.getThirtyOneHours()) ? auxiliaryOriginalHoursDto.getThirtyOneHours() : 0) + (ObjectUtils.isNotEmpty(value.getThirtyOneHours()) ? value.getThirtyOneHours() : 0)); |
| | | auxiliaryOriginalHoursDto.setTotal((ObjectUtils.isNotEmpty(auxiliaryOriginalHoursDto.getTotal()) ? auxiliaryOriginalHoursDto.getTotal() : 0) + (ObjectUtils.isNotEmpty(value.getTotal()) ? value.getTotal() : 0)); |
| | | data4.put(key, auxiliaryOriginalHoursDto); |
| | | } else { |
| | | AuxiliaryOriginalHoursDto hoursDto = data3.get(dtoEntry.getKey()); |
| | | AuxiliaryOriginalHoursDto dto = new AuxiliaryOriginalHoursDto(); |
| | | BeanUtils.copyProperties(hoursDto, dto); |
| | | dto.setType("æ»å·¥æ¶"); |
| | | data4.put(dtoEntry.getKey(), dto); |
| | | } |
| | | } |
| | | } else { |
| | | value.setType("æ»å·¥æ¶"); |
| | | data4.put(key, value); |
| | | } |
| | | } |
| | | } |
| | | else { |
| | | for (Map.Entry<String, AuxiliaryOriginalHoursDto> entry : data3.entrySet()) { |
| | | AuxiliaryOriginalHoursDto dto = entry.getValue(); |
| | | AuxiliaryOriginalHoursDto originalHoursDto = new AuxiliaryOriginalHoursDto(); |
| | | BeanUtils.copyProperties(dto, originalHoursDto); |
| | | originalHoursDto.setType("æ»å·¥æ¶"); |
| | | data4.put(entry.getKey(), originalHoursDto); |
| | | } |
| | | } |
| | | auxiliaryOriginalHoursDtos.addAll(data4.values()); |
| | | } |
| | | /*List<Map<String, Object>> maps2 = auxiliaryOriginalHoursMapper.totalHours(auxiliaryOriginalHoursLookDto.getMonth(), ids); |
| | | if (ObjectUtils.isNotEmpty(maps2)) { |
| | | //产éå·¥æ¶+è¾
å©å·¥æ¶é½ä¸ä¸ºç©º |
| | | auxiliaryOriginalHoursDtos.addAll(getData(maps2, "æ»å·¥æ¶").values()); |
| | |
| | | auxiliaryOriginalHoursDtos.addAll(getData(maps1, "æ»å·¥æ¶").values()); |
| | | } else if (ObjectUtils.isNotEmpty(maps)) { |
| | | auxiliaryOriginalHoursDtos.addAll(getData(maps, "æ»å·¥æ¶").values()); |
| | | }*/ |
| | | |
| | | auxiliaryOriginalHoursDtos = auxiliaryOriginalHoursDtos.stream().sorted(Comparator.comparing(AuxiliaryOriginalHoursDto::getName)).collect(Collectors.toList()); |
| | | // æ£æ¥æ¯ä¸ªäººçå·¥æ¶ç±»åï¼è¡¥å
¨ç¼ºå°çå·¥æ¶ |
| | | Map<String, Set<String>> workHoursMap = new HashMap<>(); |
| | | String[] requiredHours = {"产éå·¥æ¶", "è¾
å©å·¥æ¶", "å çå·¥æ¶", "æ»å·¥æ¶"}; |
| | | for (AuxiliaryOriginalHoursDto dto : auxiliaryOriginalHoursDtos) { |
| | | workHoursMap.computeIfAbsent(dto.getName(), k -> new HashSet<>()).add(dto.getType()); |
| | | } |
| | | originalHoursDtoIPage.setRecords(auxiliaryOriginalHoursDtos); |
| | | List<AuxiliaryOriginalHoursDto> result = auxiliaryOriginalHoursDtos; |
| | | for (String name1 : workHoursMap.keySet()) { |
| | | Set<String> workTypes = workHoursMap.get(name1); |
| | | for (String requiredHour : requiredHours) { |
| | | if (!workTypes.contains(requiredHour)) { |
| | | AuxiliaryOriginalHoursDto auxiliaryOriginalHoursDto = new AuxiliaryOriginalHoursDto(); |
| | | auxiliaryOriginalHoursDto.setName(name1); |
| | | auxiliaryOriginalHoursDto.setAuxiliaryCorrectionHours(null); |
| | | auxiliaryOriginalHoursDto.setType(requiredHour); |
| | | auxiliaryOriginalHoursDto.setMonth(auxiliaryOriginalHoursLookDto.getMonth()); |
| | | result.add(auxiliaryOriginalHoursDto); |
| | | } |
| | | } |
| | | } |
| | | List<String> order = Arrays.asList("产éå·¥æ¶", "è¾
å©å·¥æ¶", "å çå·¥æ¶", "æ»å·¥æ¶"); |
| | | Comparator<AuxiliaryOriginalHoursDto> comparator = Comparator.comparingInt(dto -> { |
| | | String type = dto.getType(); |
| | | return order.indexOf(type) == -1 ? order.size() : order.indexOf(type); |
| | | }); |
| | | result = result.stream().sorted(Comparator.comparing(AuxiliaryOriginalHoursDto::getName).thenComparing(comparator)).collect(Collectors.toList()); |
| | | originalHoursDtoIPage.setRecords(result); |
| | | originalHoursDtoIPage.setTotal(result.size()); |
| | | map.put("body", originalHoursDtoIPage); |
| | | return map; |
| | | } |
| | |
| | | .eq(AuxiliaryCorrectionHours::getType, auxiliaryOriginalHoursDto.getType()) |
| | | .eq(AuxiliaryCorrectionHours::getMonth, auxiliaryOriginalHoursDto.getMonth())); |
| | | auxiliaryOriginalHoursDto.setAuxiliaryCorrectionHours(auxiliaryCorrectionHours); |
| | | dtoMap.put(name, auxiliaryOriginalHoursDto); |
| | | } |
| | | AuxiliaryCorrectionHours auxiliaryCorrectionHours = auxiliaryOriginalHoursDto.getAuxiliaryCorrectionHours(); |
| | | switch (objectMap.get("month").toString().substring(8, 10)) { |
| | |
| | | ); |
| | | DecimalFormat df = new DecimalFormat("#.####"); // 设å®åä½å°æ° |
| | | auxiliaryOriginalHoursDto.setTotal(Double.parseDouble(df.format(auxiliaryOriginalHoursDto.getTotal()))); |
| | | |
| | | dtoMap.put(name, auxiliaryOriginalHoursDto); |
| | | } |
| | | return dtoMap; |
| | | } |
| | |
| | | import com.alibaba.excel.write.metadata.WriteSheet; |
| | | import com.alibaba.excel.write.style.column.LongestMatchColumnWidthStyleStrategy; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.core.toolkit.ObjectUtils; |
| | | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | |
| | | if (ObjectUtils.isNotEmpty(dates) && ObjectUtils.isNotEmpty(week)) { |
| | | String[] split = dates.replaceAll("\\[", "").replaceAll("]", "").replaceAll("\"", "").split(","); |
| | | String[] weeks = week.replaceAll("\\[", "").replaceAll("]", "").replaceAll("\"", "").split(","); |
| | | map.put("body", auxiliaryOutputWorkingHoursMapper.selectAuxiliaryOutputWorkingHours(page, |
| | | IPage<AuxiliaryOutputWorkingHoursDto> auxiliaryOutputWorkingHoursDtoIPage = auxiliaryOutputWorkingHoursMapper.selectAuxiliaryOutputWorkingHours(page, |
| | | QueryWrappers.queryWrappers(auxiliaryOutputWorkingHoursDto) |
| | | .ge("date_time", split[0]).le("date_time", split[1] + " 23:59:59") |
| | | .ge("week", weeks[0]).le("week", weeks[1]), ids)); |
| | | .ge("week", weeks[0]).le("week", weeks[1]), ids); |
| | | for (AuxiliaryOutputWorkingHoursDto record : auxiliaryOutputWorkingHoursDtoIPage.getRecords()) { |
| | | record.setDateTime(record.getDateTime().substring(0,10)); |
| | | } |
| | | map.put("body",auxiliaryOutputWorkingHoursDtoIPage ); |
| | | } else if (ObjectUtils.isNotEmpty(dates) && ObjectUtils.isEmpty(week)) { |
| | | String[] split = dates.replaceAll("\\[", "").replaceAll("]", "").replaceAll("\"", "").split(","); |
| | | map.put("body", auxiliaryOutputWorkingHoursMapper.selectAuxiliaryOutputWorkingHours(page, |
| | | IPage<AuxiliaryOutputWorkingHoursDto> auxiliaryOutputWorkingHoursDtoIPage = auxiliaryOutputWorkingHoursMapper.selectAuxiliaryOutputWorkingHours(page, |
| | | QueryWrappers.queryWrappers(auxiliaryOutputWorkingHoursDto) |
| | | .ge("date_time", split[0]).le("date_time", split[1] + " 23:59:59"), ids)); |
| | | .ge("date_time", split[0]).le("date_time", split[1] + " 23:59:59"), ids); |
| | | for (AuxiliaryOutputWorkingHoursDto record : auxiliaryOutputWorkingHoursDtoIPage.getRecords()) { |
| | | record.setDateTime(record.getDateTime().substring(0,10)); |
| | | } |
| | | map.put("body",auxiliaryOutputWorkingHoursDtoIPage ); |
| | | } else if (ObjectUtils.isEmpty(dates) && ObjectUtils.isNotEmpty(week)) { |
| | | String[] weeks = week.replaceAll("\\[", "").replaceAll("]", "").replaceAll("\"", "").split(","); |
| | | map.put("body", auxiliaryOutputWorkingHoursMapper.selectAuxiliaryOutputWorkingHours(page, |
| | | IPage<AuxiliaryOutputWorkingHoursDto> auxiliaryOutputWorkingHoursDtoIPage = auxiliaryOutputWorkingHoursMapper.selectAuxiliaryOutputWorkingHours(page, |
| | | QueryWrappers.queryWrappers(auxiliaryOutputWorkingHoursDto) |
| | | .ge("week", weeks[0]).le("week", weeks[1]), ids)); |
| | | .ge("week", weeks[0]).le("week", weeks[1]), ids); |
| | | for (AuxiliaryOutputWorkingHoursDto record : auxiliaryOutputWorkingHoursDtoIPage.getRecords()) { |
| | | record.setDateTime(record.getDateTime().substring(0,10)); |
| | | } |
| | | map.put("body", auxiliaryOutputWorkingHoursDtoIPage); |
| | | } else { |
| | | map.put("body", auxiliaryOutputWorkingHoursMapper.selectAuxiliaryOutputWorkingHours(page, QueryWrappers.queryWrappers(auxiliaryOutputWorkingHoursDto), ids)); |
| | | IPage<AuxiliaryOutputWorkingHoursDto> auxiliaryOutputWorkingHoursDtoIPage = auxiliaryOutputWorkingHoursMapper.selectAuxiliaryOutputWorkingHours(page, QueryWrappers.queryWrappers(auxiliaryOutputWorkingHoursDto), ids); |
| | | for (AuxiliaryOutputWorkingHoursDto record : auxiliaryOutputWorkingHoursDtoIPage.getRecords()) { |
| | | record.setDateTime(record.getDateTime().substring(0,10)); |
| | | } |
| | | map.put("body", auxiliaryOutputWorkingHoursDtoIPage); |
| | | } |
| | | return map; |
| | | } |
| | |
| | | public Map<String, Object> collectWorkingHours(AuxiliaryOutputWorkingHoursDto auxiliaryOutputWorkingHoursDto) { |
| | | AuxiliaryOutputWorkingHours outputWorkingHours = new AuxiliaryOutputWorkingHours(); |
| | | AuxiliaryWorkingHoursDay workingHoursDay = new AuxiliaryWorkingHoursDay(); |
| | | List<Integer> ids = new ArrayList<>(); |
| | | if (ObjectUtils.isNotEmpty(auxiliaryOutputWorkingHoursDto.getWeekDay())){ |
| | | outputWorkingHours.setWeekDay(auxiliaryOutputWorkingHoursDto.getWeekDay()); |
| | | workingHoursDay.setWeekDay(auxiliaryOutputWorkingHoursDto.getWeekDay()); |
| | | } |
| | | if (ObjectUtils.isNotEmpty(auxiliaryOutputWorkingHoursDto.getName())){ |
| | | User user = userMapper.selectOne(Wrappers.<User>lambdaQuery().eq(User::getName, auxiliaryOutputWorkingHoursDto.getName())); |
| | | outputWorkingHours.setCheck(user.getId()); |
| | | workingHoursDay.setNameUser(user.getId()); |
| | | List<User> user = userMapper.selectList(Wrappers.<User>lambdaQuery().like(User::getName, auxiliaryOutputWorkingHoursDto.getName())); |
| | | ids.addAll(user.stream().map(User::getId).collect(Collectors.toList())); |
| | | } |
| | | String dates = auxiliaryOutputWorkingHoursDto.getDateTime(); |
| | | auxiliaryOutputWorkingHoursDto.setDateTime(null); |
| | | Map<String, Object> map = new HashMap<>(); |
| | | Double sumOutputWorkTime = 0.0; |
| | | Double sumApprovedWorkingHour = 0.0; |
| | | List<Integer> ids = null; |
| | | |
| | | //夿æ¯ç»é¿è¿æ¯ç»åè¿æ¯ç®¡çå |
| | | Map<String, Integer> map1 = getLook.selectPowerByMethodAndUserId("selectAuxiliaryOutputWorkingHours"); |
| | | User user = userMapper.selectById(map1.get("userId")); |
| | |
| | | } |
| | | List<AuxiliaryOutputWorkingHours> auxiliaryOutputWorkingHours = new ArrayList<>(); |
| | | List<AuxiliaryWorkingHoursDay> auxiliaryWorkingHoursDays = new ArrayList<>(); |
| | | if (ids.size() == 0) { |
| | | ids=null; |
| | | } |
| | | if (ObjectUtils.isNotEmpty(dates)) { |
| | | String[] split = dates.replaceAll("\\[", "").replaceAll("]", "").replaceAll("\"", "").split(","); |
| | | //ç»è®¡å½åç¨æ·ç产åå·¥æ¶ |
| | |
| | | .eq("state","å·²æ¹å") |
| | | .ge("date_time", split[0]) |
| | | .le("date_time", split[1] + " 23:59:59"),ids); |
| | | } else { |
| | | }else if (ObjectUtils.isNotEmpty(auxiliaryOutputWorkingHoursDto.getWeekDay())){ |
| | | //ç»è®¡å½åç¨æ·ç产åå·¥æ¶ |
| | | auxiliaryOutputWorkingHours = auxiliaryOutputWorkingHoursMapper.selectLists(QueryWrappers.queryWrappers(outputWorkingHours),ids); |
| | | //ç»è®¡å½åç¨æ·çè¾
å©å·¥æ¶ |
| | | auxiliaryWorkingHoursDays = auxiliaryWorkingHoursDayMapper.selectLists(QueryWrappers.queryWrappers(workingHoursDay).eq("state","å·²æ¹å"),ids); |
| | | } |
| | | else { |
| | | auxiliaryOutputWorkingHours = auxiliaryOutputWorkingHoursMapper.selectListByIds(ids); |
| | | auxiliaryWorkingHoursDays = auxiliaryWorkingHoursDayMapper.selectListByIds(ids); |
| | | } |
| | |
| | | map.put("产éå·¥æ¶æ±æ»", sumOutputWorkTime); |
| | | if (ObjectUtils.isNotEmpty(auxiliaryWorkingHoursDays)) { |
| | | for (AuxiliaryWorkingHoursDay auxiliaryWorkingHoursDay : auxiliaryWorkingHoursDays) { |
| | | sumApprovedWorkingHour += auxiliaryWorkingHoursDay.getNonproductiveTime(); |
| | | sumApprovedWorkingHour += auxiliaryWorkingHoursDay.getReviewerNonproductiveTime();//夿 ¸å·¥æ¶ |
| | | } |
| | | } |
| | | map.put("è¾
å©å·¥æ¶æ±æ»", sumApprovedWorkingHour); |
| | |
| | | package com.yuanchu.mom.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.core.toolkit.ObjectUtils; |
| | | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.yuanchu.mom.common.GetLook; |
| | | import com.yuanchu.mom.common.PrintChina; |
| | | import com.yuanchu.mom.dto.AuxiliaryWorkingHoursDayDto; |
| | | import com.yuanchu.mom.dto.HoursDay; |
| | | import com.yuanchu.mom.exception.ErrorException; |
| | | import com.yuanchu.mom.mapper.*; |
| | | import com.yuanchu.mom.pojo.*; |
| | |
| | | ids.addAll(users.stream().map(User::getId).distinct().collect(Collectors.toList())); |
| | | } |
| | | } |
| | | if (ids.size()==0){ |
| | | ids=null; |
| | | if (ids.size() == 0) { |
| | | ids = null; |
| | | } |
| | | if (ObjectUtils.isNotEmpty(dates) && ObjectUtils.isNotEmpty(week)) { |
| | | String[] split = dates.replaceAll("\\[", "").replaceAll("]", "").replaceAll("\"", "").split(","); |
| | | String[] weeks = week.replaceAll("\\[", "").replaceAll("]", "").replaceAll("\"", "").split(","); |
| | | map.put("body", auxiliaryWorkingHoursDayMapper.selectAuxiliaryWorkingHoursDay(page, |
| | | IPage<AuxiliaryWorkingHoursDayDto> auxiliaryWorkingHoursDayDtoIPage = auxiliaryWorkingHoursDayMapper.selectAuxiliaryWorkingHoursDay(page, |
| | | QueryWrappers.queryWrappers(auxiliaryWorkingHoursDayDto) |
| | | .ge("date_time", split[0]).le("date_time", split[1] + " 23:59:59") |
| | | .ge("week", weeks[0]).le("week", weeks[1]), ids)); |
| | | .ge("week", weeks[0]).le("week", weeks[1]), ids); |
| | | for (AuxiliaryWorkingHoursDayDto record : auxiliaryWorkingHoursDayDtoIPage.getRecords()) { |
| | | record.setDateTime(record.getDateTime().substring(0, 10)); |
| | | } |
| | | map.put("body", auxiliaryWorkingHoursDayDtoIPage); |
| | | } else if (ObjectUtils.isNotEmpty(dates) && ObjectUtils.isEmpty(week)) { |
| | | String[] split = dates.replaceAll("\\[", "").replaceAll("]", "").replaceAll("\"", "").split(","); |
| | | map.put("body", auxiliaryWorkingHoursDayMapper.selectAuxiliaryWorkingHoursDay(page, |
| | | IPage<AuxiliaryWorkingHoursDayDto> auxiliaryWorkingHoursDayDtoIPage = auxiliaryWorkingHoursDayMapper.selectAuxiliaryWorkingHoursDay(page, |
| | | QueryWrappers.queryWrappers(auxiliaryWorkingHoursDayDto) |
| | | .ge("date_time", split[0]).le("date_time", split[1] + " 23:59:59"), ids)); |
| | | .ge("date_time", split[0]).le("date_time", split[1] + " 23:59:59"), ids); |
| | | for (AuxiliaryWorkingHoursDayDto record : auxiliaryWorkingHoursDayDtoIPage.getRecords()) { |
| | | record.setDateTime(record.getDateTime().substring(0, 10)); |
| | | } |
| | | map.put("body", auxiliaryWorkingHoursDayDtoIPage); |
| | | } else if (ObjectUtils.isEmpty(dates) && ObjectUtils.isNotEmpty(week)) { |
| | | String[] weeks = week.replaceAll("\\[", "").replaceAll("]", "").replaceAll("\"", "").split(","); |
| | | map.put("body", auxiliaryWorkingHoursDayMapper.selectAuxiliaryWorkingHoursDay(page, |
| | | IPage<AuxiliaryWorkingHoursDayDto> auxiliaryWorkingHoursDayDtoIPage = auxiliaryWorkingHoursDayMapper.selectAuxiliaryWorkingHoursDay(page, |
| | | QueryWrappers.queryWrappers(auxiliaryWorkingHoursDayDto) |
| | | .ge("week", weeks[0]).le("week", weeks[1]), ids)); |
| | | .ge("week", weeks[0]).le("week", weeks[1]), ids); |
| | | for (AuxiliaryWorkingHoursDayDto record : auxiliaryWorkingHoursDayDtoIPage.getRecords()) { |
| | | record.setDateTime(record.getDateTime().substring(0, 10)); |
| | | } |
| | | map.put("body", auxiliaryWorkingHoursDayDtoIPage); |
| | | } else { |
| | | map.put("body", auxiliaryWorkingHoursDayMapper.selectAuxiliaryWorkingHoursDay(page, QueryWrappers.queryWrappers(auxiliaryWorkingHoursDayDto), ids)); |
| | | IPage<AuxiliaryWorkingHoursDayDto> auxiliaryWorkingHoursDayDtoIPage = auxiliaryWorkingHoursDayMapper.selectAuxiliaryWorkingHoursDay(page, QueryWrappers.queryWrappers(auxiliaryWorkingHoursDayDto), ids); |
| | | for (AuxiliaryWorkingHoursDayDto record : auxiliaryWorkingHoursDayDtoIPage.getRecords()) { |
| | | record.setDateTime(record.getDateTime().substring(0, 10)); |
| | | } |
| | | map.put("body", auxiliaryWorkingHoursDayDtoIPage); |
| | | } |
| | | return map; |
| | | } |
| | |
| | | |
| | | //å®¡æ ¸/æ¹å |
| | | @Override |
| | | public int checkOrApprove(AuxiliaryWorkingHoursDay auxiliaryWorkingHoursDay) { |
| | | if (auxiliaryWorkingHoursDay.getState().equals("å·²å®¡æ ¸")) { |
| | | Integer userId = getLook.selectPowerByMethodAndUserId(null).get("userId"); |
| | | auxiliaryWorkingHoursDay.setReviewer(userMapper.selectById(userId).getName()); |
| | | public boolean checkOrApprove(HoursDay hoursDay) { |
| | | List<AuxiliaryWorkingHoursDay> auxiliaryWorkingHoursDays = hoursDay.getAuxiliaryWorkingHoursDays(); |
| | | for (AuxiliaryWorkingHoursDay auxiliaryWorkingHoursDay : auxiliaryWorkingHoursDays) { |
| | | if (auxiliaryWorkingHoursDay.getState().equals("å·²å®¡æ ¸")) { |
| | | Integer userId = getLook.selectPowerByMethodAndUserId(null).get("userId"); |
| | | auxiliaryWorkingHoursDay.setReviewer(userMapper.selectById(userId).getName()); |
| | | } |
| | | if (auxiliaryWorkingHoursDay.getReviewerNumber() == null) { |
| | | auxiliaryWorkingHoursDay.setReviewerNumber(auxiliaryWorkingHoursDay.getAmount());//夿 ¸æ°é |
| | | auxiliaryWorkingHoursDay.setReviewerNonproductiveTime(auxiliaryWorkingHoursDay.getNonproductiveTime());//夿 ¸å·¥æ¶ |
| | | } |
| | | |
| | | } |
| | | return auxiliaryWorkingHoursDayMapper.updateById(auxiliaryWorkingHoursDay); |
| | | return updateBatchById(auxiliaryWorkingHoursDays); |
| | | } |
| | | |
| | | //ç¼è¾ |
| | |
| | | <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" > |
| | | <mapper namespace="com.yuanchu.mom.mapper.AuxiliaryOriginalHoursMapper"> |
| | | <select id="totalHours" resultType="java.util.Map"> |
| | | select E.name, E.month, E.total |
| | | select E.name, E.month, E.total manHours |
| | | from (select C.name, C.month, C.manHours + D.manHours as total |
| | | from (select A.name, |
| | | A.month, |