领料出库bug修改
This commit is contained in:
parent
1f800582da
commit
8beef5ff78
|
|
@ -102,6 +102,7 @@ public interface TmTaskMapper {
|
||||||
List<TmTask> getLeaseOutListByUser(TmTask task);
|
List<TmTask> getLeaseOutListByUser(TmTask task);
|
||||||
|
|
||||||
List<TmTask> getLeaseDetailByParentId(TmTask record);
|
List<TmTask> getLeaseDetailByParentId(TmTask record);
|
||||||
|
List<TmTask> getLeaseDetailByjjbz(TmTask record);
|
||||||
|
|
||||||
List<TmTask> getMaTypeDetails(LeaseApplyDetails leaseApplyDetails);
|
List<TmTask> getMaTypeDetails(LeaseApplyDetails leaseApplyDetails);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -140,9 +140,9 @@ public class TmTaskServiceImpl implements TmTaskService {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
//短信通知人员进行出库
|
//短信通知人员进行出库
|
||||||
for (LeaseApplyDetails details:leaseApplyDetails) {
|
for (LeaseApplyDetails details : leaseApplyDetails) {
|
||||||
//内部审核以后通知机具管理人进行出库
|
//内部审核以后通知机具管理人进行出库
|
||||||
smsNotification(details,record.getCode());
|
smsNotification(details, record.getCode());
|
||||||
}
|
}
|
||||||
|
|
||||||
} else if (record.getTaskStatus() == 32 && companyId != null) {
|
} else if (record.getTaskStatus() == 32 && companyId != null) {
|
||||||
|
|
@ -222,22 +222,22 @@ public class TmTaskServiceImpl implements TmTaskService {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void smsNotification(LeaseApplyDetails details,String code) {
|
private void smsNotification(LeaseApplyDetails details, String code) {
|
||||||
TmTask tmTask = new TmTask();
|
TmTask tmTask = new TmTask();
|
||||||
tmTask.setId(details.getParenntId().toString());
|
tmTask.setId(details.getParenntId().toString());
|
||||||
//获取机具所属人员
|
//获取机具所属人员
|
||||||
List<TmTask> leaseDetailByParent = tmTaskMapper.getUserByParenntId(tmTask);
|
List<TmTask> leaseDetailByParent = tmTaskMapper.getUserByParenntId(tmTask);
|
||||||
for (TmTask tmTaskNew: leaseDetailByParent) {
|
for (TmTask tmTaskNew : leaseDetailByParent) {
|
||||||
//对手机号进行处理,因为存在一种类型的机具归属多个人的情况
|
//对手机号进行处理,因为存在一种类型的机具归属多个人的情况
|
||||||
log.info("短信通知人为:{}",tmTaskNew.getUserName());
|
log.info("短信通知人为:{}", tmTaskNew.getUserName());
|
||||||
if (tmTaskNew.getPhoneNumber()!=null){
|
if (tmTaskNew.getPhoneNumber() != null) {
|
||||||
String[] phoneNumberList = tmTaskNew.getPhoneNumber().split(",");
|
String[] phoneNumberList = tmTaskNew.getPhoneNumber().split(",");
|
||||||
String message ="尊敬的用户,宁夏智慧仓储管理系统提醒您:您有一个领料单号为:"+code+"的领料申请待处理,请及时查看";
|
String message = "尊敬的用户,宁夏智慧仓储管理系统提醒您:您有一个领料单号为:" + code + "的领料申请待处理,请及时查看";
|
||||||
for (int i = 0; i < phoneNumberList.length; i++) {
|
for (int i = 0; i < phoneNumberList.length; i++) {
|
||||||
try {
|
try {
|
||||||
remoteUserService.send(phoneNumberList[i], message);
|
remoteUserService.send(phoneNumberList[i], message);
|
||||||
}catch (Exception e){
|
} catch (Exception e) {
|
||||||
log.info("手机号为:{}发送短信失败",phoneNumberList[i]);
|
log.info("手机号为:{}发送短信失败", phoneNumberList[i]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -287,7 +287,14 @@ public class TmTaskServiceImpl implements TmTaskService {
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public List<TmTask> getLeaseAuditListByOne(TmTask record) {
|
public List<TmTask> getLeaseAuditListByOne(TmTask record) {
|
||||||
List<TmTask> leaseDetailByParentId = tmTaskMapper.getLeaseDetailByParentId(record);
|
Set<String> roles = SecurityUtils.getLoginUser().getRoles();
|
||||||
|
if (roles.contains("jjbz") || roles.contains("fbz")) {
|
||||||
|
List<TmTask> leaseDetailByParentId = tmTaskMapper.getLeaseDetailByjjbz(record);
|
||||||
|
return leaseDetailByParentId;
|
||||||
|
} else {
|
||||||
|
List<TmTask> leaseDetailByParentId = tmTaskMapper.getLeaseDetailByParentId(record);
|
||||||
|
return leaseDetailByParentId;
|
||||||
|
}
|
||||||
/* for (TmTask tmTask : leaseDetailByParentId) {
|
/* for (TmTask tmTask : leaseDetailByParentId) {
|
||||||
if ("2".equals(tmTask.getManageType())) {
|
if ("2".equals(tmTask.getManageType())) {
|
||||||
List<TmTask> manageTypeByTypeId = tmTaskMapper.getManageTypeByTypeId(tmTask);
|
List<TmTask> manageTypeByTypeId = tmTaskMapper.getManageTypeByTypeId(tmTask);
|
||||||
|
|
@ -295,7 +302,6 @@ public class TmTaskServiceImpl implements TmTaskService {
|
||||||
tmTask.setOutboundType(manageTypeByTypeId);
|
tmTask.setOutboundType(manageTypeByTypeId);
|
||||||
}
|
}
|
||||||
}*/
|
}*/
|
||||||
return leaseDetailByParentId;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
||||||
|
|
@ -1045,23 +1045,22 @@
|
||||||
d.id AS examineStatusId,
|
d.id AS examineStatusId,
|
||||||
bai.agreement_code AS agreementCode,
|
bai.agreement_code AS agreementCode,
|
||||||
tt.create_time AS createTimes,
|
tt.create_time AS createTimes,
|
||||||
IFNULL( sum( lad.pre_num ), 0 ) AS preCountNum,
|
IFNULL(sum(lad.pre_num),0) as preCountNum,
|
||||||
IFNULL( sum( lad.al_num ), 0 ) AS alNum,
|
IFNULL(sum(lad.al_num),0) as alNum,
|
||||||
tt.update_time AS updateTimes
|
tt.update_time AS updateTimes
|
||||||
FROM
|
from
|
||||||
lease_apply_info lai
|
lease_apply_info lai
|
||||||
LEFT JOIN tm_task tt ON lai.task_id = tt.task_id
|
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 sys_dic d ON d.id = tt.task_status
|
||||||
LEFT JOIN tm_task_agreement tta ON lai.task_id = tta.task_id
|
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_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_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 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 lease_apply_details lad on lai.id = lad.parennt_id
|
||||||
LEFT JOIN ( SELECT mtk.type_id, mtk.user_id FROM ma_type_keeper mtk LEFT JOIN lease_apply_details lad1 ON lad1.type_id = mtk.type_id LIMIT 1 ) aa ON lad.type_id = aa.type_id
|
LEFT JOIN ma_type_keeper mtk on lad.type_id = mtk.type_id
|
||||||
WHERE
|
WHERE tt.task_status in(33,34,35)
|
||||||
tt.task_status IN ( 33, 34, 35 )
|
|
||||||
<if test="userId != 1">
|
<if test="userId != 1">
|
||||||
and aa.user_id = #{userId}
|
and mtk.user_id = #{userId}
|
||||||
</if>
|
</if>
|
||||||
<if test="code != null and code != ''">
|
<if test="code != null and code != ''">
|
||||||
and tt.code like concat('%', #{code}, '%')
|
and tt.code like concat('%', #{code}, '%')
|
||||||
|
|
@ -1075,11 +1074,8 @@
|
||||||
<if test="taskStatus != null">
|
<if test="taskStatus != null">
|
||||||
and tt.task_status = #{taskStatus}
|
and tt.task_status = #{taskStatus}
|
||||||
</if>
|
</if>
|
||||||
GROUP BY
|
GROUP BY lai.id
|
||||||
lai.id
|
ORDER BY tt.task_status,tt.create_time desc
|
||||||
ORDER BY
|
|
||||||
tt.task_status,
|
|
||||||
tt.create_time DESC
|
|
||||||
</select>
|
</select>
|
||||||
<select id="getLeaseDetailByParentId" resultType="com.bonus.sgzb.app.domain.TmTask">
|
<select id="getLeaseDetailByParentId" resultType="com.bonus.sgzb.app.domain.TmTask">
|
||||||
SELECT
|
SELECT
|
||||||
|
|
@ -1220,7 +1216,6 @@
|
||||||
LEFT JOIN bm_project_lot bpl ON bpl.lot_id = bai.project_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 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 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)
|
WHERE tt.task_status in(33,34,35)
|
||||||
<if test="code != null and code != ''">
|
<if test="code != null and code != ''">
|
||||||
and tt.code like concat('%', #{code}, '%')
|
and tt.code like concat('%', #{code}, '%')
|
||||||
|
|
@ -1265,4 +1260,36 @@
|
||||||
lad.parennt_id = #{id}
|
lad.parennt_id = #{id}
|
||||||
GROUP BY lad.type_id
|
GROUP BY lad.type_id
|
||||||
</select>
|
</select>
|
||||||
|
<select id="getLeaseDetailByjjbz" resultType="com.bonus.sgzb.app.domain.TmTask">
|
||||||
|
SELECT
|
||||||
|
lai.task_id as taskId,
|
||||||
|
lad.id as id,
|
||||||
|
lad.parennt_id as parentId,
|
||||||
|
lad.pre_num - ifnull(lad.al_num,0) as outNum,
|
||||||
|
lad.pre_num as preCountNum,
|
||||||
|
ifnull(lad.al_num,0) as alNum,
|
||||||
|
mt2.type_name as typeName,
|
||||||
|
mt.type_name as typeModelName,
|
||||||
|
mt.manage_type as manageType,
|
||||||
|
mt.num as num,
|
||||||
|
GROUP_CONCAT(su.user_name) as userName,
|
||||||
|
lad.status as status,
|
||||||
|
lad.type_id as typeId
|
||||||
|
FROM
|
||||||
|
lease_apply_details lad
|
||||||
|
LEFT JOIN lease_apply_info lai on lad.parennt_id = lai.id
|
||||||
|
LEFT JOIN ma_type mt on lad.type_id = mt.type_id
|
||||||
|
LEFT JOIN ma_type mt2 on mt.parent_id = mt2.type_id
|
||||||
|
LEFT JOIN ma_type_keeper mtk on lad.type_id = mtk.type_id
|
||||||
|
LEFT JOIN sys_user su on mtk.user_id = su.user_id
|
||||||
|
WHERE
|
||||||
|
lad.parennt_id = #{id}
|
||||||
|
<if test="userName != null and userName != ''">
|
||||||
|
and su.user_name like concat('%', #{userName}, '%')
|
||||||
|
</if>
|
||||||
|
<if test="typeId != null and typeId != ''">
|
||||||
|
and lad.type_id = #{typeId}
|
||||||
|
</if>
|
||||||
|
GROUP BY lad.type_id
|
||||||
|
</select>
|
||||||
</mapper>
|
</mapper>
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue