This commit is contained in:
parent
abcbeff813
commit
8257f1c3bd
|
|
@ -291,4 +291,11 @@ public interface LeaseTaskMapper {
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
int updateLeaseOutNumNew(LeaseApplyDetails leaseApplyDetails);
|
int updateLeaseOutNumNew(LeaseApplyDetails leaseApplyDetails);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 领用申请详情修改 -- 减少领用数量
|
||||||
|
* @param bean
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
int insertBackRecordByMaId(LeaseApplyDetails bean);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -55,6 +55,7 @@ import org.springframework.util.CollectionUtils;
|
||||||
import org.springframework.web.util.UriComponentsBuilder;
|
import org.springframework.web.util.UriComponentsBuilder;
|
||||||
|
|
||||||
import javax.annotation.Resource;
|
import javax.annotation.Resource;
|
||||||
|
import java.math.BigDecimal;
|
||||||
import java.text.SimpleDateFormat;
|
import java.text.SimpleDateFormat;
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
|
|
@ -1205,14 +1206,51 @@ public class LeaseTaskServiceImpl implements ILeaseTaskService {
|
||||||
if (res == GlobalConstants.INT_0) {
|
if (res == GlobalConstants.INT_0) {
|
||||||
throw new RuntimeException("出库失败,插入结算记录失败");
|
throw new RuntimeException("出库失败,插入结算记录失败");
|
||||||
}
|
}
|
||||||
return AjaxResult.success("领用出库驳回成功");
|
|
||||||
|
//增加退回记录
|
||||||
|
insertBackRecord(leaseApplyDetails);
|
||||||
|
return AjaxResult.success("领用出库退回成功");
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
|
TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
|
||||||
log.error("领用出库驳回失败:",e.getMessage());
|
log.error("领用出库退回失败:",e.getMessage());
|
||||||
return AjaxResult.error("领用出库驳回失败");
|
return AjaxResult.error("领用出库退回失败");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 添加退回记录
|
||||||
|
* @param leaseApplyDetails
|
||||||
|
*/
|
||||||
|
public void insertBackRecord(LeaseApplyDetails leaseApplyDetails) {
|
||||||
|
// 查询当前登陆用户信息
|
||||||
|
Long theLoginUserId = SecurityUtils.getLoginUser().getSysUser().getUserId();
|
||||||
|
LeaseApplyDetails bean = new LeaseApplyDetails();
|
||||||
|
//判断是编码还是数量
|
||||||
|
if (leaseApplyDetails.getMaCodeVoList()!=null){
|
||||||
|
//编码
|
||||||
|
for (MaCodeVo maCodeVo : leaseApplyDetails.getMaCodeVoList()) {
|
||||||
|
//添加退回记录
|
||||||
|
bean.setMaId(maCodeVo.getMaId());
|
||||||
|
bean.setParentId(leaseApplyDetails.getParentId());
|
||||||
|
bean.setTypeId(leaseApplyDetails.getTypeId());
|
||||||
|
bean.setNewTypeId(leaseApplyDetails.getNewTypeId());
|
||||||
|
bean.setNum(BigDecimal.valueOf(1));
|
||||||
|
bean.setCreateBy(String.valueOf(theLoginUserId));
|
||||||
|
int res = mapper.insertBackRecordByMaId(bean);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
//数量
|
||||||
|
bean.setParentId(leaseApplyDetails.getParentId());
|
||||||
|
bean.setTypeId(leaseApplyDetails.getTypeId());
|
||||||
|
bean.setNewTypeId(leaseApplyDetails.getNewTypeId());
|
||||||
|
bean.setNum(leaseApplyDetails.getAlNum());
|
||||||
|
bean.setCreateBy(String.valueOf(theLoginUserId));
|
||||||
|
bean.setNum(leaseApplyDetails.getNum());
|
||||||
|
int res = mapper.insertBackRecordByMaId(bean);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 删除结算记录
|
* 删除结算记录
|
||||||
* @param leaseApplyDetails
|
* @param leaseApplyDetails
|
||||||
|
|
|
||||||
|
|
@ -969,6 +969,27 @@
|
||||||
<if test="isExamine != null">#{isExamine},</if>
|
<if test="isExamine != null">#{isExamine},</if>
|
||||||
</trim>
|
</trim>
|
||||||
</insert>
|
</insert>
|
||||||
|
<insert id="insertBackRecordByMaId">
|
||||||
|
insert into lease_back_record
|
||||||
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||||
|
<if test="parentId != null">parent_id,</if>
|
||||||
|
<if test="typeId != null">type_id,</if>
|
||||||
|
<if test="newTypeId != null">new_type,</if>
|
||||||
|
<if test="maId != null">ma_id,</if>
|
||||||
|
<if test="num != null">num,</if>
|
||||||
|
<if test="createBy != null">create_by,</if>
|
||||||
|
create_time,
|
||||||
|
</trim>
|
||||||
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||||
|
<if test="parentId != null">#{parentId},</if>
|
||||||
|
<if test="typeId != null">#{typeId},</if>
|
||||||
|
<if test="newTypeId != null">#{newTypeId},</if>
|
||||||
|
<if test="maId != null">#{maId},</if>
|
||||||
|
<if test="num != null">#{num},</if>
|
||||||
|
<if test="createBy != null">#{createBy},</if>
|
||||||
|
now(),
|
||||||
|
</trim>
|
||||||
|
</insert>
|
||||||
|
|
||||||
<select id="selectWorkPeopleInfoList" resultMap="WorkPeopleInfoResult">
|
<select id="selectWorkPeopleInfoList" resultMap="WorkPeopleInfoResult">
|
||||||
SELECT
|
SELECT
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue