领料出库代码提交

This commit is contained in:
liang.chao 2024-03-29 17:48:02 +08:00
parent b032265b84
commit 026598a082
7 changed files with 47 additions and 21 deletions

View File

@ -253,6 +253,8 @@ public class LeaseOutDetailsServiceImpl implements LeaseOutDetailsService {
String status = leaseOutDetailsMapper.getMachineStatus(record);
if (!maStatus.equals(status)) {
return res;
} else {
res = 1;
}
}
}

View File

@ -233,6 +233,7 @@ public class TmTaskServiceImpl implements TmTaskService {
/**
* 创建审批流领料申请
*
* @param task 任务信息
* @return 执行结果
*/
@ -245,7 +246,9 @@ public class TmTaskServiceImpl implements TmTaskService {
return AjaxResult.error("当前任务类型审批流配置为空,请联系管理员");
}
// 审批流排序
if (!copeOrderByField(bmFlowRelationList)) { return AjaxResult.error("审批流排序失败,请联系管理员"); }
if (!copeOrderByField(bmFlowRelationList)) {
return AjaxResult.error("审批流排序失败,请联系管理员");
}
// 获取起始节点状态
String flowStartTaskStatus = bmFlowRelationList.get(0).getTaskStatus();
// 设置任务状态为审批流的起点状态
@ -254,17 +257,25 @@ public class TmTaskServiceImpl implements TmTaskService {
// 生成领料编码
String code = this.genderLeaseCode();
if (StringUtils.isEmpty(code)) { return AjaxResult.error("后台生成CODE编号异常请重试!"); }
if (StringUtils.isEmpty(code)) {
return AjaxResult.error("后台生成CODE编号异常请重试!");
}
task.setCode(code);
// 创建任务
if (this.insertSelective(task) < 1) { return AjaxResult.error("创建领料任务失败,请重试!"); }
if (this.insertSelective(task) < 1) {
return AjaxResult.error("创建领料任务失败,请重试!");
}
//任务与协议建立关联关系
if (this.insertAgreement(task) < 1) { return AjaxResult.error("领料任务与协议建立关联关系失败,请重试!"); }
if (this.insertAgreement(task) < 1) {
return AjaxResult.error("领料任务与协议建立关联关系失败,请重试!");
}
// 获取任务编号
String taskId = task.getId();
if (StringUtils.isEmpty(taskId)) {return AjaxResult.error("任务编号为空,创建失败");}
if (StringUtils.isEmpty(taskId)) {
return AjaxResult.error("任务编号为空,创建失败");
}
// 处理任务数据实例化至DB
R<String> taskDataCopeResult = leaseTaskDataCope(task, code, taskId, bmFlowRelationList.size());
@ -286,7 +297,9 @@ public class TmTaskServiceImpl implements TmTaskService {
try {
bmFlowRecord.setTaskId(Integer.valueOf(taskId));
bmFlowRecord.setFlowId(bmFlowRelationList.get(0).getFlowId());
if (bmFlowRelationList.size() > 1) { bmFlowRecord.setNextFlowId(bmFlowRelationList.get(1).getFlowId());}
if (bmFlowRelationList.size() > 1) {
bmFlowRecord.setNextFlowId(bmFlowRelationList.get(1).getFlowId());
}
// String loginUserName = SecurityUtils.getLoginUser().getSysUser().getUserName();
// bmFlowRecord.setCreator(loginUserName == null ? "" : loginUserName);
bmFlowRecordService.insertSelective(bmFlowRecord);
@ -352,6 +365,7 @@ public class TmTaskServiceImpl implements TmTaskService {
/**
* 审批流排序
*
* @param bmFlowRelationList 审批流数据集合
* @return 排序结果
*/
@ -368,6 +382,7 @@ public class TmTaskServiceImpl implements TmTaskService {
/**
* 根据任务入参查询审批流信息
*
* @param task 任务
* @return 审批流数据集合
*/
@ -525,7 +540,7 @@ public class TmTaskServiceImpl implements TmTaskService {
@Override
public List<TmTask> getLeaseOutListByUser(TmTask task) {
return tmTaskMapper.getLeaseOutListByUser(task);
return tmTaskMapper.getLeaseOutListByUser(task);
}

View File

@ -42,19 +42,19 @@
</select>
<select id="getDetailsByApplyId" resultType="com.bonus.sgzb.app.domain.TmTask">
SELECT
mt2.type_name AS typeName,
mt.type_name AS typeModelName,
mt.type_id AS typeId,
mm.ma_code AS maCode,
mm.ma_id AS maId,
sd.NAME AS maStatus
mt2.type_name AS typeName,
mt.type_name AS typeModelName,
mt.type_id AS typeId,
mm.ma_code AS maCode,
mm.ma_id AS maId,
sd.NAME AS maStatus
FROM
ma_type mt
LEFT JOIN ma_type mt2 ON mt.parent_id = mt2.type_id
LEFT JOIN ma_machine mm ON mt.type_id = mm.type_id
LEFT JOIN sys_dic sd ON sd.id = mm.ma_status
ma_type mt
LEFT JOIN ma_type mt2 ON mt.parent_id = mt2.type_id
LEFT JOIN ma_machine mm ON mt.type_id = mm.type_id
LEFT JOIN sys_dic sd ON sd.id = mm.ma_status
WHERE
mm.ma_status = 15
mm.ma_status in ('15','16')
AND mt.type_id = #{typeId}
<if test="maCode != null and maCode !=''">
AND mm.ma_code like concat('%', #{maCode}, '%')

View File

@ -902,8 +902,8 @@
d.id AS examineStatusId,
bai.agreement_code AS agreementCode,
tt.create_time AS createTimes,
sum(lad.pre_num) as preCountNum,
sum(lad.al_num) as alNum,
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
@ -941,7 +941,7 @@
lad.parennt_id as parentId,
lad.pre_num - ifnull(lad.al_num,0) as outNum,
lad.pre_num as preCountNum,
lad.al_num as alNum,
ifnull(lad.al_num,0) as alNum,
mt2.type_name as typeName,
mt.type_name as typeModelName,
mt.manage_type as manageType,

View File

@ -238,6 +238,7 @@ public class BackApplyInfo extends BaseEntity {
private String guigeCn;
private String preNum;
private String auditNum;
private String typeCn;
/** 前端条件查询所传工程id */
private String proId;

View File

@ -265,6 +265,8 @@ public class WorkSiteDirectManageImpl implements WorkSiteDirectManageService {
for (BackApplyInfo leaseApplyDetails : leaseApplyDetailsList) {
//设置领料任务ID
leaseApplyDetails.setId(backApplyInfoId);
leaseApplyDetails.setNum(leaseApplyDetails.getDirectNum().toString());
leaseApplyDetails.setAuditNum(leaseApplyDetails.getDirectNum().toString());
// 插入领料任务明细
boolean addLeaseTaskDetailsResult = backApplyService.upload(leaseApplyDetails) > 0;
if (!addLeaseTaskDetailsResult) {

View File

@ -216,6 +216,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="companyId != null">
company_id,
</if>
<if test="auditNum != null">
audit_num,
</if>
create_time
)
values (
@ -239,6 +242,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="companyId != null">
#{companyId},
</if>
<if test="auditNum != null">
#{auditNum},
</if>
NOW()
)
</insert>