宁夏试运行问题修改

This commit is contained in:
csyue 2024-06-03 18:45:24 +08:00
parent 67ea808d43
commit 4201951630
10 changed files with 126 additions and 40 deletions

View File

@ -457,7 +457,7 @@ public class TmTaskController extends BaseController {
return AjaxResult.error("参数错误");
}
if (SecurityUtils.getLoginUser() != null) {
Long userid = SecurityUtils.getLoginUser().getUserid();
Long userid = SecurityUtils.getLoginUser().getSysUser().getUserId();
task.setUserId(String.valueOf(userid));
}
if (task.getFlag() == 1) {

View File

@ -144,4 +144,6 @@ public interface TmTaskMapper {
int updateLeaseApplyInfoAuditInfoCq(@Param("record") LeaseApplyInfo leaseApplyInfo);
int getDeptId(String createBy);
List<TmTask> getLeaseOutListByjjbz(TmTask task);
}

View File

@ -559,7 +559,13 @@ public class TmTaskServiceImpl implements TmTaskService {
@Override
public List<TmTask> getLeaseOutListByUser(TmTask task) {
return tmTaskMapper.getLeaseOutListByUser(task);
Set<String> roles = SecurityUtils.getLoginUser().getRoles();
if (roles.contains("jjbz") || roles.contains("fbz")) {
//机具班长和副班长可以出库机具设备
return tmTaskMapper.getLeaseOutListByjjbz(task);
}else {
return tmTaskMapper.getLeaseOutListByUser(task);
}
}
@Override

View File

@ -1155,4 +1155,50 @@
<select id="getDeptId" resultType="java.lang.Integer">
select dept_id from sys_user where user_id = #{createBy}
</select>
<select id="getLeaseOutListByjjbz" resultType="com.bonus.sgzb.app.domain.TmTask">
SELECT
tt.*,
lai.id AS id,
bpl.lot_id AS proId,
bpl.lot_name AS proName,
bui.unit_id AS unitId,
bui.unit_name AS unitName,
lai.lease_person AS leasePerson,
lai.phone AS leasePhone,
tt.create_by AS applyFor,
d.`name` AS taskName,
lai.lease_type AS leaseType,
d.id AS examineStatusId,
bai.agreement_code AS agreementCode,
tt.create_time AS createTimes,
IFNULL(sum(lad.pre_num),0) as preCountNum,
IFNULL(sum(lad.al_num),0) as alNum,
tt.update_time AS updateTimes
from
lease_apply_info lai
LEFT JOIN tm_task tt on lai.task_id = tt.task_id
LEFT JOIN sys_dic d ON d.id = tt.task_status
LEFT JOIN tm_task_agreement tta ON lai.task_id = tta.task_id
LEFT JOIN bm_agreement_info bai ON bai.agreement_id = tta.agreement_id
LEFT JOIN bm_project_lot bpl ON bpl.lot_id = bai.project_id
LEFT JOIN bm_unit_info bui ON bui.unit_id = bai.unit_id
LEFT JOIN lease_apply_details lad on lai.id = lad.parennt_id
LEFT JOIN ma_type_keeper mtk on lad.type_id = mtk.type_id
WHERE tt.task_status in(33,34,35)
<if test="code != null and code != ''">
and tt.code like concat('%', #{code}, '%')
</if>
<if test="unitId != null">
and bui.unit_id = #{unitId}
</if>
<if test="proId != null">
and bpl.lot_id = #{proId}
</if>
<if test="taskStatus != null">
and tt.task_status = #{taskStatus}
</if>
and lai.company_id = 101
GROUP BY lai.id
ORDER BY tt.task_status,tt.create_time desc
</select>
</mapper>

View File

@ -40,7 +40,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</select>
<select id="getMaUserList" resultType="com.bonus.sgzb.base.domain.WarehouseKeeper">
SELECT
SELECT distinct
su.user_id AS userId,
su.nick_name AS userName
FROM

View File

@ -57,6 +57,18 @@ public class LeaseRecord{
@ApiModelProperty(value = "设备编码")
@Excel(name = "设备编码")
private String maCode;
/**
* 领料单号
*/
@ApiModelProperty(value = "领料单号")
@Excel(name = "领料单号")
private String code;
/**
* 车牌号
*/
@ApiModelProperty(value = "车牌号")
@Excel(name = "车牌号")
private String carCode;
/**
* 计量单位

View File

@ -17,15 +17,15 @@ import java.util.List;
public class ApplyInfoServiceImpl implements ApplyInfoService {
@Resource
private ApplyInfoMapper leaseApplyInfoMapper;
private ApplyInfoMapper applyInfoMapper;
@Override
public int genderLeaseCode(LeaseApplyInfo record) {
return leaseApplyInfoMapper.insertSelective(record);
return applyInfoMapper.insertSelective(record);
}
@Override
public List<LeaseApplyInfo> selectIdByTaskId(Integer id) {
return leaseApplyInfoMapper.selectIdByTaskId(id);
return applyInfoMapper.selectIdByTaskId(id);
}
}

View File

@ -14,27 +14,32 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</update>
<select id="getLeaseRecordList" resultType="com.bonus.sgzb.material.domain.LeaseRecord">
SELECT mt2.type_name as typeName,
mt.type_name as typeModelName,
bai.agreement_code as agreementCode,
mm.ma_code as maCode,
mt.unit_name as unit,
lod.out_num as preNum,
su.nick_name as leasePerson,
lod.create_time as createTime,
bpl.lot_name as proName,
bui.unit_name as unitName
FROM lease_out_details lod
LEFT JOIN lease_apply_info lai on lai.id = lod.parent_id
LEFT JOIN tm_task_agreement tta on tta.task_id = lai.task_id
LEFT JOIN bm_agreement_info bai on bai.agreement_id = tta.agreement_id
LEFT JOIN bm_project_lot bpl on bpl.lot_id = bai.project_id
LEFT JOIN bm_unit_info bui on bui.unit_id = bai.unit_id
LEFT JOIN ma_type mt on mt.type_id = lod.type_id
LEFT JOIN ma_type mt2 on mt2.type_id = mt.parent_id
LEFT JOIN ma_machine mm on mm.ma_id = lod.ma_id
LEFT JOIN sys_user su on su.user_id = lai.lease_person
where 1 = 1
SELECT
mt2.type_name AS typeName,
mt.type_name AS typeModelName,
bai.agreement_code AS agreementCode,
mm.ma_code AS maCode,
mt.unit_name AS unit,
lod.out_num AS preNum,
lai.`code` AS code,
su.nick_name AS leasePerson,
lod.create_time AS createTime,
bpl.lot_name AS proName,
lod.car_code AS carCode,
bui.unit_name AS unitName
FROM
lease_out_details lod
LEFT JOIN lease_apply_info lai ON lai.id = lod.parent_id
LEFT JOIN tm_task_agreement tta ON tta.task_id = lai.task_id
LEFT JOIN bm_agreement_info bai ON bai.agreement_id = tta.agreement_id
LEFT JOIN bm_project_lot bpl ON bpl.lot_id = bai.project_id
LEFT JOIN bm_unit_info bui ON bui.unit_id = bai.unit_id
LEFT JOIN ma_type mt ON mt.type_id = lod.type_id
LEFT JOIN ma_type mt2 ON mt2.type_id = mt.parent_id
LEFT JOIN ma_machine mm ON mm.ma_id = lod.ma_id
LEFT JOIN sys_user su ON su.user_id = lai.lease_person
WHERE
1 = 1
<if test="keyWord != null and keyWord != ''">
and (bai.agreement_code like concat('%',#{keyWord},'%') or
mm.ma_code like concat('%',#{keyWord},'%') or

View File

@ -374,7 +374,8 @@ public class SysUserController extends BaseController {
*/
@GetMapping("/getUserByRoleList")
public AjaxResult getUserByRoleList(SysUser sysUser) {
return success(userService.getUserByRoleList(sysUser));
List<SysUser> userByRoleList = userService.getUserByRoleList(sysUser);
return success(userByRoleList);
}
/**

View File

@ -144,7 +144,31 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<select id="checkEmailUnique" parameterType="String" resultMap="SysUserResult">
select user_id, email from sys_user where email = #{email} and del_flag = '0' limit 1
</select>
<select id="selectUserByRole" resultType="com.bonus.sgzb.system.api.domain.SysUser">
SELECT DISTINCT
u.user_id,
u.dept_id,
u.nick_name as userName,
u.email,
u.avatar,
u.phonenumber,
u.sex,
u.STATUS,
u.del_flag,
u.login_ip,
u.login_date,
u.create_by,
u.create_time,
u.remark
FROM
sys_user u
LEFT JOIN sys_user_role sur ON u.user_id = sur.user_id
WHERE
u.STATUS = '0'
AND u.del_flag = '0'
AND sur.role_id IN (133,134)
</select>
<insert id="insertUser" parameterType="com.bonus.sgzb.system.api.domain.SysUser" useGeneratedKeys="true" keyProperty="userId">
insert into sys_user(
<if test="userId != null and userId != 0">user_id,</if>
@ -224,15 +248,5 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</foreach>
</delete>
<select id="selectUserByRole" resultMap="SysUserResult">
select u.user_id, u.dept_id, u.nick_name, u.user_name, u.email, u.avatar, u.phonenumber,
u.sex, u.status, u.del_flag, u.login_ip, u.login_date, u.create_by, u.create_time,
u.remark
from sys_user u
left join sys_user_role sur on u.user_id = sur.user_id
where u.status = '0' and u.del_flag = '0'
<if test="roleId != null" >
and sur.role_id = #{roleId}
</if>
</select>
</mapper>