| | |
| | | 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 æ±èéµ·éç½ç»ç§ææéå
¬å¸ |
| | |
| | | @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)); |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | 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); |
| | | |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | |
| | | 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; |
| | | |
| | |
| | | * @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); |
¶Ô±ÈÐÂÎļþ |
| | |
| | | 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; |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | 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); |
| | | |
| | | } |
| | |
| | | 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> |
| | |
| | | |
| | | //å é¤é¨é¨ |
| | | boolean delDepartment(Integer id); |
| | | |
| | | //æ ¹æ®éæ©çæ å±ç¤ºç¸å
³ç人å |
| | | Map<String, Object> showUserById(Page page, UserDto user); |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | 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; |
| | | } |
| | | |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | |
| | | |
| | | 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; |
| | | |
| | | /** |
| | |
| | | public class DepartmentServiceImpl extends ServiceImpl<DepartmentMapper, Department> implements DepartmentService { |
| | | |
| | | DepartmentMapper departmentMapper; |
| | | |
| | | |
| | | |
| | | |
| | | //æ·»å é¨é¨ |
| | |
| | | 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) { |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <?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> |
| | |
| | | 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, |
| | |
| | | /** |
| | | * ç¨æ·å |
| | | */ |
| | | @ValueTableShow(value = 9, name = "ç¨æ·å") |
| | | @ValueTableShow(value = 9, name = "æ£éªäºº") |
| | | private String name; |
| | | |
| | | @TableField(fill = FieldFill.INSERT) |
| | |
| | | delRSet.add(jo1.get("r") + ""); |
| | | } |
| | | } |
| | | } else { |
| | | if ("åæ°".equals(v.get("v"))) delSet.add(jo1.get("c") + ""); |
| | | } |
| | | } |
| | | for (int i = 0; i < temp.size(); i++) { |
| | |
| | | } |
| | | 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 { |
| | |
| | | } |
| | | 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(); |
| | |
| | | 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; |
| | |
| | | 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); |
| | | } |
| | |
| | | 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} |
| | |
| | | UserPageDto user = JackSonUtil.unmarshal(JackSonUtil.marshal(data.get("entity")), UserPageDto.class); |
| | | return Result.success(userService.selectUserList(page, user)); |
| | | } |
| | | |
| | | @ValueClassify("ç¨æ·ç®¡ç") |
| | | @ApiOperation(value = "ä¿®æ¹ç¨æ·ä¿¡æ¯") |
| | | @PostMapping("/updateUser") |
| | |
| | | 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)); |
| | | } |
| | | |
| | | } |
| | |
| | | @ApiModelProperty(value = "æ´æ°ç¨æ·") |
| | | private String updateUserName; |
| | | |
| | | @ValueTableShow(1) |
| | | @ValueTableShow(3) |
| | | @ApiModelProperty(value = "è§è²") |
| | | private String roleName; |
| | | |
| | |
| | | @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; |
| | | |
| | |
| | | /** |
| | | * ç¾åç
§çå°å |
| | | */ |
| | | @ValueTableShow(value = 12,name = "ç¾åç
§çå°å") |
| | | private String signatureUrl; |
| | | |
| | | /** |
| | | * èªèº«ç
§çå°å |
| | | */ |
| | | @ValueTableShow(value = 13,name = "èªèº«ç
§çå°å") |
| | | private String pictureUrl; |
| | | |
| | | /** |
| | |
| | | @ApiModelProperty(value = "å
³èçé¨é¨id") |
| | | private String departId; |
| | | |
| | | @ApiModelProperty(value = "LIMSå
³èçé¨é¨id") |
| | | private String departLimsId; |
| | | |
| | | } |
| | |
| | | |
| | | int addPersonUser(PersonDto personDto); |
| | | |
| | | int upUserDepardLimsId(String ids, String id); |
| | | |
| | | int delUserDepardLimsId(Integer id); |
| | | |
| | | } |
| | |
| | | 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; |
| | |
| | | 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; |
| | |
| | | |
| | | @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); |
| | | } |
| | | |
| | |
| | | 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); |
| | |
| | | }); |
| | | 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"))); |
| | | } |
| | | } |
| | |
| | | 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 |