Commit 8e632b90 authored by wdy's avatar wdy

Merge branch 'wangdingyi' into 'dev'

用户签字图片&根据标准查询检验项

See merge request !323
parents f2bcfc68 71a2b77b
...@@ -2,8 +2,13 @@ package com.ruoyi.service; ...@@ -2,8 +2,13 @@ package com.ruoyi.service;
import com.baomidou.mybatisplus.extension.service.IService; import com.baomidou.mybatisplus.extension.service.IService;
import com.ruoyi.domain.StandardInspectionItemRelation; import com.ruoyi.domain.StandardInspectionItemRelation;
import com.ruoyi.domain.vo.DictDataVO;
import java.util.List;
public interface StandardInspectionItemRelationService extends IService<StandardInspectionItemRelation> { public interface StandardInspectionItemRelationService extends IService<StandardInspectionItemRelation> {
List<DictDataVO> getByStandardId(Long standardId);
} }
...@@ -2,15 +2,25 @@ package com.ruoyi.service.impl; ...@@ -2,15 +2,25 @@ package com.ruoyi.service.impl;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.ruoyi.domain.StandardInspectionItemRelation; import com.ruoyi.domain.StandardInspectionItemRelation;
import com.ruoyi.domain.vo.DictDataVO;
import com.ruoyi.mapper.StandardInspectionItemRelationMapper; import com.ruoyi.mapper.StandardInspectionItemRelationMapper;
import com.ruoyi.service.StandardInspectionItemRelationService; import com.ruoyi.service.StandardInspectionItemRelationService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
import java.util.List;
@Transactional @Transactional
@Service @Service
public class StandardInspectionItemRelationServiceImpl extends ServiceImpl<StandardInspectionItemRelationMapper, StandardInspectionItemRelation> implements StandardInspectionItemRelationService { public class StandardInspectionItemRelationServiceImpl extends ServiceImpl<StandardInspectionItemRelationMapper, StandardInspectionItemRelation> implements StandardInspectionItemRelationService {
@Autowired
private StandardInspectionItemRelationMapper standardInspectionItemRelationMapper;
@Override
public List<DictDataVO> getByStandardId(Long standardId) {
return standardInspectionItemRelationMapper.getListByStandardId(standardId);
}
} }
...@@ -63,7 +63,7 @@ public class StandardServiceImpl extends ServiceImpl<StandardMapper, Standard> i ...@@ -63,7 +63,7 @@ public class StandardServiceImpl extends ServiceImpl<StandardMapper, Standard> i
List<StandardInspectionItemRelation> list = standardInspectionItemRelationMapper.getListByStandard(request.getId()); List<StandardInspectionItemRelation> list = standardInspectionItemRelationMapper.getListByStandard(request.getId());
if (list != null && list.size() != 0) { if (list != null && list.size() != 0) {
standardInspectionItemRelationMapper.deleteBatchIds(list); standardInspectionItemRelationService.removeBatchByIds(list);
} }
List<DictDataVO> relations = request.getDictList(); List<DictDataVO> relations = request.getDictList();
......
...@@ -7,6 +7,8 @@ import com.ruoyi.common.core.domain.R; ...@@ -7,6 +7,8 @@ import com.ruoyi.common.core.domain.R;
import com.ruoyi.common.core.page.TableDataInfo; import com.ruoyi.common.core.page.TableDataInfo;
import com.ruoyi.common.enums.BusinessType; import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.domain.Standard; import com.ruoyi.domain.Standard;
import com.ruoyi.domain.vo.DictDataVO;
import com.ruoyi.service.StandardInspectionItemRelationService;
import com.ruoyi.service.StandardService; import com.ruoyi.service.StandardService;
import com.ruoyi.web.request.*; import com.ruoyi.web.request.*;
import com.ruoyi.web.response.StandardResponse; import com.ruoyi.web.response.StandardResponse;
...@@ -30,6 +32,9 @@ public class StandardController extends BaseController { ...@@ -30,6 +32,9 @@ public class StandardController extends BaseController {
@Autowired @Autowired
private StandardService standardService; private StandardService standardService;
@Autowired
private StandardInspectionItemRelationService standardInspectionItemRelationService;
/** /**
* 分页查询 * 分页查询
* @return * @return
...@@ -62,4 +67,13 @@ public class StandardController extends BaseController { ...@@ -62,4 +67,13 @@ public class StandardController extends BaseController {
StandardResponse response = standardService.getInfo(request); StandardResponse response = standardService.getInfo(request);
return R.ok(response); return R.ok(response);
} }
@ApiOperation("根据标准查询检验项")
@Trace
@Tags({@Tag(key = "param", value = "arg[0]"), @Tag(key = "result", value = "returnedObj")})
@RequestMapping(method = RequestMethod.POST, value = "/getByStandardId")
public TableDataInfo<DictDataVO> getByStandardId(@Validated @RequestBody StandardGetInfoRequest request) {
return getDataTable(standardInspectionItemRelationService.getByStandardId(request.getId()));
}
} }
...@@ -65,6 +65,7 @@ public class SysProfileController extends BaseController ...@@ -65,6 +65,7 @@ public class SysProfileController extends BaseController
currentUser.setEmail(user.getEmail()); currentUser.setEmail(user.getEmail());
currentUser.setPhonenumber(user.getPhonenumber()); currentUser.setPhonenumber(user.getPhonenumber());
currentUser.setSex(user.getSex()); currentUser.setSex(user.getSex());
currentUser.setSignaturePicture(user.getSignaturePicture());
if (StringUtils.isNotEmpty(user.getPhonenumber()) && !userService.checkPhoneUnique(currentUser)) if (StringUtils.isNotEmpty(user.getPhonenumber()) && !userService.checkPhoneUnique(currentUser))
{ {
return error("修改用户'" + loginUser.getUsername() + "'失败,手机号码已存在"); return error("修改用户'" + loginUser.getUsername() + "'失败,手机号码已存在");
......
...@@ -6,8 +6,6 @@ import javax.servlet.http.HttpServletResponse; ...@@ -6,8 +6,6 @@ import javax.servlet.http.HttpServletResponse;
import cn.hutool.core.collection.CollUtil; import cn.hutool.core.collection.CollUtil;
import com.ruoyi.common.core.domain.R; import com.ruoyi.common.core.domain.R;
import com.ruoyi.common.core.domain.entity.SysUserSignaturePicture;
import com.ruoyi.system.mapper.SysUserSignaturePictureMapper;
import com.ruoyi.system.service.*; import com.ruoyi.system.service.*;
import com.ruoyi.web.request.UserByRoleRequest; import com.ruoyi.web.request.UserByRoleRequest;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
...@@ -62,12 +60,6 @@ public class SysUserController extends BaseController ...@@ -62,12 +60,6 @@ public class SysUserController extends BaseController
@Autowired @Autowired
private ISysPostService postService; private ISysPostService postService;
@Autowired
private SysUserSignaturePictureService sysUserSignaturePictureService;
@Autowired
private SysUserSignaturePictureMapper sysUserSignaturePictureMapper;
/** /**
* 获取用户列表 * 获取用户列表
*/ */
...@@ -154,8 +146,6 @@ public class SysUserController extends BaseController ...@@ -154,8 +146,6 @@ public class SysUserController extends BaseController
if (StringUtils.isNotNull(userId)) if (StringUtils.isNotNull(userId))
{ {
SysUser sysUser = userService.selectUserById(userId); SysUser sysUser = userService.selectUserById(userId);
SysUserSignaturePicture picture = sysUserSignaturePictureService.getById(userId);
sysUser.setSignaturePicture(picture.getSignaturePicture());
ajax.put(AjaxResult.DATA_TAG, sysUser); ajax.put(AjaxResult.DATA_TAG, sysUser);
ajax.put("postIds", postService.selectPostListByUserId(userId)); ajax.put("postIds", postService.selectPostListByUserId(userId));
ajax.put("roleIds", sysUser.getRoles().stream().map(SysRole::getRoleId).collect(Collectors.toList())); ajax.put("roleIds", sysUser.getRoles().stream().map(SysRole::getRoleId).collect(Collectors.toList()));
......
...@@ -90,7 +90,7 @@ public class SysUser extends BaseEntity ...@@ -90,7 +90,7 @@ public class SysUser extends BaseEntity
/** 角色ID */ /** 角色ID */
private Long roleId; private Long roleId;
@TableField(exist = false) /** 用户签字图片 */
private String signaturePicture; private String signaturePicture;
public SysUser() public SysUser()
......
package com.ruoyi.common.core.domain.entity;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
@Data
@ApiModel("用户签字图片")
@TableName(value ="sys_user_signature_picture")
public class SysUserSignaturePicture {
/** 用户ID */
@ApiModelProperty("用户ID")
@TableId(type = IdType.ASSIGN_ID)
@JsonFormat(shape = JsonFormat.Shape.STRING)
private Long userId;
@ApiModelProperty("签字图片")
private String signaturePicture;
}
package com.ruoyi.system.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.ruoyi.common.core.domain.entity.SysUserSignaturePicture;
import org.springframework.stereotype.Repository;
@Repository
public interface SysUserSignaturePictureMapper extends BaseMapper<SysUserSignaturePicture> {
}
package com.ruoyi.system.service;
import com.baomidou.mybatisplus.extension.service.IService;
import com.ruoyi.common.core.domain.entity.SysUserSignaturePicture;
public interface SysUserSignaturePictureService extends IService<SysUserSignaturePicture> {
}
package com.ruoyi.system.service.impl;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.ruoyi.common.core.domain.entity.SysUserSignaturePicture;
import com.ruoyi.system.mapper.SysUserSignaturePictureMapper;
import com.ruoyi.system.service.SysUserSignaturePictureService;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
@Service
@Transactional
public class SysUserSignaturePictureServiceImpl extends ServiceImpl<SysUserSignaturePictureMapper, SysUserSignaturePicture> implements SysUserSignaturePictureService {
}
...@@ -23,6 +23,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ...@@ -23,6 +23,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="updateBy" column="update_by" /> <result property="updateBy" column="update_by" />
<result property="updateTime" column="update_time" /> <result property="updateTime" column="update_time" />
<result property="remark" column="remark" /> <result property="remark" column="remark" />
<result property="signaturePicture" column="signature_picture" />
<association property="dept" javaType="SysDept" resultMap="deptResult" /> <association property="dept" javaType="SysDept" resultMap="deptResult" />
<collection property="roles" javaType="java.util.List" resultMap="RoleResult" /> <collection property="roles" javaType="java.util.List" resultMap="RoleResult" />
</resultMap> </resultMap>
...@@ -47,7 +48,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ...@@ -47,7 +48,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</resultMap> </resultMap>
<sql id="selectUserVo"> <sql id="selectUserVo">
select u.user_id, u.dept_id, u.user_name, u.nick_name, u.email, u.avatar, u.phonenumber, u.password, u.sex, u.status, u.del_flag, u.login_ip, u.login_date, u.create_by, u.create_time, u.remark, select u.user_id, u.dept_id, u.user_name, u.nick_name, u.email, u.avatar, u.phonenumber, u.password, u.sex, u.status, u.del_flag, u.login_ip, u.login_date, u.create_by, u.create_time, u.remark, u.signature_picture,
d.dept_id, d.parent_id, d.ancestors, d.dept_name, d.order_num, d.leader, d.status as dept_status, d.dept_id, d.parent_id, d.ancestors, d.dept_name, d.order_num, d.leader, d.status as dept_status,
r.role_id, r.role_name, r.role_key, r.role_sort, r.data_scope, r.status as role_status r.role_id, r.role_name, r.role_key, r.role_sort, r.data_scope, r.status as role_status
from sys_user u from sys_user u
...@@ -168,6 +169,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ...@@ -168,6 +169,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="status != null and status != ''">status,</if> <if test="status != null and status != ''">status,</if>
<if test="createBy != null and createBy != ''">create_by,</if> <if test="createBy != null and createBy != ''">create_by,</if>
<if test="remark != null and remark != ''">remark,</if> <if test="remark != null and remark != ''">remark,</if>
<if test="signaturePicture != null and signaturePicture != ''">signature_picture,</if>
create_time create_time
)values( )values(
<if test="userId != null and userId != ''">#{userId},</if> <if test="userId != null and userId != ''">#{userId},</if>
...@@ -182,6 +184,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ...@@ -182,6 +184,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="status != null and status != ''">#{status},</if> <if test="status != null and status != ''">#{status},</if>
<if test="createBy != null and createBy != ''">#{createBy},</if> <if test="createBy != null and createBy != ''">#{createBy},</if>
<if test="remark != null and remark != ''">#{remark},</if> <if test="remark != null and remark != ''">#{remark},</if>
<if test="signaturePicture != null and signaturePicture != ''">#{signaturePicture},</if>
sysdate() sysdate()
) )
</insert> </insert>
...@@ -202,6 +205,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" ...@@ -202,6 +205,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="loginDate != null">login_date = #{loginDate},</if> <if test="loginDate != null">login_date = #{loginDate},</if>
<if test="updateBy != null and updateBy != ''">update_by = #{updateBy},</if> <if test="updateBy != null and updateBy != ''">update_by = #{updateBy},</if>
<if test="remark != null">remark = #{remark},</if> <if test="remark != null">remark = #{remark},</if>
<if test="signaturePicture != null">signature_picture = #{signaturePicture},</if>
update_time = sysdate() update_time = sysdate()
</set> </set>
where user_id = #{userId} where user_id = #{userId}
......
<?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.ruoyi.system.mapper.SysUserSignaturePictureMapper">
<resultMap id="BaseResultMap" type="SysUserSignaturePicture">
<id property="userId" column="user_id" jdbcType="BIGINT"/>
<result property="signaturePicture" column="signature_picture" jdbcType="VARCHAR"/>
</resultMap>
</mapper>
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment