zss
2024-05-31 94adc6f8c317f26da2f1f3b65224ac262670bdd8
工时统计的原始工时
已修改22个文件
389 ■■■■ 文件已修改
framework/src/main/java/com/yuanchu/mom/common/OrderBy.java 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
inspect-server/src/main/java/com/yuanchu/mom/service/impl/InsOrderPlanServiceImpl.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
inspect-server/src/main/java/com/yuanchu/mom/service/impl/InsOrderServiceImpl.java 4 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
performance-server/src/main/java/com/yuanchu/mom/controller/AuxiliaryOutputWorkingHoursController.java 8 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
performance-server/src/main/java/com/yuanchu/mom/dto/AuxiliaryCorrectionHoursDto.java 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
performance-server/src/main/java/com/yuanchu/mom/dto/AuxiliaryOriginalHoursDto.java 95 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
performance-server/src/main/java/com/yuanchu/mom/dto/AuxiliaryOriginalHoursLookDto.java 9 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
performance-server/src/main/java/com/yuanchu/mom/mapper/AuxiliaryCorrectionHoursMapper.java 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
performance-server/src/main/java/com/yuanchu/mom/mapper/AuxiliaryOriginalHoursMapper.java 4 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
performance-server/src/main/java/com/yuanchu/mom/mapper/AuxiliaryOutputWorkingHoursMapper.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
performance-server/src/main/java/com/yuanchu/mom/mapper/AuxiliaryWorkingHoursDayMapper.java 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
performance-server/src/main/java/com/yuanchu/mom/pojo/AuxiliaryCorrectionHours.java 4 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
performance-server/src/main/java/com/yuanchu/mom/pojo/AuxiliaryOutputWorkingHours.java 8 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
performance-server/src/main/java/com/yuanchu/mom/pojo/AuxiliaryWorkingHoursDay.java 10 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
performance-server/src/main/java/com/yuanchu/mom/service/impl/AuxiliaryCorrectionHoursServiceImpl.java 51 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
performance-server/src/main/java/com/yuanchu/mom/service/impl/AuxiliaryOutputWorkingHoursServiceImpl.java 32 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
performance-server/src/main/java/com/yuanchu/mom/service/impl/AuxiliaryWorkingHoursDayServiceImpl.java 31 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
performance-server/src/main/java/com/yuanchu/mom/utils/StyleYearUtils.java 12 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
performance-server/src/main/resources/mapper/AuxiliaryCorrectionHoursMapper.xml 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
performance-server/src/main/resources/mapper/AuxiliaryOriginalHoursMapper.xml 53 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
performance-server/src/main/resources/mapper/AuxiliaryOutputWorkingHoursMapper.xml 21 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
performance-server/src/main/resources/mapper/AuxiliaryWorkingHoursDayMapper.xml 27 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
framework/src/main/java/com/yuanchu/mom/common/OrderBy.java
@@ -1,5 +1,6 @@
package com.yuanchu.mom.common;
import com.alibaba.excel.annotation.ExcelIgnore;
import com.baomidou.mybatisplus.annotation.TableField;
import com.yuanchu.mom.annotation.ValueTableShow;
import lombok.AllArgsConstructor;
@@ -17,6 +18,7 @@
public class OrderBy implements Serializable {
    @TableField(select = false, exist = false)
    @ExcelIgnore
    private Map<String, String> orderBy;
}
inspect-server/src/main/java/com/yuanchu/mom/service/impl/InsOrderPlanServiceImpl.java
@@ -281,7 +281,7 @@
                    auxiliaryOutputWorkingHours.setManHourGroup(insProduct.getManHourGroup());//工时分组
                    DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd");
                    DateTimeFormatter formatters = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
                    auxiliaryOutputWorkingHours.setDateTime(LocalDateTime.now().format(formatter));//日期
                    auxiliaryOutputWorkingHours.setDateTime(LocalDateTime.now().toLocalDate().atStartOfDay().format(formatters));//日期
                    LocalDateTime localDateTime = LocalDateTime.now();
                    DateTime parse = DateUtil.parse(localDateTime.format(formatter));
                    auxiliaryOutputWorkingHours.setWeekDay(getWeek(localDateTime.format(formatters)));//星期
inspect-server/src/main/java/com/yuanchu/mom/service/impl/InsOrderServiceImpl.java
@@ -59,6 +59,8 @@
    PowerMapper powerMapper;
    CustomMapper customMapper;
    //获取检验下单数据
    @Override
@@ -75,7 +77,7 @@
                sampleOrderDto.setCreateUser(map1.get("userId"));
            }else {
                //组织
                sampleOrderDto.setCompany(user.getCompany());
                sampleOrderDto.setCompany(customMapper.selectById(user.getCompany()).getCompany());
            }
        }
        Map<String, Object> map = new HashMap<>();
performance-server/src/main/java/com/yuanchu/mom/controller/AuxiliaryOutputWorkingHoursController.java
@@ -1,6 +1,7 @@
package com.yuanchu.mom.controller;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yuanchu.mom.annotation.ValueAuth;
import com.yuanchu.mom.annotation.ValueClassify;
import com.yuanchu.mom.dto.AuxiliaryOutputWorkingHoursDto;
import com.yuanchu.mom.pojo.AuxiliaryOutputWorkingHours;
@@ -12,10 +13,7 @@
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.AllArgsConstructor;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletResponse;
@@ -58,7 +56,7 @@
    @ValueClassify("工时管理")
    @ApiOperation(value = "导出")
    @PostMapping("/exportWorkingHours")
    @GetMapping("/exportWorkingHours")
    public void exportWorkingHours(HttpServletResponse response) throws IOException {
        auxiliaryOutputWorkingHoursService.exportWorkingHours(response);
    }
performance-server/src/main/java/com/yuanchu/mom/dto/AuxiliaryCorrectionHoursDto.java
@@ -13,4 +13,7 @@
    @ValueTableShow(2)
    @ExcelProperty(value = "姓名")
    private String name;
    @ApiModelProperty("部门")
    private String departLims;
}
performance-server/src/main/java/com/yuanchu/mom/dto/AuxiliaryOriginalHoursDto.java
@@ -1,5 +1,6 @@
package com.yuanchu.mom.dto;
import com.alibaba.excel.annotation.ExcelIgnore;
import com.alibaba.excel.annotation.ExcelProperty;
import com.yuanchu.mom.annotation.ValueTableShow;
import io.swagger.annotations.ApiModelProperty;
@@ -25,158 +26,250 @@
    @ExcelProperty(value = "1日")
    private Double oneHours;
    private Integer one;
    @ApiModelProperty("2日工时")
    @ValueTableShow(5)
    @ExcelProperty(value = "2日")
    private Double twoHours;
    @ExcelIgnore
    private Integer  two;
    @ApiModelProperty("3日工时")
    @ValueTableShow(6)
    @ExcelProperty(value = "3日")
    private Double threeHours;
    @ExcelIgnore
    private Integer three;
    @ApiModelProperty("4日工时")
    @ValueTableShow(7)
    @ExcelProperty(value = "4日")
    private Double fourHours;
    @ExcelIgnore
    private Integer four;
    @ApiModelProperty("5日工时")
    @ValueTableShow(8)
    @ExcelProperty(value = "5日")
    private Double fiveHours;
    @ExcelIgnore
    private Integer  five;
    @ApiModelProperty("6日工时")
    @ValueTableShow(9)
    @ExcelProperty(value = "6日")
    private Double sixHours;
    @ExcelIgnore
    private Integer six;
    @ApiModelProperty("7日工时")
    @ValueTableShow(10)
    @ExcelProperty(value = "7日")
    private Double sevenHours;
    @ExcelIgnore
    private Integer seven;
    @ApiModelProperty("8日工时")
    @ValueTableShow(11)
    @ExcelProperty(value = "8日")
    private Double eightHours;
    @ExcelIgnore
    private Integer eight;
    @ApiModelProperty("9日工时")
    @ValueTableShow(12)
    @ExcelProperty(value = "9日")
    private Double nineHours;
    @ExcelIgnore
    private Integer nine;
    @ApiModelProperty("10日工时")
    @ValueTableShow(13)
    @ExcelProperty(value = "10日")
    private Double tenHours;
    @ExcelIgnore
    private Integer ten;
    @ApiModelProperty("11日工时")
    @ValueTableShow(14)
    @ExcelProperty(value = "11日")
    private Double elevenHours;
    @ExcelIgnore
    private Integer eleven;
    @ApiModelProperty("12日工时")
    @ValueTableShow(15)
    @ExcelProperty(value = "12日")
    private Double twelveHours;
    @ExcelIgnore
    private Integer twelve;
    @ApiModelProperty("13日工时")
    @ValueTableShow(16)
    @ExcelProperty(value = "13日")
    private Double thirteenHours;
    @ExcelIgnore
    private Integer thirteen;
    @ApiModelProperty("14日工时")
    @ValueTableShow(17)
    @ExcelProperty(value = "14日")
    private Double fourteenHours;
    @ExcelIgnore
    private Integer fourteen;
    @ApiModelProperty("15日工时")
    @ValueTableShow(18)
    @ExcelProperty(value = "15日")
    private Double fifteenHours;
    @ExcelIgnore
    private Integer fifteen;
    @ApiModelProperty("16日工时")
    @ValueTableShow(19)
    @ExcelProperty(value = "16日")
    private Double sixteenHours;
    @ExcelIgnore
    private Integer sixteen;
    @ApiModelProperty("17日工时")
    @ValueTableShow(20)
    @ExcelProperty(value = "17日")
    private Double seventeenHours;
    @ExcelIgnore
    private Integer seventeen;
    @ApiModelProperty("18日工时")
    @ValueTableShow(21)
    @ExcelProperty(value = "18日")
    private Double eighteenHours;
    @ExcelIgnore
    private Integer eighteen;
    @ApiModelProperty("19日工时")
    @ValueTableShow(22)
    @ExcelProperty(value = "19日")
    private Double nineteenHours;
    @ExcelIgnore
    private Integer nineteen;
    @ApiModelProperty("20日工时")
    @ValueTableShow(23)
    @ExcelProperty(value = "20日")
    private Double twentyHours;
    @ExcelIgnore
    private Integer twenty;
    @ApiModelProperty("21日工时")
    @ValueTableShow(24)
    @ExcelProperty(value = "21日")
    private Double twentyOneHours;
    @ExcelIgnore
    private Integer twentyOne;
    @ApiModelProperty("22日工时")
    @ValueTableShow(25)
    @ExcelProperty(value = "22日")
    private Double twentyTwoHours;
    @ExcelIgnore
    private Integer twentyTwo;
    @ApiModelProperty("23日工时")
    @ValueTableShow(26)
    @ExcelProperty(value = "23日")
    private Double twentyThreeHours;
    @ExcelIgnore
    private Integer twentyThree;
    @ApiModelProperty("24日工时")
    @ValueTableShow(27)
    @ExcelProperty(value = "24日")
    private Double twentyFourHours;
    @ExcelIgnore
    private Integer twentyFour;
    @ApiModelProperty("25日工时")
    @ValueTableShow(28)
    @ExcelProperty(value = "25日")
    private Double twentyFiveHours;
    @ExcelIgnore
    private Integer twentyFive;
    @ApiModelProperty("26日工时")
    @ValueTableShow(29)
    @ExcelProperty(value = "26日")
    private Double twentySixHours;
    @ExcelIgnore
    private Integer twentySix;
    @ApiModelProperty("27日工时")
    @ValueTableShow(30)
    @ExcelProperty(value = "27日")
    private Double twentySevenHours;
    @ExcelIgnore
    private Integer twentySeven;
    @ApiModelProperty("28日工时")
    @ValueTableShow(31)
    @ExcelProperty(value = "28日")
    private Double twentyEightHours;
    @ExcelIgnore
    private Integer  twentyEight;
    @ApiModelProperty("29日工时")
    @ValueTableShow(32)
    @ExcelProperty(value = "29日")
    private Double twentyNineHours;
    @ExcelIgnore
    private Integer  twentyNine;
    @ApiModelProperty("30日工时")
    @ValueTableShow(33)
    @ExcelProperty(value = "30日")
    private Double thirtyHours;
    @ExcelIgnore
    private Integer thirty;
    @ApiModelProperty("31日工时")
    @ValueTableShow(34)
    @ExcelProperty(value = "31日")
    private Double thirtyOneHours;
    @ExcelIgnore
    private Integer thirtyOne;
    @ApiModelProperty("月份")
    @ValueTableShow(35)
    @ExcelProperty(value = "月份")
    private LocalDateTime month;
    private String month;
}
performance-server/src/main/java/com/yuanchu/mom/dto/AuxiliaryOriginalHoursLookDto.java
@@ -11,12 +11,9 @@
public class AuxiliaryOriginalHoursLookDto {
    @NotNull
    private LocalDateTime startTime;//月初
    private String month;//月份
    @NotNull
    private LocalDateTime endTime;//月末
    private String name;
    private Integer userId;
    private Integer departId;
    private String departLims;
}
performance-server/src/main/java/com/yuanchu/mom/mapper/AuxiliaryCorrectionHoursMapper.java
@@ -22,4 +22,7 @@
public interface AuxiliaryCorrectionHoursMapper extends BaseMapper<AuxiliaryCorrectionHours> {
    IPage<AuxiliaryCorrectionHoursDto> selectAuxiliaryCorrectionHours(Page page, @Param("ew") QueryWrapper<AuxiliaryCorrectionHoursDto> ew, @Param("ids") List<Integer> ids);
    List<Integer> selDepartLimsByName(String departLims);
}
performance-server/src/main/java/com/yuanchu/mom/mapper/AuxiliaryOriginalHoursMapper.java
@@ -7,9 +7,11 @@
import org.apache.ibatis.annotations.Param;
import java.util.List;
import java.util.Map;
public interface AuxiliaryOriginalHoursMapper {
    //查询该月的总工时
    List<Map<String, Object>> totalHours(@Param("month") String month, @Param("ids") List<Integer> ids);
}
performance-server/src/main/java/com/yuanchu/mom/mapper/AuxiliaryOutputWorkingHoursMapper.java
@@ -30,7 +30,7 @@
    List<AuxiliaryOutputWorkingHoursDto> selectDataByUser(@Param("ids") List<Integer> ids);
    //查询该月的产量工时
    List<Map<String, Object>> totalHours(@Param("startTime") LocalDateTime startTime, @Param("endTime") LocalDateTime endTime, @Param("userId") Integer userId, @Param("departId") Integer departId, @Param("ids") List<Integer> ids);
    List<Map<String, Object>> totalHours(@Param("month") String month, @Param("ids") List<Integer> ids);
    List<AuxiliaryOutputWorkingHours> selectListByIds(@Param("ids") List<Integer> ids);
