value
2024-06-04 9a869e800b235636097abebadb1bd1cae4206cbc
Merge remote-tracking branch 'origin/master'
已修改16个文件
已添加1个文件
303 ■■■■ 文件已修改
cnas-server/src/main/java/com/yuanchu/mom/controller/DeviceController.java 20 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
cnas-server/src/main/java/com/yuanchu/mom/dto/DeviceDto1.java 43 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
cnas-server/src/main/java/com/yuanchu/mom/pojo/Device.java 21 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
cnas-server/src/main/java/com/yuanchu/mom/service/DeviceService.java 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
cnas-server/src/main/java/com/yuanchu/mom/service/impl/DeviceServiceImpl.java 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
performance-server/src/main/java/com/yuanchu/mom/controller/AuxiliaryOriginalHoursController.java 14 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
performance-server/src/main/java/com/yuanchu/mom/controller/AuxiliaryOutputWorkingHoursController.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
performance-server/src/main/java/com/yuanchu/mom/service/AuxiliaryOriginalHoursService.java 9 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
performance-server/src/main/java/com/yuanchu/mom/service/impl/AuxiliaryOriginalHoursServiceImpl.java 43 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
performance-server/src/main/java/com/yuanchu/mom/service/impl/AuxiliaryOutputWorkingHoursServiceImpl.java 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
performance-server/src/main/java/com/yuanchu/mom/service/impl/PerformanceShiftServiceImpl.java 75 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
performance-server/src/main/java/com/yuanchu/mom/utils/StyleMonthUtils.java 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
performance-server/src/main/java/com/yuanchu/mom/utils/StyleYearUtils.java 20 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
user-server/src/main/java/com/yuanchu/mom/controller/CompaniesController.java 39 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
user-server/src/main/java/com/yuanchu/mom/pojo/User.java 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
user-server/src/main/java/com/yuanchu/mom/service/UserService.java 补丁 | 查看 | 原始文档 | blame | 历史
user-server/src/main/java/com/yuanchu/mom/service/impl/UserServiceImp.java 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
cnas-server/src/main/java/com/yuanchu/mom/controller/DeviceController.java
@@ -6,12 +6,14 @@
import com.yuanchu.mom.annotation.ValueAuth;
import com.yuanchu.mom.annotation.ValueClassify;
import com.yuanchu.mom.dto.DeviceDto;
import com.yuanchu.mom.dto.DeviceDto1;
import com.yuanchu.mom.pojo.Device;
import com.yuanchu.mom.service.DeviceService;
import com.yuanchu.mom.utils.JackSonUtil;
import com.yuanchu.mom.vo.Result;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
@@ -130,5 +132,23 @@
    public Result selectDeviceByCode(String code) {
        return Result.success(deviceService.selectDeviceByCode(code));
    }
    @ValueClassify("设备")
    @ApiOperation(value = "查询数采配置")
    @PostMapping("/getNumberCollect")
    public Result<?> getNumberCollect(Integer id) {
        DeviceDto1 deviceDto1 = new DeviceDto1();
        BeanUtils.copyProperties(deviceService.getById(id),deviceDto1);
        return Result.success(deviceDto1);
    }
    @ValueClassify("设备")
    @ApiOperation(value = "维护数采配置")
    @PostMapping("/numberCollect")
    public Result<?> numberCollect(@RequestBody DeviceDto1 deviceDto1) {
        Device device = new Device();
        BeanUtils.copyProperties(deviceDto1,device);
        return Result.success(deviceService.updateById(device));
    }
}
cnas-server/src/main/java/com/yuanchu/mom/dto/DeviceDto1.java
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,43 @@
package com.yuanchu.mom.dto;
import com.yuanchu.mom.annotation.ValueTableShow;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import javax.validation.constraints.NotNull;
@Data
public class DeviceDto1 {
    private Integer id;
    @ApiModelProperty(value = "IP")
    @ValueTableShow(1)
    @NotNull
    private String ip;
    @ApiModelProperty(value = "采集地址")
    @NotNull
    private String collectUrl;
    @ApiModelProperty(value = "存储地址")
    @NotNull
    private String storageUrl;
    @ApiModelProperty(value = "参照")
    @NotNull
    private String refer;
    @ApiModelProperty(value = "X")
    @NotNull
    private String x;
    @ApiModelProperty(value = "Y")
    @NotNull
    private String y;
    @ApiModelProperty(value = "公式")
    @NotNull
    private String formula;
}
cnas-server/src/main/java/com/yuanchu/mom/pojo/Device.java
@@ -118,4 +118,25 @@
    @TableField(fill = FieldFill.INSERT)
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime createTime;
    @ApiModelProperty(value = "IP")
    private String ip;
    @ApiModelProperty(value = "采集地址")
    private String collectUrl;
    @ApiModelProperty(value = "存储地址")
    private String storageUrl;
    @ApiModelProperty(value = "参照")
    private String refer;
    @ApiModelProperty(value = "X")
    private String x;
    @ApiModelProperty(value = "Y")
    private String y;
    @ApiModelProperty(value = "公式")
    private String formula;
}
cnas-server/src/main/java/com/yuanchu/mom/service/DeviceService.java
@@ -3,6 +3,7 @@
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import com.yuanchu.mom.dto.DeviceDto;
import com.yuanchu.mom.dto.DeviceDto1;
import com.yuanchu.mom.pojo.Device;
import java.util.List;
cnas-server/src/main/java/com/yuanchu/mom/service/impl/DeviceServiceImpl.java
@@ -7,6 +7,7 @@
import com.yuanchu.mom.common.GetLook;
import com.yuanchu.mom.common.PrintChina;
import com.yuanchu.mom.dto.DeviceDto;
import com.yuanchu.mom.dto.DeviceDto1;
import com.yuanchu.mom.mapper.DeviceMapper;
import com.yuanchu.mom.mapper.StructureItemParameterMapper;
import com.yuanchu.mom.pojo.Device;
performance-server/src/main/java/com/yuanchu/mom/controller/AuxiliaryOriginalHoursController.java
@@ -11,12 +11,11 @@
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;
import java.io.IOException;
import java.util.Map;
@Api(tags = "工时统计-原始工时")
@@ -36,4 +35,11 @@
        AuxiliaryOriginalHoursLookDto entity = JackSonUtil.unmarshal(JackSonUtil.marshal(data.get("entity")), AuxiliaryOriginalHoursLookDto.class);
        return Result.success(auxiliaryOriginalHoursService.selectAuxiliaryOriginalHours(page, entity));
    }
    @ValueClassify("工时管理")
    @ApiOperation(value = "导出原始工时")
    @GetMapping("/exportOriginalHours")
    public void exportOriginalHours(@RequestBody AuxiliaryOriginalHoursLookDto auxiliaryOriginalHoursLookDto,HttpServletResponse response) throws IOException {
        auxiliaryOriginalHoursService.exportWorkingHours(auxiliaryOriginalHoursLookDto,response);
    }
}
performance-server/src/main/java/com/yuanchu/mom/controller/AuxiliaryOutputWorkingHoursController.java
@@ -55,7 +55,7 @@
    @ValueClassify("工时管理")
    @ApiOperation(value = "导出")
    @ApiOperation(value = "导出产量工时+辅助工时")
    @GetMapping("/exportWorkingHours")
    public void exportWorkingHours(HttpServletResponse response) throws IOException {
        auxiliaryOutputWorkingHoursService.exportWorkingHours(response);
performance-server/src/main/java/com/yuanchu/mom/service/AuxiliaryOriginalHoursService.java
@@ -4,9 +4,18 @@
import com.yuanchu.mom.dto.AuxiliaryOriginalHoursDto;
import com.yuanchu.mom.dto.AuxiliaryOriginalHoursLookDto;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.util.Map;
public interface AuxiliaryOriginalHoursService {
    Map<String, Object> selectAuxiliaryOriginalHours(Page page, AuxiliaryOriginalHoursLookDto auxiliaryOriginalHoursLookDto);
    /**
     * å¯¼å‡ºåŽŸå§‹å·¥æ—¶
     *
     * @param response
     */
    void exportWorkingHours(AuxiliaryOriginalHoursLookDto auxiliaryOriginalHoursLookDto, HttpServletResponse response) throws IOException;
}
performance-server/src/main/java/com/yuanchu/mom/service/impl/AuxiliaryOriginalHoursServiceImpl.java
@@ -1,14 +1,17 @@
package com.yuanchu.mom.service.impl;
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.JSONObject;
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.AuxiliaryCorrectionHoursDto;
import com.yuanchu.mom.dto.AuxiliaryOriginalHoursDto;
import com.yuanchu.mom.dto.AuxiliaryOriginalHoursLookDto;
import com.yuanchu.mom.dto.*;
import com.yuanchu.mom.mapper.*;
import com.yuanchu.mom.pojo.AuxiliaryCorrectionHours;
import com.yuanchu.mom.pojo.Power;
@@ -18,6 +21,9 @@
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
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;
@@ -124,11 +130,11 @@
            }
        }
        //如果产量工时为空
        else if (ObjectUtils.isEmpty(maps)) {
        else if (ObjectUtils.isNotEmpty(maps1)) {
            for (Map<String, Object> objectMap : maps1) {
                auxiliaryOriginalHoursDtos.add(getData(objectMap, "总工时"));
            }
        } else if (ObjectUtils.isEmpty(maps1)) {
        } else if (ObjectUtils.isNotEmpty(maps)) {
            for (Map<String, Object> objectMap : maps) {
                auxiliaryOriginalHoursDtos.add(getData(objectMap, "总工时"));
            }
@@ -138,6 +144,33 @@
        return map;
    }
    //导出原始工时
    @Override
    public void exportWorkingHours(AuxiliaryOriginalHoursLookDto auxiliaryOriginalHoursLookDto, HttpServletResponse response) throws IOException {
        List<AuxiliaryOriginalHoursDto> auxiliaryOriginalHoursDtos = new ArrayList<AuxiliaryOriginalHoursDto>();
        //查询原始工时(使用分页查询)
        IPage<AuxiliaryOriginalHoursDto> body = (IPage<AuxiliaryOriginalHoursDto>) selectAuxiliaryOriginalHours(new Page(-1, -1), auxiliaryOriginalHoursLookDto).get("body");
        auxiliaryOriginalHoursDtos=body.getRecords();
        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(0, "原始工时导出").head(AuxiliaryOriginalHoursDto.class).build();
            excelWriter.write(auxiliaryOriginalHoursDtos, mainSheet);
            // å…³é—­æµ
            excelWriter.finish();
        } catch (IOException e) {
            throw new RuntimeException("导出失败");
        }
    }
    private AuxiliaryOriginalHoursDto getData(Map<String, Object> objectMap, String type) {
        AuxiliaryOriginalHoursDto auxiliaryOriginalHoursDto = new AuxiliaryOriginalHoursDto();
        auxiliaryOriginalHoursDto.setName(objectMap.get("name").toString());//姓名
performance-server/src/main/java/com/yuanchu/mom/service/impl/AuxiliaryOutputWorkingHoursServiceImpl.java
@@ -167,8 +167,8 @@
    //导出
    @Override
    public void exportWorkingHours(HttpServletResponse response) throws IOException {
        List<AuxiliaryOutputWorkingHoursDto> auxiliaryOutputWorkingHoursDtos = null;
        List<AuxiliaryWorkingHoursDayDto> auxiliaryWorkingHoursDayDtos = null;
        List<AuxiliaryOutputWorkingHoursDto> auxiliaryOutputWorkingHoursDtos = new ArrayList<>();
        List<AuxiliaryWorkingHoursDayDto> auxiliaryWorkingHoursDayDtos = new ArrayList<>();
        List<Integer> ids = null;
        //判断是组长还是组员还是管理员
        Map<String, Integer> map1 = getLook.selectPowerByMethodAndUserId("selectAuxiliaryOutputWorkingHours");
@@ -199,7 +199,7 @@
        response.setContentType("application/vnd.ms-excel");
        response.setCharacterEncoding("UTF-8");
        // è¿™é‡ŒURLEncoder.encode可以防止中文乱码 å½“ç„¶å’Œeasyexcel没有关系
        String fileName = URLEncoder.encode("工时管理导出", "UTF-8");
        String fileName = URLEncoder.encode("日工时管理导出", "UTF-8");
        response.setHeader("Content-disposition", "attachment;filename=" + fileName + ".xlsx");
        try {
            // æ–°å»ºExcelWriter
performance-server/src/main/java/com/yuanchu/mom/service/impl/PerformanceShiftServiceImpl.java
@@ -3,7 +3,6 @@
import cn.hutool.core.date.DateTime;
import cn.hutool.core.date.DateUtil;
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.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
@@ -18,6 +17,7 @@
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.ObjectUtils;
import java.math.BigDecimal;
import java.text.SimpleDateFormat;
@@ -42,11 +42,10 @@
    @Autowired
    private EnumService enumService;
    public List<PerformanceShift> list = new ArrayList<>();
    @Transactional(rollbackFor = Exception.class)
    @Override
    public void performanceShiftAdd(PerformanceShiftAddDto performanceShiftAddDto) {
        List<PerformanceShift> list = new ArrayList<>();
        DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd");
        String formattedDateTime = performanceShiftAddDto.getStartWeek().format(formatter);
        String[] splitUserId = performanceShiftAddDto.getUserId().split(",");
@@ -60,22 +59,21 @@
                LocalDate lastDayOfMonth = performanceShiftAddDto.getEndWeek().toLocalDate().with(TemporalAdjusters.lastDayOfMonth());
                List<LocalDateTime> localDateTimesBetween = getLocalDateTimesBetween(firstDayOfMonth.atStartOfDay(), lastDayOfMonth.atStartOfDay());
                localDateTimesBetween.forEach(i -> {
                    for (String s : splitUserId) {
                        PerformanceShift performanceShift = new PerformanceShift();
                        performanceShift.setUserId(Integer.valueOf(s));
                    performanceShift.setUserId(Integer.valueOf(userId));
                        performanceShift.setWorkTime(i);
                        performanceShift.setShift("");
                        list.add(performanceShift);
                    }
                    if (list.size() >= 1000) {
                        baseMapper.insertBatchSomeColumn(list);
                        list.clear();
                    }
                });
            }
        }
                if (!list.isEmpty()) {
                    baseMapper.insertBatchSomeColumn(list);
                }
            }
            list.clear();
        }
        // å†æ¬¡æ›´æ–°
        List<LocalDateTime> datesBetween = getLocalDateTimesBetween(performanceShiftAddDto.getStartWeek(), performanceShiftAddDto.getEndWeek());
