Crunchy
2024-05-23 8267cbdb4dc96787e245a794f7ec6b4cadf7d532
Merge remote-tracking branch 'origin/master'
已修改16个文件
已添加5个文件
430 ■■■■ 文件已修改
cnas-server/src/main/java/com/yuanchu/mom/controller/DepartmentController.java 53 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
cnas-server/src/main/java/com/yuanchu/mom/mapper/DepartmentLimsMapper.java 27 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
cnas-server/src/main/java/com/yuanchu/mom/mapper/DepartmentMapper.java 12 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
cnas-server/src/main/java/com/yuanchu/mom/pojo/DepartmentLims.java 38 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
cnas-server/src/main/java/com/yuanchu/mom/service/DepartmentLimsService.java 25 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
cnas-server/src/main/java/com/yuanchu/mom/service/DepartmentService.java 11 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
cnas-server/src/main/java/com/yuanchu/mom/service/impl/DepartmentLimsServiceImpl.java 86 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
cnas-server/src/main/java/com/yuanchu/mom/service/impl/DepartmentServiceImpl.java 44 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
cnas-server/src/main/resources/mapper/DepartmentLimsMapper.xml 34 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
cnas-server/src/main/resources/mapper/DepartmentMapper.xml 11 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
inspect-server/src/main/java/com/yuanchu/mom/pojo/InsUnPass.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
inspect-server/src/main/java/com/yuanchu/mom/service/impl/InsOrderPlanServiceImpl.java 12 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
inspect-server/src/main/java/com/yuanchu/mom/service/impl/InsOrderServiceImpl.java 7 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
inspect-server/src/main/resources/mapper/InsOrderMapper.xml 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
inspect-server/src/main/resources/static/report-template.docx 补丁 | 查看 | 原始文档 | blame | 历史
user-server/src/main/java/com/yuanchu/mom/controller/UserController.java 15 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
user-server/src/main/java/com/yuanchu/mom/dto/UserPageDto.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
user-server/src/main/java/com/yuanchu/mom/pojo/User.java 9 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
user-server/src/main/java/com/yuanchu/mom/service/UserService.java 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
user-server/src/main/java/com/yuanchu/mom/service/impl/UserServiceImp.java 35 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
user-server/src/main/resources/mapper/UserMapper.xml 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
cnas-server/src/main/java/com/yuanchu/mom/controller/DepartmentController.java
@@ -1,23 +1,19 @@
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.UserDto;
import com.yuanchu.mom.pojo.Department;
import com.yuanchu.mom.pojo.DepartmentLims;
import com.yuanchu.mom.service.DepartmentLimsService;
import com.yuanchu.mom.service.DepartmentService;
import com.yuanchu.mom.utils.JackSonUtil;
import com.yuanchu.mom.vo.Result;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.AllArgsConstructor;
import org.springframework.web.bind.annotation.*;
import java.util.Map;
/**
 * <p>
 * éƒ¨é—¨æ˜Žç»† å‰ç«¯æŽ§åˆ¶å™¨
 * ç»„织架构明细 å‰ç«¯æŽ§åˆ¶å™¨
 * </p>
 *
 * @author æ±Ÿè‹éµ·é›ç½‘络科技有限公司
@@ -29,32 +25,47 @@
@RequestMapping("/department")
public class DepartmentController {
    DepartmentService departmentService;
    @ValueClassify("人员明细")
    @ApiOperation(value = "添加部门")
    private DepartmentService departmentService;
    private DepartmentLimsService departmentLimsService;
    @ValueClassify("用户管理")
    @ApiOperation(value = "添加组织架构")
    @PostMapping("/addDepartment")
    public Result addDepartment(@RequestBody Department department) {
        return Result.success(departmentService.addDepartment(department));
    }
    @ApiOperation(value = "获取部门树")
    @ApiOperation(value = "获取组织架构树")
    @GetMapping("/selectDepartment")
    @ValueClassify("人员明细")
    @ValueClassify("用户管理")
    public Result selectDepartment() {
        return Result.success(departmentService.selectDepartment());
    }
    @ValueClassify("人员明细")
    @ApiOperation(value = "删除部门")
    @ValueClassify("用户管理")
    @ApiOperation(value = "删除组织架构")
    @PostMapping("/delDepartment")
    public Result delDepartment(Integer id) {
        return Result.success(departmentService.delDepartment(id));
    }
    @ValueAuth
    @ApiOperation(value = "根据选择的树展示相关的人员")
    @PostMapping("/showUserById")
    public Result showUserById(@RequestBody Map<String, Object> data) throws Exception {
        Page page = JackSonUtil.unmarshal(JackSonUtil.marshal(data.get("page")), Page.class);
        UserDto user = JackSonUtil.unmarshal(JackSonUtil.marshal(data.get("entity")), UserDto.class);
        return Result.success(departmentService.showUserById(page, user));
    @ValueClassify("人员明细")
    @ApiOperation(value = "获取组织架构树")
    @GetMapping("/selectDepartmentLim")
    public Result selectDepartmentLim() {
        return Result.success(departmentLimsService.selectDepartment());
    }
    @ValueClassify("人员明细")
    @ApiOperation(value = "添加组织架构")
    @PostMapping("/addDepartmentLims")
    public Result addDepartmentLims(@RequestBody DepartmentLims department) {
        return Result.success(departmentLimsService.addDepartment(department));
    }
    @ValueClassify("人员明细")
    @ApiOperation(value = "删除组织架构")
    @PostMapping("/delDepartmentLims")
    public Result delDepartmentLims(Integer id) {
        return Result.success(departmentLimsService.delDepartment(id));
    }
}
cnas-server/src/main/java/com/yuanchu/mom/mapper/DepartmentLimsMapper.java
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,27 @@
package com.yuanchu.mom.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.yuanchu.mom.dto.DepartmentDto;
import com.yuanchu.mom.pojo.DepartmentLims;
import java.util.List;
/**
* @author z1292
* @description é’ˆå¯¹è¡¨ã€department_lims(部门明细)】的数据库操作Mapper
* @createDate 2024-05-22 14:08:17
* @Entity com.yuanchu.mom.pojo.DepartmentLims
*/
public interface DepartmentLimsMapper extends BaseMapper<DepartmentLims> {
    //获取部门树
    List<DepartmentDto> selectDepartment();
    //根据部门id,查询他的所有子类id
    List<Integer> selectSonById(Integer id);
}
cnas-server/src/main/java/com/yuanchu/mom/mapper/DepartmentMapper.java
@@ -1,12 +1,8 @@
package com.yuanchu.mom.mapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.yuanchu.mom.dto.DepartmentDto;
import com.yuanchu.mom.dto.UserDto;
import com.yuanchu.mom.mybatis_config.MyBaseMapper;
import com.yuanchu.mom.pojo.Department;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
@@ -18,15 +14,11 @@
 * @author æ±Ÿè‹éµ·é›ç½‘络科技有限公司
 * @since 2024-04-15 04:01:48
 */
public interface DepartmentMapper extends BaseMapper<Department> {
public interface DepartmentMapper extends MyBaseMapper<Department> {
    //获取部门树
    List<DepartmentDto> selectDepartment();
    //根据选择的树展示相关的人员
    IPage<UserDto> showUserById(@Param("page") IPage<UserDto> page, @Param("ids") List<String> ids, @Param("ew") QueryWrapper<UserDto> ew);
    //根据部门id,查询他的所有子类id
    List<Integer> selectSonById(Integer id);
cnas-server/src/main/java/com/yuanchu/mom/pojo/DepartmentLims.java
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,38 @@
package com.yuanchu.mom.pojo;
import com.baomidou.mybatisplus.annotation.*;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.io.Serializable;
import java.time.LocalDateTime;
/**
 * éƒ¨é—¨æ˜Žç»†
 * @TableName department_lims
 */
@TableName(value ="department_lims")
@Data
public class DepartmentLims implements Serializable {
    @TableId(value = "id", type = IdType.AUTO)
    private Integer id;
    @ApiModelProperty("名称")
    private String name;
    @ApiModelProperty("父级id")
    private Integer fatherId;
    @TableField(fill = FieldFill.INSERT)
    private Integer createUser;
    @TableField(fill = FieldFill.INSERT)
    private LocalDateTime createTime;
    @TableField(fill = FieldFill.INSERT_UPDATE)
    private Integer updateUser;
    @TableField(fill = FieldFill.INSERT_UPDATE)
    private LocalDateTime updateTime;
}
cnas-server/src/main/java/com/yuanchu/mom/service/DepartmentLimsService.java
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,25 @@
package com.yuanchu.mom.service;
import com.baomidou.mybatisplus.extension.service.IService;
import com.yuanchu.mom.dto.DepartmentDto;
import com.yuanchu.mom.pojo.DepartmentLims;
import java.util.List;
/**
* @author z1292
* @description é’ˆå¯¹è¡¨ã€department_lims(部门明细)】的数据库操作Service
* @createDate 2024-05-22 14:08:17
*/
public interface DepartmentLimsService extends IService<DepartmentLims> {
    //添加部门
    int addDepartment(DepartmentLims departmentLims);
    //获取部门树
    List<DepartmentDto> selectDepartment();
    //删除部门
    boolean delDepartment(Integer id);
}
cnas-server/src/main/java/com/yuanchu/mom/service/DepartmentService.java
@@ -1,14 +1,10 @@
package com.yuanchu.mom.service;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yuanchu.mom.dto.DepartmentDto;
import com.yuanchu.mom.dto.UserDto;
import com.yuanchu.mom.pojo.Department;
import com.baomidou.mybatisplus.extension.service.IService;
import com.yuanchu.mom.pojo.User;
import com.yuanchu.mom.dto.DepartmentDto;
import com.yuanchu.mom.pojo.Department;
import java.util.List;
import java.util.Map;
/**
 * <p>
@@ -28,7 +24,4 @@
    //删除部门
    boolean delDepartment(Integer id);
    //根据选择的树展示相关的人员
    Map<String, Object> showUserById(Page page, UserDto user);
}
cnas-server/src/main/java/com/yuanchu/mom/service/impl/DepartmentLimsServiceImpl.java
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,86 @@
package com.yuanchu.mom.service.impl;
import com.baomidou.mybatisplus.core.toolkit.ObjectUtils;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.yuanchu.mom.dto.DepartmentDto;
import com.yuanchu.mom.mapper.DepartmentLimsMapper;
import com.yuanchu.mom.pojo.DepartmentLims;
import com.yuanchu.mom.service.DepartmentLimsService;
import lombok.AllArgsConstructor;
import org.springframework.stereotype.Service;
import java.util.ArrayList;
import java.util.List;
import java.util.Objects;
import java.util.stream.Collectors;
/**
* @author z1292
* @description é’ˆå¯¹è¡¨ã€department_lims(部门明细)】的数据库操作Service实现
* @createDate 2024-05-22 14:08:17
*/
@Service
@AllArgsConstructor
public class DepartmentLimsServiceImpl extends ServiceImpl<DepartmentLimsMapper, DepartmentLims>
    implements DepartmentLimsService{
    DepartmentLimsMapper departmentMapper;
    @Override
    public int addDepartment(DepartmentLims department) {
        departmentMapper.insert(department);
        return department.getId();
    }
    //获取部门树
    @Override
    public List<DepartmentDto> selectDepartment() {
        List<DepartmentDto> departments = departmentMapper.selectDepartment();
        //获取父节点
        List<DepartmentDto> collect = departments.stream().filter(m -> m.getFatherId() == null).peek(
                (m) -> m.setChildren(getChildren(m, departments))
        ).collect(Collectors.toList());
        return collect;
    }
    /**
     * é€’归查询子节点
     * @param root  æ ¹èŠ‚ç‚¹
     * @param all   æ‰€æœ‰èŠ‚ç‚¹
     * @return æ ¹èŠ‚ç‚¹ä¿¡æ¯
     */
    private List<DepartmentDto> getChildren(DepartmentDto root, List<DepartmentDto> all) {
        return all.stream().filter(m -> Objects.equals(m.getFatherId(), root.getId())).peek(
                (m) -> m.setChildren(getChildren(m, all))
        ).collect(Collectors.toList());
    }
    //删除部门
    @Override
    public boolean delDepartment(Integer id) {
        //判断是否有子类,直到没有为止
        List<DepartmentLims> department = getDepartment(id);
        return removeBatchByIds(department);
    }
    //判断是否有子类,直到没有为止
    public List<DepartmentLims> getDepartment(Integer id) {
        List<DepartmentLims> list = new ArrayList<>();
        DepartmentLims depart = baseMapper.selectById(id);
        list.add(depart);
        List<DepartmentLims> departments = baseMapper.selectList(Wrappers.<DepartmentLims>lambdaQuery().eq(DepartmentLims::getFatherId, id));
        if (ObjectUtils.isNotEmpty(departments)) {
            list.addAll(departments);
            for (DepartmentLims department : departments) {
                list.addAll(getDepartment(department.getId()));
            }
        }
        return list;
    }
}
cnas-server/src/main/java/com/yuanchu/mom/service/impl/DepartmentServiceImpl.java
@@ -2,30 +2,19 @@
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.PrintChina;
import com.yuanchu.mom.dto.DepartmentDto;
import com.yuanchu.mom.dto.UserDto;
import com.yuanchu.mom.dto.UserPageDto;
import com.yuanchu.mom.pojo.Department;
import com.yuanchu.mom.mapper.DepartmentMapper;
import com.yuanchu.mom.pojo.Device;
import com.yuanchu.mom.pojo.User;
import com.yuanchu.mom.service.DepartmentService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.yuanchu.mom.utils.QueryWrappers;
import com.yuanchu.mom.dto.DepartmentDto;
import com.yuanchu.mom.mapper.DepartmentMapper;
import com.yuanchu.mom.pojo.Department;
import com.yuanchu.mom.service.DepartmentService;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import lombok.var;
import org.springframework.beans.BeanUtils;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.SQLException;
import java.sql.Wrapper;
import java.util.*;
import java.util.ArrayList;
import java.util.List;
import java.util.Objects;
import java.util.stream.Collectors;
/**
@@ -43,6 +32,8 @@
public class DepartmentServiceImpl extends ServiceImpl<DepartmentMapper, Department> implements DepartmentService {
    DepartmentMapper departmentMapper;
    //添加部门
@@ -82,23 +73,6 @@
        List<Department> department = getDepartment(id);
        return removeBatchByIds(department);
    }
    //根据选择的树展示相关的人员
    @Override
    public Map<String, Object> showUserById(Page page, UserDto user) {
        //根据部门id,查询他的所有子类id
        List<Integer> list = departmentMapper.selectSonById(Integer.parseInt(user.getDepartId()));
        List<String> ids = list.stream()
                .map(Object::toString)
                //.collect(Collectors.joining(","));
                .collect(Collectors.toList());
        log.info(ids+"\n");
        Map<String, Object> map = new HashMap<>();
        map.put("head", PrintChina.printChina(UserDto.class));
        map.put("body", departmentMapper.showUserById(page, ids, QueryWrappers.queryWrappers(user)));
        return map;
    }
    //判断是否有子类,直到没有为止
    public List<Department> getDepartment(Integer id) {
cnas-server/src/main/resources/mapper/DepartmentLimsMapper.xml
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,34 @@
<?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.DepartmentLimsMapper">
    <resultMap id="BaseResultMap" type="com.yuanchu.mom.pojo.DepartmentLims">
            <id property="id" column="id" jdbcType="INTEGER"/>
            <result property="name" column="name" jdbcType="VARCHAR"/>
            <result property="fatherId" column="father_id" jdbcType="INTEGER"/>
            <result property="createUser" column="create_user" jdbcType="INTEGER"/>
            <result property="createTime" column="create_time" jdbcType="TIMESTAMP"/>
            <result property="updateUser" column="update_user" jdbcType="INTEGER"/>
            <result property="updateTime" column="update_time" jdbcType="TIMESTAMP"/>
    </resultMap>
    <select id="selectDepartment" resultType="com.yuanchu.mom.dto.DepartmentDto">
        SELECT id, name, father_id
        FROM department_lims
    </select>
    <select id="selectSonById" resultType="java.lang.Integer">
        SELECT au.id
        FROM (SELECT * FROM department_lims WHERE father_id IS NOT NULL) au,
             (SELECT @father_id := #{id}) pd
        WHERE FIND_IN_SET(father_id, @father_id) > 0
                  AND @father_id := concat(@father_id, ',', id)
        UNION
        SELECT id
        FROM department_lims
        WHERE id = #{id}
        ORDER BY id
    </select>
</mapper>
cnas-server/src/main/resources/mapper/DepartmentMapper.xml
@@ -6,17 +6,6 @@
        FROM department
    </select>
    <select id="showUserById" resultType="com.yuanchu.mom.dto.UserDto">
        select * from (select id, name, age, email, phone,depart_id
        from user where state=1 and SUBSTRING_INDEX(depart_id, ',', -1) in
        <foreach collection="ids" item="id" separator="," open="(" close=")">
            #{id}
        </foreach> ) a
        <if test="ew.customSqlSegment != null and ew.customSqlSegment != ''">
            ${ew.customSqlSegment}
        </if>
    </select>
    <select id="selectSonById" resultType="java.lang.Integer">
        SELECT au.id
        FROM (SELECT * FROM department WHERE father_id IS NOT NULL) au,
inspect-server/src/main/java/com/yuanchu/mom/pojo/InsUnPass.java
@@ -61,7 +61,7 @@
    /**
     * ç”¨æˆ·å
     */
    @ValueTableShow(value = 9, name = "用户名")
    @ValueTableShow(value = 9, name = "检验人")
    private String name;
    @TableField(fill = FieldFill.INSERT)
inspect-server/src/main/java/com/yuanchu/mom/service/impl/InsOrderPlanServiceImpl.java
@@ -410,8 +410,6 @@
                                    delRSet.add(jo1.get("r") + "");
                                }
                            }
                        } else {
                            if ("参数".equals(v.get("v"))) delSet.add(jo1.get("c") + "");
                        }
                    }
                    for (int i = 0; i < temp.size(); i++) {
@@ -504,7 +502,6 @@
                        }
                        Style style = new Style();
                        style.setFontFamily(v.get("ff") == null ? "微软雅黑" : v.get("ff") + "");
//                        style.setFontSize(v.get("fs")==null?14:Integer.parseInt(v.get("fs")+""));
                        if (!((v.get("fc") + "").indexOf("rgb") > -1)) {
                            style.setColor(v.get("fc") == null ? "000000" : (v.get("fc") + "").replace("#", ""));
                        } else {
@@ -512,13 +509,10 @@
                        }
                        textRenderData.setStyle(style);
                        text.add(textRenderData);
                        if (i == temp.size() - 1) {
                            TextRenderData[] text2 = text.toArray(new TextRenderData[0]);
                            rowRenderData = Rows.of(text2).rowAtleastHeight(1).center().create();
                            rows.add(rowRenderData);
                            text = new ArrayList<>();
                        }
                    }
                    TextRenderData[] text2 = text.toArray(new TextRenderData[0]);
                    rowRenderData = Rows.of(text2).rowAtleastHeight(1).center().create();
                    rows.add(rowRenderData);
                    TableRenderData tableRenderData = new TableRenderData();
                    tableRenderData.setRows(rows);
                    TableStyle tableStyle = new TableStyle();
inspect-server/src/main/java/com/yuanchu/mom/service/impl/InsOrderServiceImpl.java
@@ -12,6 +12,7 @@
import com.yuanchu.mom.dto.SampleOrderDto;
import com.yuanchu.mom.dto.SampleProductDto;
import com.yuanchu.mom.dto.SampleProductDto2;
import com.yuanchu.mom.exception.ErrorException;
import com.yuanchu.mom.mapper.*;
import com.yuanchu.mom.pojo.*;
import com.yuanchu.mom.service.InsOrderService;
@@ -81,7 +82,11 @@
        for (InsProduct insProduct : insProducts) {
            InsOrderState insOrderState = new InsOrderState();
            insOrderState.setInsOrderId(orderId);
            insOrderState.setLaboratory(insProduct.getSonLaboratory());
            try {
                insOrderState.setLaboratory(insProduct.getSonLaboratory());
            }catch (NullPointerException e){
                throw new ErrorException("该检验单有未维护实验室的检验项目");
            }
            insOrderState.setInsState(0);
            insOrderStateMapper.insert(insOrderState);
        }
inspect-server/src/main/resources/mapper/InsOrderMapper.xml
@@ -159,6 +159,7 @@
        inspection_item from (select *,GROUP_CONCAT(inspection_item
        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
        <if test="ew.customSqlSegment != null and ew.customSqlSegment != ''">
            ${ew.customSqlSegment}
inspect-server/src/main/resources/static/report-template.docx
Binary files differ
user-server/src/main/java/com/yuanchu/mom/controller/UserController.java
@@ -181,4 +181,19 @@
    public Result<?> upUserPassword(String oldPassword, String newPassWord){
        return Result.success(userService.upUserPassword(oldPassword, newPassWord));
    }
    @ValueClassify("人员明细")
    @PostMapping("/upUserDepardLimsId")
    @ApiOperation(value = "修改人员明细所在组织架构")
    public Result<?> upUserDepardLimsId(String ids, String id){
        return Result.success(userService.upUserDepardLimsId(ids, id));
    }
    @ValueClassify("人员明细")
    @PostMapping("/delUserDepardLimsId")
    @ApiOperation(value = "删除人员明细所在组织架构")
    public Result<?> delUserDepardLimsId(Integer id){
        return Result.success(userService.delUserDepardLimsId(id));
    }
}
user-server/src/main/java/com/yuanchu/mom/dto/UserPageDto.java
@@ -18,7 +18,7 @@
    @ApiModelProperty(value = "更新用户")
    private String updateUserName;
    @ValueTableShow(1)
    @ValueTableShow(3)
    @ApiModelProperty(value = "角色")
    private String roleName;
user-server/src/main/java/com/yuanchu/mom/pojo/User.java
@@ -24,14 +24,14 @@
    @TableId(type = IdType.AUTO)
    private Integer id;
    @ValueTableShow(1)
    @ValueTableShow(2)
    @ApiModelProperty(value = "账号")
    private String account;
    @ApiModelProperty(value = "密码")
    private String password;
    @ValueTableShow(2)
    @ValueTableShow(1)
    @ApiModelProperty(value = "姓名")
    private String name;
@@ -89,13 +89,11 @@
    /**
     * ç­¾åç…§ç‰‡åœ°å€
     */
    @ValueTableShow(value = 12,name = "签名照片地址")
    private String signatureUrl;
    /**
     * è‡ªèº«ç…§ç‰‡åœ°å€
     */
    @ValueTableShow(value = 13,name = "自身照片地址")
    private String pictureUrl;
    /**
@@ -104,4 +102,7 @@
    @ApiModelProperty(value = "关联的部门id")
    private String departId;
    @ApiModelProperty(value = "LIMS关联的部门id")
    private String departLimsId;
}
user-server/src/main/java/com/yuanchu/mom/service/UserService.java
@@ -37,4 +37,8 @@
    int addPersonUser(PersonDto personDto);
    int upUserDepardLimsId(String ids, String id);
    int delUserDepardLimsId(Integer id);
}
user-server/src/main/java/com/yuanchu/mom/service/impl/UserServiceImp.java
@@ -1,6 +1,7 @@
package com.yuanchu.mom.service.impl;
import cn.hutool.core.bean.BeanUtil;
import com.alibaba.fastjson.JSON;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
@@ -21,6 +22,7 @@
import org.springframework.util.DigestUtils;
import javax.annotation.Resource;
import java.time.LocalDateTime;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
@@ -77,13 +79,13 @@
    @Override
    public int updateUser(User user) {
        user.setDepartId("1,"+user.getDepartId());
        user.setDepartId("1," + user.getDepartId());
        return userMapper.updateById(user);
    }
    @Override
    public int addUser(User user) {
        user.setDepartId("1,"+user.getDepartId());
        user.setDepartId("1");
        return userMapper.insert(user);
    }
@@ -126,44 +128,44 @@
    public int addPersonUser(PersonDto personDto) {
        AtomicReference<String> departId = new AtomicReference<>("");
        AtomicReference<String> companyName = new AtomicReference<>();
        personDto.getCompany().forEach(company->{
        personDto.getCompany().forEach(company -> {
            Departments department = departmentsMapper.selectOne(Wrappers.<Departments>lambdaQuery().eq(Departments::getCompanyId, company.getCompanyId()));
            if(BeanUtil.isEmpty(department)){
            if (BeanUtil.isEmpty(department)) {
                department = new Departments();
                department.setName(company.getCompanyName());
                department.setCompanyId(company.getCompanyId());
                Departments department2 = departmentsMapper.selectOne(Wrappers.<Departments>lambdaQuery().eq(Departments::getCompanyId, company.getParentCompanyId()));
                if(BeanUtil.isEmpty(department2)){
                if (BeanUtil.isEmpty(department2)) {
                    department.setFatherId(1);
                }else{
                } else {
                    department.setFatherId(department2.getId());
                }
                departmentsMapper.insert(department);
            }
            departId.set(departId.get()+department.getId()+",");
            departId.set(departId.get() + department.getId() + ",");
            companyName.set(department.getName());
        });
        personDto.getPerson().forEach(person -> {
            User user = userMapper.selectOne(Wrappers.<User>lambdaQuery().eq(User::getAccount, person.getEmployeeID()));
            if(BeanUtil.isEmpty(user)){
            if (BeanUtil.isEmpty(user)) {
                user = new User();
                user.setName(person.getName());
                user.setNameEn("not write");
                user.setAccount(person.getEmployeeID());
                user.setPhone(person.getPhoneNumber());
                user.setEmail(person.getCompanyEmail());
                user.setIsCustom(person.getCompanyId().equals("SC2463")?0:1);
                user.setIsCustom(person.getCompanyId().equals("SC2463") ? 0 : 1);
                user.setDepartId(departId.get());
//                user.setPassword(DigestUtils.md5DigestAsHex(headerToken.getPassword(person.getEmployeeID()).getBytes()));
                user.setPassword(DigestUtils.md5DigestAsHex("123456".getBytes()));
                user.setCompany(companyName.get());
                user.setAddress("未填写");
                userMapper.insert(user);
            }else{
            } else {
                user.setName(person.getName());
                user.setPhone(person.getPhoneNumber());
                user.setEmail(person.getCompanyEmail());
                user.setIsCustom(person.getCompanyId().equals("SC2463")?0:1);
                user.setIsCustom(person.getCompanyId().equals("SC2463") ? 0 : 1);
                user.setDepartId(departId.get());
                user.setCompany(companyName.get());
                user.setCreateUser(null);
@@ -175,4 +177,15 @@
        });
        return 1;
    }
    @Override
    public int upUserDepardLimsId(String ids, String id) {
        List<Integer> userIds = JSON.parseArray(ids, Integer.class);
        return userMapper.update(null, Wrappers.<User>lambdaUpdate().in(User::getId, userIds).set(User::getDepartLimsId, id).set(User::getUpdateTime, LocalDateTime.now()).set(User::getUpdateUser, getLook.selectPowerByMethodAndUserId(null).get("userId")));
    }
    @Override
    public int delUserDepardLimsId(Integer id) {
        return userMapper.update(null, Wrappers.<User>lambdaUpdate().eq(User::getId, id).set(User::getDepartLimsId, null).set(User::getUpdateTime, LocalDateTime.now()).set(User::getUpdateUser, getLook.selectPowerByMethodAndUserId(null).get("userId")));
    }
}
user-server/src/main/resources/mapper/UserMapper.xml
@@ -6,7 +6,7 @@
        select u1.id, u1.account, u1.name, u1.state, u1.create_time, u1.update_time, u1.create_user, u1.update_user,
        u1.age, u1.email, u1.phone, u1.department, u1.company, u1.address, u1.is_custom, u1.role_id, u2.name
        create_user_name, u3.name update_user_name, r.name role_name,u1.signature_url,u1.picture_url,u1.depart_id,
        u1.name_en
        u1.name_en,u1.depart_lims_id
        from user u1
        left join user u2 on u2.id = u1.create_user
        left join user u3 on u3.id = u1.update_user