performance-server/src/main/java/com/yuanchu/mom/mapper/AuxiliaryWorkingHoursDayMapper.java
@@ -10,6 +10,7 @@
import org.apache.ibatis.annotations.Param;
import java.util.List;
import java.util.Map;
/**
 * <p>
@@ -27,4 +28,8 @@
    List<AuxiliaryWorkingHoursDayDto> selectDataByUser(@Param("ids") List<Integer> ids);
    List<AuxiliaryWorkingHoursDay> selectListByIds(@Param("ids") List<Integer> ids);
    //查询该月的辅助工时
    List<Map<String, Object>> totalHours(@Param("month") String month, @Param("ids") List<Integer> ids);
}
performance-server/src/main/java/com/yuanchu/mom/pojo/AuxiliaryCorrectionHours.java
@@ -30,8 +30,6 @@
@ApiModel(value = "AuxiliaryCorrectionHours对象", description = "工时统计的修正工时")
public class AuxiliaryCorrectionHours extends OrderBy implements Serializable {
    private static final long serialVersionUID = 1L;
    @TableId(value = "id", type = IdType.AUTO)
    private Integer id;
@@ -201,7 +199,7 @@
    @ApiModelProperty("月份")
    @ValueTableShow(35)
    @ExcelProperty(value = "月份")
    private LocalDateTime month;
    private String month;
    @ApiModelProperty("创建时间")
    @TableField(fill = FieldFill.INSERT)
performance-server/src/main/java/com/yuanchu/mom/pojo/AuxiliaryOutputWorkingHours.java
@@ -1,5 +1,6 @@
package com.yuanchu.mom.pojo;
import com.alibaba.excel.annotation.ExcelIgnore;
import com.alibaba.excel.annotation.ExcelProperty;
import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.IdType;
@@ -32,6 +33,7 @@
public class AuxiliaryOutputWorkingHours extends OrderBy implements Serializable {
    @TableId(value = "id", type = IdType.AUTO)
    @ExcelIgnore
    private Integer id;
    @ApiModelProperty("检测项目")
@@ -90,26 +92,32 @@
    private String weekDay;
    @ApiModelProperty("检测人id")
    @ExcelIgnore
    private Integer check;
    @ApiModelProperty("创建时间")
    @TableField(fill = FieldFill.INSERT)
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @ExcelIgnore
    private LocalDateTime createTime;
    @ApiModelProperty("修改时间")
    @TableField(fill = FieldFill.INSERT_UPDATE)
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @ExcelIgnore
    private LocalDateTime updateTime;
    @ApiModelProperty("创建人id")
    @TableField(fill = FieldFill.INSERT)
    @ExcelIgnore
    private Integer createUser;
    @ApiModelProperty("修改人id")
    @TableField(fill = FieldFill.INSERT_UPDATE)
    @ExcelIgnore
    private Integer updateUser;
    @ApiModelProperty("工时分组")
    @ExcelIgnore
    private String manHourGroup;
}
performance-server/src/main/java/com/yuanchu/mom/pojo/AuxiliaryWorkingHoursDay.java
@@ -1,5 +1,6 @@
package com.yuanchu.mom.pojo;
import com.alibaba.excel.annotation.ExcelIgnore;
import com.alibaba.excel.annotation.ExcelProperty;
import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.IdType;
@@ -32,9 +33,11 @@
public class AuxiliaryWorkingHoursDay extends OrderBy implements Serializable {
    @TableId(value = "id", type = IdType.AUTO)
    @ExcelIgnore
    private Integer id;
    @ApiModelProperty("姓名id")
    @ExcelIgnore
    private Integer nameUser;
    @ApiModelProperty("编号")
@@ -110,23 +113,28 @@
    @ApiModelProperty("创建时间")
    @TableField(fill = FieldFill.INSERT)
    @ValueTableShow(17)
    @ExcelIgnore
    private LocalDateTime createTime;
    @ApiModelProperty("修改时间")
    @TableField(fill = FieldFill.INSERT_UPDATE)
    @ExcelIgnore
    private LocalDateTime updateTime;
    @ApiModelProperty("创建人id")
    @TableField(fill = FieldFill.INSERT)
    @ExcelIgnore
    private Integer createUser;
    @ApiModelProperty("修改人id")
    @TableField(fill = FieldFill.INSERT_UPDATE)
    @ExcelIgnore
    private Integer updateUser;
    @ApiModelProperty("状态")
    @ExcelProperty(value = "状态")
    @ValueTableShow(18)
    @ExcelIgnore
    @ValueTableShow(4)
    private String state;
    @ApiModelProperty("日期")
performance-server/src/main/java/com/yuanchu/mom/service/impl/AuxiliaryCorrectionHoursServiceImpl.java
@@ -21,10 +21,12 @@
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.time.format.DateTimeFormatter;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.regex.Pattern;
import java.util.stream.Collectors;
/**
@@ -50,10 +52,11 @@
    @Resource
    PowerMapper powerMapper;
    @Override
    public Map<String, Object> selectAuxiliaryCorrectionHours(Page page, AuxiliaryCorrectionHoursDto auxiliaryCorrectionHoursDto) {
        Map<String, Object> map = new HashMap<>();
        List<Integer> ids = null;
        List<Integer> ids = new ArrayList<>();
        map.put("head", PrintChina.printChina(AuxiliaryCorrectionHoursDto.class));
        //判断组长,组员,管理员权限
        Map<String, Integer> map1 = getLook.selectPowerByMethodAndUserId("selectAuxiliaryCorrectionHours");
@@ -71,12 +74,29 @@
        } else {
            //是组长
            //查询组长下的组员
            List<User> users = userMapper.selectList(Wrappers.<User>lambdaQuery().like(User::getDepartLimsId, user.getDepartLimsId()));
            List<User> users = userMapper.selectList(Wrappers.<User>lambdaQuery()
                    .like(User::getDepartLimsId, user.getDepartLimsId())
                    .eq(User::getState, 1));
            if (ObjectUtils.isNotEmpty(users)) {
                ids = users.stream().map(User::getId).distinct().collect(Collectors.toList());
                ids.addAll(users.stream().map(User::getId).distinct().collect(Collectors.toList()));
            }
        }
        map.put("body", auxiliaryCorrectionHoursMapper.selectAuxiliaryCorrectionHours(page, QueryWrappers.queryWrappers(auxiliaryCorrectionHoursDto),ids));
        String departLims = auxiliaryCorrectionHoursDto.getDepartLims();
        auxiliaryCorrectionHoursDto.setDepartLims(null);
        if (ObjectUtils.isNotEmpty(departLims)) {
            //先模糊查询出来id
            List<Integer> ides = auxiliaryCorrectionHoursMapper.selDepartLimsByName(departLims);
            for (Integer ide : ides) {
                List<User> users = userMapper.selectList(Wrappers.<User>lambdaQuery()
                        .like(User::getDepartLimsId, ide)
                        .eq(User::getState, 1));
                if (ObjectUtils.isNotEmpty(users)) {
                    ids.clear();
                    ids.addAll(users.stream().map(User::getId).distinct().collect(Collectors.toList()));
                }
            }
        }
        map.put("body", auxiliaryCorrectionHoursMapper.selectAuxiliaryCorrectionHours(page, QueryWrappers.queryWrappers(auxiliaryCorrectionHoursDto).eq("month", auxiliaryCorrectionHoursDto.getMonth()), ids));
        return map;
    }
@@ -87,17 +107,32 @@
            return;
        }
        List<AuxiliaryCorrectionHours> auxiliaryCorrectionHoursList = new ArrayList<>();
        List<AuxiliaryCorrectionHours> auxiliaryCorrectionHoursList1 = new ArrayList<>();
        for (AuxiliaryCorrectionHoursDto auxiliaryCorrectionHoursDto : list) {
            AuxiliaryCorrectionHours auxiliaryCorrectionHours = new AuxiliaryCorrectionHours();
            User user = userMapper.selectOne(Wrappers.<User>lambdaQuery().eq(User::getName, auxiliaryCorrectionHoursDto.getName()));
            if (ObjectUtils.isEmpty(user)){
                throw new RuntimeException("系统没有查到"+auxiliaryCorrectionHoursDto.getName()+"这个用户信息!");
            if (ObjectUtils.isEmpty(user)) {
                throw new RuntimeException("系统没有查到" + auxiliaryCorrectionHoursDto.getName() + "这个用户信息!");
            }
            BeanUtils.copyProperties(auxiliaryCorrectionHoursDto,auxiliaryCorrectionHours);
            String regex = "\\d{4}-\\d{2}";
            if (Pattern.matches(regex,auxiliaryCorrectionHours.getMonth())) {
                throw new RuntimeException(auxiliaryCorrectionHoursDto.getMonth() + "格式不正确,月份格式应为yyyy-MM");
            }
            BeanUtils.copyProperties(auxiliaryCorrectionHoursDto, auxiliaryCorrectionHours);
            auxiliaryCorrectionHours.setNameUser(user.getId());
            auxiliaryCorrectionHoursList.add(auxiliaryCorrectionHours);
            AuxiliaryCorrectionHours auxiliaryCorrectionHours1 = auxiliaryCorrectionHoursMapper.selectOne(Wrappers.<AuxiliaryCorrectionHours>lambdaQuery()
                    .eq(AuxiliaryCorrectionHours::getNameUser, user.getId())
                    .eq(AuxiliaryCorrectionHours::getType, auxiliaryCorrectionHours.getType())
                    .eq(AuxiliaryCorrectionHours::getMonth, auxiliaryCorrectionHours.getMonth()));
            if (ObjectUtils.isNotEmpty(auxiliaryCorrectionHours1)) {
                auxiliaryCorrectionHoursList1.add(auxiliaryCorrectionHours);
            } else {
                auxiliaryCorrectionHoursList.add(auxiliaryCorrectionHours);
            }
        }
        //批量新增
        saveBatch(auxiliaryCorrectionHoursList);
        //批量修改
        updateBatchById(auxiliaryCorrectionHoursList1);
    }
}
performance-server/src/main/java/com/yuanchu/mom/service/impl/AuxiliaryOutputWorkingHoursServiceImpl.java
@@ -28,6 +28,7 @@
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.net.URLEncoder;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
@@ -66,7 +67,7 @@
        auxiliaryOutputWorkingHoursDto.setDateTime(null);
        auxiliaryOutputWorkingHoursDto.setWeek(null);
        Map<String, Object> map = new HashMap<>();
        List<Integer> ids = null;
        List<Integer> ids = new ArrayList<>();
        map.put("head", PrintChina.printChina(AuxiliaryOutputWorkingHoursDto.class));
        //判断组长,组员,管理员权限
        Map<String, Integer> map1 = getLook.selectPowerByMethodAndUserId("selectAuxiliaryOutputWorkingHours");
@@ -86,20 +87,27 @@
            //查询组长下的组员
            List<User> users = userMapper.selectList(Wrappers.<User>lambdaQuery().like(User::getDepartLimsId, user.getDepartLimsId()));
            if (ObjectUtils.isNotEmpty(users)) {
                ids = users.stream().map(User::getId).distinct().collect(Collectors.toList());
                ids.addAll(users.stream().map(User::getId).distinct().collect(Collectors.toList()));
            }
        }
        if (ObjectUtils.isNotEmpty(dates)) {
        if (ObjectUtils.isNotEmpty(dates) && ObjectUtils.isNotEmpty(week)){
            String[] split = dates.replaceAll("\\[", "").replaceAll("]", "").replaceAll("\"", "").split(",");
            if (ObjectUtils.isNotEmpty(week)){
                String[] weeks = week.replaceAll("\\[", "").replaceAll("]", "").replaceAll("\"", "").split(",");
                map.put("body", 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));
            }
            map.put("body", auxiliaryOutputWorkingHoursMapper.selectAuxiliaryOutputWorkingHours(page, QueryWrappers.queryWrappers(auxiliaryOutputWorkingHoursDto).ge("date_time", split[0]).le("date_time", split[1] + " 23:59:59"), ids));
        } else {
            String[] weeks = week.replaceAll("\\[", "").replaceAll("]", "").replaceAll("\"", "").split(",");
            map.put("body", 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));
        }else if(ObjectUtils.isNotEmpty(dates) && ObjectUtils.isEmpty(week)){
            String[] split = dates.replaceAll("\\[", "").replaceAll("]", "").replaceAll("\"", "").split(",");
            map.put("body", auxiliaryOutputWorkingHoursMapper.selectAuxiliaryOutputWorkingHours(page,
                    QueryWrappers.queryWrappers(auxiliaryOutputWorkingHoursDto)
                            .ge("date_time", split[0]).le("date_time", split[1] + " 23:59:59"), ids));
        }else if (ObjectUtils.isEmpty(dates) && ObjectUtils.isNotEmpty(week)){
            String[] weeks = week.replaceAll("\\[", "").replaceAll("]", "").replaceAll("\"", "").split(",");
            map.put("body", auxiliaryOutputWorkingHoursMapper.selectAuxiliaryOutputWorkingHours(page,
                    QueryWrappers.queryWrappers(auxiliaryOutputWorkingHoursDto)
                            .ge("week", weeks[0]).le("week", weeks[1]), ids));
        }else {
            map.put("body", auxiliaryOutputWorkingHoursMapper.selectAuxiliaryOutputWorkingHours(page, QueryWrappers.queryWrappers(auxiliaryOutputWorkingHoursDto), ids));
        }
        return map;
performance-server/src/main/java/com/yuanchu/mom/service/impl/AuxiliaryWorkingHoursDayServiceImpl.java
@@ -18,6 +18,7 @@
import javax.annotation.Resource;
import java.time.LocalDateTime;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
@@ -62,7 +63,7 @@
        auxiliaryWorkingHoursDayDto.setDateTime(null);
        auxiliaryWorkingHoursDayDto.setWeek(null);
        Map<String, Object> map = new HashMap<>();
        List<Integer> ids = null;
        List<Integer> ids = new ArrayList<>();
        map.put("head", PrintChina.printChina(AuxiliaryWorkingHoursDayDto.class));
        //判断组长,组员,管理员权限
        Map<String, Integer> map1 = getLook.selectPowerByMethodAndUserId("selectAuxiliaryWorkingHoursDay");
@@ -82,20 +83,26 @@
            //查询组员
            List<User> users = userMapper.selectList(Wrappers.<User>lambdaQuery().like(User::getDepartLimsId, user.getDepartLimsId()));
            if (ObjectUtils.isNotEmpty(users)) {
                ids = users.stream().map(User::getId).distinct().collect(Collectors.toList());
                ids.addAll(users.stream().map(User::getId).distinct().collect(Collectors.toList()));
            }
        }
        if (ObjectUtils.isNotEmpty(dates)) {
        if (ObjectUtils.isNotEmpty(dates) && ObjectUtils.isNotEmpty(week)) {
            String[] split = dates.replaceAll("\\[", "").replaceAll("]", "").replaceAll("\"", "").split(",");
            if (ObjectUtils.isNotEmpty(week)) {
                String[] weeks = week.replaceAll("\\[", "").replaceAll("]", "").replaceAll("\"", "").split(",");
                map.put("body", 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));
            } else {
                map.put("body", auxiliaryWorkingHoursDayMapper.selectAuxiliaryWorkingHoursDay(page, QueryWrappers.queryWrappers(auxiliaryWorkingHoursDayDto).ge("date_time", split[0]).le("date_time", split[1] + " 23:59:59"), ids));
            }
            String[] weeks = week.replaceAll("\\[", "").replaceAll("]", "").replaceAll("\"", "").split(",");
            map.put("body", 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));
        } else if (ObjectUtils.isNotEmpty(dates) && ObjectUtils.isEmpty(week)) {
            String[] split = dates.replaceAll("\\[", "").replaceAll("]", "").replaceAll("\"", "").split(",");
            map.put("body", auxiliaryWorkingHoursDayMapper.selectAuxiliaryWorkingHoursDay(page,
                    QueryWrappers.queryWrappers(auxiliaryWorkingHoursDayDto)
                            .ge("date_time", split[0]).le("date_time", split[1] + " 23:59:59"), ids));
        } else if (ObjectUtils.isEmpty(dates) && ObjectUtils.isNotEmpty(week)) {
            String[] weeks = week.replaceAll("\\[", "").replaceAll("]", "").replaceAll("\"", "").split(",");
            map.put("body", auxiliaryWorkingHoursDayMapper.selectAuxiliaryWorkingHoursDay(page,
                    QueryWrappers.queryWrappers(auxiliaryWorkingHoursDayDto)
                            .ge("week", weeks[0]).le("week", weeks[1]), ids));
        } else {
            map.put("body", auxiliaryWorkingHoursDayMapper.selectAuxiliaryWorkingHoursDay(page, QueryWrappers.queryWrappers(auxiliaryWorkingHoursDayDto), ids));
        }
performance-server/src/main/java/com/yuanchu/mom/utils/StyleYearUtils.java
@@ -10,6 +10,7 @@
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
import java.util.stream.Stream;
public class StyleYearUtils {
    /**
@@ -91,8 +92,13 @@
    }
    public static void main(String[] args) {
        String a="[\"GB/T 15972.20-2021\",\"IEC 60793-1-20:2014\"]";
        System.out.println(a.contains("GB/T 15972.20-2021"));
        ArrayList<Integer> list = null;
        ArrayList<Integer> list11 = new ArrayList<>();
        list11.add(1);
        list11.add(1);
        list11.add(2);
        list11.add(2);
        list.addAll(list11);
        System.out.println(list);
    }
}
performance-server/src/main/resources/mapper/AuxiliaryCorrectionHoursMapper.xml
@@ -61,4 +61,7 @@
            ${ew.customSqlSegment}
        </if>
    </select>
    <select id="selDepartLimsByName" resultType="java.lang.Integer">
        select id from department_lims where name LIKE CONCAT('%', #{departLims}, '%');
    </select>
</mapper>
performance-server/src/main/resources/mapper/AuxiliaryOriginalHoursMapper.xml
@@ -1,4 +1,57 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!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
        from (select C.name, C.month, C.manHours + D.manHours as total
        from (select A.name,
        A.month,
        sum(A.manHour) as manHours
        from (
        select user.name,
        case
        when reviewer_nonproductive_time is null then nonproductive_time
        else reviewer_nonproductive_time end as manHour,
        date_time                                as month
        from auxiliary_working_hours_day awhd
        left join user on user.id = awhd.name_user
        left join department_lims dl on depart_lims_id = dl.id
        where date_time LIKE CONCAT('%', #{month}, '%')
        and awhd.state='已批准'
        <if test="ids !=null and ids != ''">
            and name_user in
            <foreach collection="ids" index="index" open="(" separator="," close=")" item="val">
                #{val}
            </foreach>
        </if>
        order by month
        ) A
        group by A.name, A.month) C
        LEFT JOIN
        (select B.name,
        B.month,
        B.manHours
        from (
        select user.name,
        date_time             as month,
        sum(output_work_time) as manHours
        from auxiliary_output_working_hours aowh
        left join user on user.id = aowh.`check`
        left join department_lims dl on depart_lims_id = dl.id
        where date_time LIKE CONCAT('%', #{month}, '%')
        <if test="ids !=null and ids != ''">
            and `check` in
            <foreach collection="ids" index="index" open="(" separator="," close=")" item="val">
                #{val}
            </foreach>
        </if>
        group by user.name, month
        order by user.name, month
        ) B
        group by B.name, B.month) D
        on C.month = D.month
        where C.name = D.name
        ) E
        group by E.name, E.month
    </select>
</mapper>
performance-server/src/main/resources/mapper/AuxiliaryOutputWorkingHoursMapper.xml
@@ -64,33 +64,24 @@
    <select id="totalHours" resultType="java.util.Map">
        select A.name,
        A.month,
        A.output_work_time
        A.manHours
        from(
        select user.name,
        user.id,
        depart_lims_id,
        output_work_time,
        date_time as month
        date_time as month,
        sum(output_work_time) as manHours
        from auxiliary_output_working_hours aowh
        left join user on user.id=aowh.`check`
        left join department_lims dl on depart_lims_id=dl.id
        where date_time between #{startTime} and #{endTime}
        where date_time LIKE CONCAT('%', #{month}, '%')
        <if test="ids !=null and ids != ''">
            and `check` in
            <foreach collection="ids" index="index" open="(" separator="," close=")" item="val">
                #{val}
            </foreach>
        </if>
        order by date_time
        group by user.name,month
        order by month,user.name
        )A
        where 1=1
        <if test="userId !=null and userId != ''">
            and A.user_id=#{userId}
        </if>
        <if test="departId !=null and departId != ''">
            and A.depart_lims_id=#{departId}
        </if>
        group by A.name,A.month
    </select>
    <select id="selectListByIds" resultType="com.yuanchu.mom.pojo.AuxiliaryOutputWorkingHours">
        select * from auxiliary_output_working_hours
performance-server/src/main/resources/mapper/AuxiliaryWorkingHoursDayMapper.xml
@@ -57,10 +57,35 @@
        select * from auxiliary_working_hours_day
        where 1=1
        <if test="ids !=null and ids != ''">
           and name_user in
            and name_user in
            <foreach collection="ids" index="index" open="(" separator="," close=")" item="val">
                #{val}
            </foreach>
        </if>
    </select>
    <select id="totalHours" resultType="java.util.Map">
        select A.name,
        A.month,
        sum(A.manHour)as manHours
        from(
        select user.name,
        case when reviewer_nonproductive_time is null then nonproductive_time
        else reviewer_nonproductive_time end as manHour,
        date_time as month
        from auxiliary_working_hours_day awhd
        left join user on user.id=awhd.name_user
        left join department_lims dl on depart_lims_id=dl.id
        where date_time LIKE CONCAT('%', #{month}, '%')
        and awhd.state='已批准'
        <if test="ids !=null and ids != ''">
            and name_user in
            <foreach collection="ids" index="index" open="(" separator="," close=")" item="val">
                #{val}
            </foreach>
        </if>
        order by month,user.name
        )A
        group by A.name,A.month
        order by A.name,A.month
    </select>
</mapper>