@@ -212,22 +210,24 @@
            for (int i = 1; i < 13; i++) {
                Map<String, Object> hashMapMonth = new LinkedHashMap<>();
                double totalMonthAttendance = 0;
                for (Enums enums : shiftType) {
                    if (!hashMapYear.containsKey(enums.getLabel())) {
                        hashMapYear.put(enums.getLabel(), 0);
                for (Enums shift : shiftType) {
                    // åˆå§‹åŒ–赋值
                    if (!hashMapYear.containsKey(shift.getLabel())) {
                        hashMapYear.put(shift.getLabel(), 0);
                    }
                    // æœˆ
                    if (ObjectUtils.isNotEmpty(map.get("month_str")) && map.get("work_time").equals(i)) {
                    if (!ObjectUtils.isEmpty(map.get("month_str"))) {
                        String charArray = map.get("month_str").toString();
                        int count = countOccurrences(charArray, i + ":" + enums.getValue());
                        hashMapMonth.put(enums.getLabel(), count);
                        hashMapYear.put(enums.getLabel(), Integer.parseInt(hashMapYear.get(enums.getLabel()).toString()) + count );
                        if (enums.getValue().equals("0") || enums.getValue().equals("1") || enums.getValue().equals("2") || enums.getValue().equals("6")) {
                        int count = countOccurrences(charArray, i + ":" + shift.getValue());
                        hashMapMonth.put(shift.getLabel(), count);
                        hashMapYear.put(shift.getLabel(), new BigDecimal(hashMapYear.get(shift.getLabel()).toString()).add(new BigDecimal(count)));
                        // æ—©ï¼Œä¸­ï¼Œå¤œï¼Œå·®
                        if (shift.getValue().equals("0") || shift.getValue().equals("1") || shift.getValue().equals("2") || shift.getValue().equals("6")) {
                            totalMonthAttendance += count;
                            totalYearAttendance += count;
                        }
                        // åŠï¼Œå¦å¤–半天算给早
                        if (enums.getValue().equals("5")) {
                        if (shift.getValue().equals("5")) {
                            BigDecimal multiply = new BigDecimal("0.5").multiply(new BigDecimal(count)).setScale(1, BigDecimal.ROUND_CEILING);
                            hashMapMonth.put(shiftType.get(0).getLabel(), new BigDecimal(hashMapMonth.get(shiftType.get(0).getLabel()).toString()).add(multiply));
                            hashMapYear.put(shiftType.get(0).getLabel(), new BigDecimal(hashMapYear.get(shiftType.get(0).getLabel()).toString()).add(multiply));
@@ -238,7 +238,7 @@
                    // ç©ºæ•°æ®
                    else {
                        map.put("work_time", i);
                        hashMapMonth.put(enums.getLabel(), 0);
                        hashMapMonth.put(shift.getLabel(), 0);
                    }
                }
                hashMapMonth.put("totalMonthAttendance", totalMonthAttendance);
@@ -313,7 +313,7 @@
        List<PerformanceShiftMapDto> mapIPage = baseMapper.performanceShiftList(time, userName, laboratory);
        mapIPage.forEach(i -> {
            String[] shiftTimes = i.getShiftTime().split(";");
            int totalAttendance = 0;
            double totalAttendance = 0;
            List<Map<String, Object>> map = new ArrayList<>();
            // åˆ†å‰²æ—¥æœŸ
            for (String shiftTime : shiftTimes) {
@@ -324,12 +324,22 @@
                        i.getMonthlyAttendance().put(enums.getLabel(), 0);
                    }
                    if (enums.getValue().equals(shiftTimeAndShift[1])) {
                        Integer num = (Integer) i.getMonthlyAttendance().get(enums.getLabel());
                        i.getMonthlyAttendance().put(enums.getLabel(), num += 1);
                        BigDecimal bigDecimal = new BigDecimal(i.getMonthlyAttendance().get(enums.getLabel()).toString());
                        i.getMonthlyAttendance().put(enums.getLabel(), bigDecimal.add(new BigDecimal("1")));
                    }
                    // åŠï¼Œå¦å¤–半天算给早
                    if (shiftTimeAndShift[1].equals("5") && enums.getValue().equals("0")) {
                        BigDecimal bigDecimal = new BigDecimal(i.getMonthlyAttendance().get(enums.getLabel()).toString());
                        i.getMonthlyAttendance().put(enums.getLabel(), bigDecimal.add(new BigDecimal("0.5")));
                    }
                }
                if (shiftTimeAndShift[1].equals("1") || shiftTimeAndShift[1].equals("2") || shiftTimeAndShift[1].equals("0")) {
                // æ—©ï¼Œä¸­ï¼Œå¤œï¼Œå·®
                if (shiftTimeAndShift[1].equals("1") || shiftTimeAndShift[1].equals("2") || shiftTimeAndShift[1].equals("0") || shiftTimeAndShift[1].equals("6")) {
                    i.getMonthlyAttendance().put("totalAttendance", totalAttendance += 1);
                }
                // åŠ
                if (shiftTimeAndShift[1].equals("5")) {
                    i.getMonthlyAttendance().put("totalAttendance", totalAttendance += 0.5);
                }
                hashMap.put("id", shiftTimeAndShift[2]);
                hashMap.put("shift", shiftTimeAndShift[1]);
@@ -400,9 +410,10 @@
    /**
     * è¿”回表头
     *
     * <p>
     * å¤–层List代表行内层 List代表列  ç›¸åŒçš„列数据会被主动合并
     * æž„造双列表头
     *
     * @return List<List<String>>
     */
    private static List<List<String>> getYearHeader(String year, List<Enums> enums){
@@ -413,13 +424,17 @@
        line.add(Arrays.asList("出勤详情", year, "出勤"));
        // å¹´ header
        for (Enums anEnum : enums) {
            if (!anEnum.getValue().equals("5")) {
            line.add(Arrays.asList("考勤汇总", year, anEnum.getLabel()));
            }
        }
        // æœˆheader
        for (int i = 1; i < 13; i++) {
            line.add(Arrays.asList("出勤详情", i + " æœˆ", "出勤"));
            for (Enums anEnum : enums) {
                if (!anEnum.getValue().equals("5")) {
                line.add(Arrays.asList("出勤详情", i + " æœˆ", anEnum.getLabel()));
                }
            }
        }
        return line;
@@ -458,12 +473,12 @@
            excelRowList.add(list.get(i).getName());
            excelRowList.add(list.get(i).getDepartment());
            excelRowList.add(list.get(i).getMonthlyAttendance().get("totalAttendance"));
            excelRowList.add(list.get(i).getMonthlyAttendance().get(enums.get(3).getLabel()));
            excelRowList.add(list.get(i).getMonthlyAttendance().get(enums.get(4).getLabel()));
            excelRowList.add(list.get(i).getMonthlyAttendance().get(enums.get(0).getLabel()));
            excelRowList.add(list.get(i).getMonthlyAttendance().get(enums.get(1).getLabel()));
            excelRowList.add(list.get(i).getMonthlyAttendance().get(enums.get(2).getLabel()));
            excelRowList.add(0); // å‡ºå·®
            excelRowList.add(list.get(i).getMonthlyAttendance().get(enums.get(3).getLabel())); // ä¼‘
            excelRowList.add(list.get(i).getMonthlyAttendance().get(enums.get(4).getLabel())); // å‡
            excelRowList.add(list.get(i).getMonthlyAttendance().get(enums.get(0).getLabel())); // æ—©
            excelRowList.add(list.get(i).getMonthlyAttendance().get(enums.get(1).getLabel())); // ä¸­
            excelRowList.add(list.get(i).getMonthlyAttendance().get(enums.get(2).getLabel())); // å¤œ
            excelRowList.add(list.get(i).getMonthlyAttendance().get(enums.get(6).getLabel())); // å·®
            for (Map<String, Object> o : list.get(i).getList()) {
                String enumLabel = "";
                for (Enums anEnum : enums) {
@@ -471,7 +486,7 @@
                        enumLabel = anEnum.getLabel();
                    }
                }
                excelRowList.add(ObjectUtils.isEmpty(enumLabel) ? "无" : enumLabel);
                excelRowList.add(ObjectUtils.isEmpty(enumLabel) ? "-" : enumLabel);
            }
            data.add(excelRowList);
        }
performance-server/src/main/java/com/yuanchu/mom/utils/StyleMonthUtils.java
@@ -13,8 +13,8 @@
        // å¤´çš„ç­–ç•¥
        WriteCellStyle headWriteCellStyle = new WriteCellStyle();
        // èƒŒæ™¯é¢œè‰²
        headWriteCellStyle.setFillForegroundColor(IndexedColors.WHITE.getIndex());
        headWriteCellStyle.setFillPatternType(FillPatternType.SOLID_FOREGROUND);
//        headWriteCellStyle.setFillForegroundColor(IndexedColors.WHITE.getIndex());
//        headWriteCellStyle.setFillPatternType(FillPatternType.SOLID_FOREGROUND);
        // å­—体
        WriteFont headWriteFont = new WriteFont();
performance-server/src/main/java/com/yuanchu/mom/utils/StyleYearUtils.java
@@ -2,15 +2,9 @@
import com.alibaba.excel.write.metadata.style.WriteCellStyle;
import com.alibaba.excel.write.metadata.style.WriteFont;
import com.yuanchu.mom.pojo.AuxiliaryOutputWorkingHours;
import org.apache.poi.ss.usermodel.*;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
import java.util.stream.Stream;
public class StyleYearUtils {
    /**
@@ -22,7 +16,7 @@
        // å¤´çš„ç­–ç•¥
        WriteCellStyle headWriteCellStyle = new WriteCellStyle();
        // èƒŒæ™¯é¢œè‰²
        headWriteCellStyle.setFillForegroundColor(IndexedColors.GREEN.getIndex());
//        headWriteCellStyle.setFillForegroundColor(IndexedColors.GREEN.getIndex());
        headWriteCellStyle.setFillPatternType(FillPatternType.SOLID_FOREGROUND);
        // å­—体
@@ -63,7 +57,7 @@
        WriteCellStyle contentWriteCellStyle = new WriteCellStyle();
        // è¿™é‡Œéœ€è¦æŒ‡å®š FillPatternType ä¸ºFillPatternType.SOLID_FOREGROUND ä¸ç„¶æ— æ³•显示背景颜色.头默认了 FillPatternType所以可以不指定
        contentWriteCellStyle.setFillForegroundColor(IndexedColors.GREY_25_PERCENT.getIndex());
//        contentWriteCellStyle.setFillForegroundColor(IndexedColors.GREY_25_PERCENT.getIndex());
        contentWriteCellStyle.setFillPatternType(FillPatternType.SOLID_FOREGROUND);
        // è®¾ç½®å­—体
@@ -73,14 +67,14 @@
        contentWriteCellStyle.setWriteFont(contentWriteFont);//在样式用应用设置的字体;
        //设置样式;
//        contentWriteCellStyle.setBorderBottom(BorderStyle.THIN);//设置底边框;
//        contentWriteCellStyle.setBottomBorderColor((short) 1);//设置底边框颜色;
        contentWriteCellStyle.setBorderBottom(BorderStyle.THIN);//设置底边框;
        contentWriteCellStyle.setBottomBorderColor((short) 0);//设置底边框颜色;
        contentWriteCellStyle.setBorderLeft(BorderStyle.THIN);  //设置左边框;
        contentWriteCellStyle.setLeftBorderColor((short) 1);//设置左边框颜色;
        contentWriteCellStyle.setLeftBorderColor((short) 0);//设置左边框颜色;
        contentWriteCellStyle.setBorderRight(BorderStyle.THIN);//设置右边框;
        contentWriteCellStyle.setRightBorderColor((short) 1);//设置右边框颜色;
        contentWriteCellStyle.setRightBorderColor((short) 0);//设置右边框颜色;
        contentWriteCellStyle.setBorderTop(BorderStyle.THIN);//设置顶边框;
        contentWriteCellStyle.setTopBorderColor((short) 1); ///设置顶边框颜色;
        contentWriteCellStyle.setTopBorderColor((short) 0); ///设置顶边框颜色;
        contentWriteCellStyle.setHorizontalAlignment(HorizontalAlignment.CENTER);// æ°´å¹³å±…中
        contentWriteCellStyle.setVerticalAlignment(VerticalAlignment.CENTER);// åž‚直居中
user-server/src/main/java/com/yuanchu/mom/controller/CompaniesController.java
@@ -1,10 +1,18 @@
package com.yuanchu.mom.controller;
import com.baomidou.mybatisplus.core.toolkit.ObjectUtils;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.yuanchu.mom.annotation.ValueAuth;
import com.yuanchu.mom.annotation.ValueClassify;
import com.yuanchu.mom.common.GetLook;
import com.yuanchu.mom.dto.PersonDto;
import com.yuanchu.mom.exception.ErrorException;
import com.yuanchu.mom.mapper.PowerMapper;
import com.yuanchu.mom.mapper.UserMapper;
import com.yuanchu.mom.pojo.Company;
import com.yuanchu.mom.pojo.Person;
import com.yuanchu.mom.pojo.Power;
import com.yuanchu.mom.pojo.User;
import com.yuanchu.mom.service.UserService;
import com.yuanchu.mom.util.HeaderToken;
import com.yuanchu.mom.vo.Result;
@@ -13,7 +21,9 @@
import lombok.AllArgsConstructor;
import org.springframework.web.bind.annotation.*;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
@RestController
@AllArgsConstructor
@@ -25,12 +35,41 @@
    private UserService userService;
    UserMapper userMapper;
    PowerMapper powerMapper;
    private GetLook getLook;
    @ValueClassify("用户管理")
    @PostMapping("/getSampleUser")
    @ApiOperation(value = "直接获取与自己相同单位的人员列表")
    public Result<?> getSampleUser(){
        return Result.success();
    }
    @ValueClassify("用户管理")
    @ApiOperation(value = "获取人事系统组织架构")
    @GetMapping(value = "/selectCompaniesList")
    public Result<List<Company>> selectCompaniesList() {
        //判断是否有直接获取第三方部门的权限
        Integer userId = getLook.selectPowerByMethodAndUserId(null).get("userId");
        User user = userMapper.selectById(userId);
        Integer roleId = user.getRoleId();
        Power power = powerMapper.selectOne(Wrappers.<Power>lambdaQuery().eq(Power::getRoleId, roleId).eq(Power::getMenuMethod, "getSampleUser"));
        if (ObjectUtils.isNotEmpty(power)){
            List<Company> companies = new ArrayList<>();
            Company company = new Company();
            if (ObjectUtils.isEmpty(user.getCompanyId())){
                throw new ErrorException("该用户没有所属单位!");
            }
            company.setCompanyId(user.getCompanyId());
            companies.add(company);
            return Result.success(companies);
        }else {
        return Result.success(headerToken.companyUrl());
    }
    }
    @ValueAuth
    @ApiOperation("获取人事系统组织下的人员")
user-server/src/main/java/com/yuanchu/mom/pojo/User.java
@@ -105,4 +105,7 @@
    @ApiModelProperty(value = "LIMS关联的部门id")
    private String departLimsId;
    @ApiModelProperty(value = "人事系统关联的id")
    private String companyId;
}
user-server/src/main/java/com/yuanchu/mom/service/UserService.java
user-server/src/main/java/com/yuanchu/mom/service/impl/UserServiceImp.java
@@ -159,6 +159,7 @@
                user.setCompany(BeanUtil.isNotEmpty(custom)?(custom.getId()+""):companyName);
                user.setAddress("未填写");
                user.setRoleId(personDto.getRoleId()>10000?0:personDto.getRoleId());
                user.setCompanyId(person.getCompanyId());
                userMapper.insert(user);
            } else {
                user.setName(person.getName());
@@ -170,6 +171,7 @@
                user.setCreateTime(null);
                user.setUpdateUser(null);
                user.setUpdateTime(null);
                user.setCompanyId(person.getCompanyId());
                userMapper.updateById(user);
            }
        });