Merge branch 'master' of http://192.168.0.75:3000/bonus/Bonus-Cloud-Material
This commit is contained in:
commit
de0957f63b
|
|
@ -173,7 +173,6 @@ public class ArchivesController extends BaseController {
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
@ApiOperation(value = "下载电子档案右侧详情")
|
@ApiOperation(value = "下载电子档案右侧详情")
|
||||||
@PreventRepeatSubmit
|
|
||||||
//@RequiresPermissions("archives:type:download")
|
//@RequiresPermissions("archives:type:download")
|
||||||
@GetMapping("/download")
|
@GetMapping("/download")
|
||||||
public AjaxResult download(ArchivesVo archivesVo, HttpServletRequest request, HttpServletResponse response)
|
public AjaxResult download(ArchivesVo archivesVo, HttpServletRequest request, HttpServletResponse response)
|
||||||
|
|
|
||||||
|
|
@ -155,4 +155,11 @@ public interface LeaseApplyDetailsMapper {
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
List<LeaseApplyDetails> selectPublishDetails(LeaseApplyDetails leaseApplyDetails);
|
List<LeaseApplyDetails> selectPublishDetails(LeaseApplyDetails leaseApplyDetails);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据领用任务批次删除领用任务详细
|
||||||
|
* @param leaseOutDetails
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
int deletePublishTask(LeaseOutDetails leaseOutDetails);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -178,21 +178,22 @@ public class LeaseApplyInfoServiceImpl implements ILeaseApplyInfoService {
|
||||||
leaseApplyInfo.setUserId(SecurityUtils.getUserId());
|
leaseApplyInfo.setUserId(SecurityUtils.getUserId());
|
||||||
List<LeaseApplyInfo> list = leaseApplyInfoMapper.selectLeaseApplyInfoList(leaseApplyInfo);
|
List<LeaseApplyInfo> list = leaseApplyInfoMapper.selectLeaseApplyInfoList(leaseApplyInfo);
|
||||||
// 如果statusList包含3、4、5,则为领料出库查询,需查询领用出库数据,进行拼接
|
// 如果statusList包含3、4、5,则为领料出库查询,需查询领用出库数据,进行拼接
|
||||||
if (leaseApplyInfo.getStatusList() != null && leaseApplyInfo.getStatusList().contains(3)
|
if (!CollectionUtils.isEmpty(leaseApplyInfo.getStatusList())) {
|
||||||
|| leaseApplyInfo.getStatusList().contains(4) || leaseApplyInfo.getStatusList().contains(5)) {
|
if (leaseApplyInfo.getStatusList().contains(3) || leaseApplyInfo.getStatusList().contains(4) || leaseApplyInfo.getStatusList().contains(5)) {
|
||||||
// 查询领用出库数据
|
// 查询领用出库数据
|
||||||
List<LeaseApplyInfo> leaseApplyOutList = leaseApplyInfoMapper.selectPublishList(leaseApplyInfo);
|
List<LeaseApplyInfo> leaseApplyOutList = leaseApplyInfoMapper.selectPublishList(leaseApplyInfo);
|
||||||
if (!CollectionUtils.isEmpty(leaseApplyOutList)) {
|
if (!CollectionUtils.isEmpty(leaseApplyOutList)) {
|
||||||
for (LeaseApplyInfo applyInfo : leaseApplyOutList) {
|
for (LeaseApplyInfo applyInfo : leaseApplyOutList) {
|
||||||
if (applyInfo.getPreCountNum().compareTo(applyInfo.getAlNum()) == 0) {
|
if (applyInfo.getPreCountNum().compareTo(applyInfo.getAlNum()) == 0) {
|
||||||
applyInfo.setTaskStatus(LeaseTaskStatusEnum.LEASE_TASK_FINISHED.getStatus());
|
applyInfo.setTaskStatus(LeaseTaskStatusEnum.LEASE_TASK_FINISHED.getStatus());
|
||||||
applyInfo.setTaskStatusName(LeaseTaskStatusEnum.LEASE_TASK_FINISHED.getStatusName());
|
applyInfo.setTaskStatusName(LeaseTaskStatusEnum.LEASE_TASK_FINISHED.getStatusName());
|
||||||
} else {
|
} else {
|
||||||
applyInfo.setTaskStatus(LeaseTaskStatusEnum.LEASE_TASK_IN_PROGRESS.getStatus());
|
applyInfo.setTaskStatus(LeaseTaskStatusEnum.LEASE_TASK_IN_PROGRESS.getStatus());
|
||||||
applyInfo.setTaskStatusName(LeaseTaskStatusEnum.LEASE_TASK_IN_PROGRESS.getStatusName());
|
applyInfo.setTaskStatusName(LeaseTaskStatusEnum.LEASE_TASK_IN_PROGRESS.getStatusName());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
list.addAll(leaseApplyOutList);
|
||||||
}
|
}
|
||||||
list.addAll(leaseApplyOutList);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// 使用 Stream API 进行降序排序
|
// 使用 Stream API 进行降序排序
|
||||||
|
|
|
||||||
|
|
@ -4,6 +4,7 @@ import java.math.BigDecimal;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Objects;
|
import java.util.Objects;
|
||||||
import com.bonus.common.biz.constant.MaterialConstants;
|
import com.bonus.common.biz.constant.MaterialConstants;
|
||||||
|
import com.bonus.common.biz.domain.lease.LeaseApplyInfo;
|
||||||
import com.bonus.common.biz.enums.InputOutEnum;
|
import com.bonus.common.biz.enums.InputOutEnum;
|
||||||
import com.bonus.common.biz.enums.LeaseTaskStatusEnum;
|
import com.bonus.common.biz.enums.LeaseTaskStatusEnum;
|
||||||
import com.bonus.common.biz.enums.MaMachineStatusEnum;
|
import com.bonus.common.biz.enums.MaMachineStatusEnum;
|
||||||
|
|
@ -228,20 +229,36 @@ public class LeaseOutDetailsServiceImpl implements ILeaseOutDetailsService {
|
||||||
int res = 0;
|
int res = 0;
|
||||||
try {
|
try {
|
||||||
// 1 根据任务id查询此任务是否已经完结
|
// 1 根据任务id查询此任务是否已经完结
|
||||||
TmTask tmTask = tmTaskMapper.selectTmTaskByTaskId(Long.valueOf(leaseOutDetails.getTaskId()));
|
if (StringUtils.isNotBlank(leaseOutDetails.getPublishTask())) {
|
||||||
if (tmTask != null && tmTask.getTaskStatus().equals(LeaseTaskStatusEnum.LEASE_TASK_FINISHED.getStatus())) {
|
// 查询领用出库数据
|
||||||
return AjaxResult.error("该任务已完成,不能进行退库操作");
|
LeaseApplyInfo leaseApplyInfo = new LeaseApplyInfo();
|
||||||
|
leaseApplyInfo.setPublishTask(leaseOutDetails.getPublishTask());
|
||||||
|
List<LeaseApplyInfo> leaseApplyOutList = leaseApplyInfoMapper.selectPublishList(leaseApplyInfo);
|
||||||
|
if (!CollectionUtils.isEmpty(leaseApplyOutList)) {
|
||||||
|
for (LeaseApplyInfo applyInfo : leaseApplyOutList) {
|
||||||
|
if (applyInfo.getPreCountNum().compareTo(applyInfo.getAlNum()) == 0) {
|
||||||
|
return AjaxResult.error("该任务已完成,不能进行退库操作");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
TmTask tmTask = tmTaskMapper.selectTmTaskByTaskId(Long.valueOf(leaseOutDetails.getTaskId()));
|
||||||
|
if (tmTask != null && tmTask.getTaskStatus().equals(LeaseTaskStatusEnum.LEASE_TASK_FINISHED.getStatus())) {
|
||||||
|
return AjaxResult.error("该任务已完成,不能进行退库操作");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
// 2、插入出库记录,修改库存,修改机具状态
|
// 2、插入出库记录,修改库存,修改机具状态
|
||||||
res = updateRecords(leaseOutDetails);
|
res = updateRecords(leaseOutDetails);
|
||||||
if (res == 0) {
|
if (res == 0) {
|
||||||
throw new RuntimeException("出库退回失败,更新设备规格库存数量时出错!");
|
throw new RuntimeException("出库退回失败,更新设备规格库存数量时出错!");
|
||||||
}
|
}
|
||||||
// 3、修改任务状态(tm_task)
|
// 3、修改任务状态(tm_task)
|
||||||
|
if (StringUtils.isNotBlank(leaseOutDetails.getTaskId())) {
|
||||||
res = editTaskStatus(leaseOutDetails);
|
res = editTaskStatus(leaseOutDetails);
|
||||||
if (res == 0) {
|
if (res == 0) {
|
||||||
throw new RuntimeException("出库退回失败,修改任务状态失败");
|
throw new RuntimeException("出库退回失败,修改任务状态失败");
|
||||||
}
|
}
|
||||||
|
}
|
||||||
// 4、删除结算记录
|
// 4、删除结算记录
|
||||||
res = deleteSltInfo(leaseOutDetails);
|
res = deleteSltInfo(leaseOutDetails);
|
||||||
if (res == 0) {
|
if (res == 0) {
|
||||||
|
|
|
||||||
|
|
@ -277,7 +277,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
LEFT JOIN ma_type mt1 ON mt.parent_id = mt1.type_id
|
LEFT JOIN ma_type mt1 ON mt.parent_id = mt1.type_id
|
||||||
AND mt1.del_flag = '0'
|
AND mt1.del_flag = '0'
|
||||||
LEFT JOIN tm_task tt ON bs.task_id = tt.task_id
|
LEFT JOIN tm_task tt ON bs.task_id = tt.task_id
|
||||||
WHERE bs.in_num != 0 and and bs.result_msg = '操作成功'
|
WHERE bs.in_num != 0 and bs.result_msg = '操作成功'
|
||||||
<if test="inputType != null and inputType != ''">
|
<if test="inputType != null and inputType != ''">
|
||||||
and (
|
and (
|
||||||
CASE
|
CASE
|
||||||
|
|
|
||||||
|
|
@ -169,6 +169,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
</foreach>
|
</foreach>
|
||||||
</delete>
|
</delete>
|
||||||
|
|
||||||
|
<delete id="deletePublishTask">
|
||||||
|
delete from lease_out_details where parent_id = #{parentId} and type_id = #{typeId}
|
||||||
|
and publish_task = #{publishTask}
|
||||||
|
<if test="maId != null">
|
||||||
|
and ma_id = #{maId}
|
||||||
|
</if>
|
||||||
|
</delete>
|
||||||
|
|
||||||
<select id="getByParentId" resultType="com.bonus.material.lease.domain.LeaseApplyDetails">
|
<select id="getByParentId" resultType="com.bonus.material.lease.domain.LeaseApplyDetails">
|
||||||
<!--@mbg.generated-->
|
<!--@mbg.generated-->
|
||||||
select
|
select
|
||||||
|
|
|
||||||
|
|
@ -266,7 +266,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
IFNULL( sum( lpd.num ), 0 ) AS preCountNum,
|
IFNULL( sum( lpd.num ), 0 ) AS preCountNum,
|
||||||
IFNULL(lod.num, 0) AS alNum,
|
IFNULL(lod.num, 0) AS alNum,
|
||||||
GROUP_CONCAT( DISTINCT mt1.type_name ) AS maTypeNames,
|
GROUP_CONCAT( DISTINCT mt1.type_name ) AS maTypeNames,
|
||||||
lpd.publish_task AS publishTask
|
lpd.publish_task AS publishTask,
|
||||||
|
lai.task_id AS taskId
|
||||||
FROM
|
FROM
|
||||||
lease_publish_details lpd
|
lease_publish_details lpd
|
||||||
LEFT JOIN lease_apply_info lai ON lai.id = lpd.parent_id
|
LEFT JOIN lease_apply_info lai ON lai.id = lpd.parent_id
|
||||||
|
|
|
||||||
|
|
@ -184,6 +184,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
</delete>
|
</delete>
|
||||||
<delete id="deleteLeaseOutDetails">
|
<delete id="deleteLeaseOutDetails">
|
||||||
delete from lease_out_details where parent_id = #{parentId} and type_id = #{typeId}
|
delete from lease_out_details where parent_id = #{parentId} and type_id = #{typeId}
|
||||||
|
<if test="publishTask != null and publishTask != ''">
|
||||||
|
and publish_task = #{publishTask}
|
||||||
|
</if>
|
||||||
<if test="maId != null">
|
<if test="maId != null">
|
||||||
and ma_id = #{maId}
|
and ma_id = #{maId}
|
||||||
</if>
|
</if>
|
||||||
|
|
|
||||||
|
|
@ -819,7 +819,7 @@
|
||||||
</if>
|
</if>
|
||||||
where tt.task_type = '19'
|
where tt.task_type = '19'
|
||||||
and tt.task_status in (1, 2, 3)
|
and tt.task_status in (1, 2, 3)
|
||||||
<!--<if test="taskStatus != null and taskStatus != ''">
|
<if test="taskStatus != null and taskStatus != ''">
|
||||||
and tt.task_status = #{taskStatus}
|
and tt.task_status = #{taskStatus}
|
||||||
</if>
|
</if>
|
||||||
<if test="taskId != null ">and lai.task_id = #{taskId}</if>
|
<if test="taskId != null ">and lai.task_id = #{taskId}</if>
|
||||||
|
|
@ -833,7 +833,7 @@
|
||||||
AND DATE_FORMAT( lai.create_time, '%Y-%m-%d' ) BETWEEN #{startTime} AND #{endTime}
|
AND DATE_FORMAT( lai.create_time, '%Y-%m-%d' ) BETWEEN #{startTime} AND #{endTime}
|
||||||
</if>
|
</if>
|
||||||
<if test="isApp != null and taskStatus==1">and (tt.task_status = 0 or tt.task_status = 1 or tt.task_status = 2) </if>
|
<if test="isApp != null and taskStatus==1">and (tt.task_status = 0 or tt.task_status = 1 or tt.task_status = 2) </if>
|
||||||
<if test="isApp != null and taskStatus==3">and (tt.task_status = 3 or tt.task_status = 4)</if>-->
|
<if test="isApp != null and taskStatus==3">and (tt.task_status = 3 or tt.task_status = 4)</if>
|
||||||
GROUP BY lai.id
|
GROUP BY lai.id
|
||||||
ORDER BY tt.task_status,tt.create_time desc
|
ORDER BY tt.task_status,tt.create_time desc
|
||||||
</select>
|
</select>
|
||||||
|
|
|
||||||
|
|
@ -144,6 +144,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
<if test="record.maId != null">
|
<if test="record.maId != null">
|
||||||
AND ma_id = #{record.maId}
|
AND ma_id = #{record.maId}
|
||||||
</if>
|
</if>
|
||||||
|
<if test="record.publishTask != null and record.publishTask != ''">
|
||||||
|
AND publish_task = #{record.publishTask}
|
||||||
|
</if>
|
||||||
</delete>
|
</delete>
|
||||||
|
|
||||||
<select id="getSltAgreementInfo" resultType="com.bonus.material.settlement.domain.SltAgreementInfo">
|
<select id="getSltAgreementInfo" resultType="com.bonus.material.settlement.domain.SltAgreementInfo">
|
||||||
|
|
@ -171,6 +174,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
ma_id IS NULL
|
ma_id IS NULL
|
||||||
AND
|
AND
|
||||||
status = '0'
|
status = '0'
|
||||||
|
<if test="publishTask != null and publishTask != ''">
|
||||||
|
AND publish_task = #{publishTask}
|
||||||
|
</if>
|
||||||
AND
|
AND
|
||||||
DATE(start_time) = CURDATE();
|
DATE(start_time) = CURDATE();
|
||||||
</select>
|
</select>
|
||||||
|
|
@ -242,8 +248,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
</update>
|
</update>
|
||||||
|
|
||||||
<insert id="insSltInfo">
|
<insert id="insSltInfo">
|
||||||
insert into slt_agreement_info (agreement_id,type_id,ma_id,num,start_time,status,lease_id,lease_price,buy_price,is_slt,company_id,lease_type,create_time)
|
insert into slt_agreement_info (agreement_id,type_id,ma_id,num,start_time,status,lease_id,lease_price,buy_price,is_slt,company_id,lease_type,create_time,publish_task)
|
||||||
values (#{agreementId},#{record.typeId},#{record.maId},#{record.outNum},now(),0,#{record.parentId},#{ma.finalPrice},#{ma.buyPrice},'0',#{record.companyId},#{record.leaseType},now());
|
values (#{agreementId},#{record.typeId},#{record.maId},#{record.outNum},now(),0,#{record.parentId},#{ma.finalPrice},#{ma.buyPrice},'0',#{record.companyId},#{record.leaseType},now(),#{record.publishTask});
|
||||||
</insert>
|
</insert>
|
||||||
|
|
||||||
<select id="getLeaseList" resultType="com.bonus.material.settlement.domain.SltAgreementInfo">
|
<select id="getLeaseList" resultType="com.bonus.material.settlement.domain.SltAgreementInfo">
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue