This commit is contained in:
parent
99f09396e8
commit
8ebfcc580f
|
|
@ -169,6 +169,10 @@ public class BackApplyController extends BaseController {
|
||||||
return AjaxResult.error("参数错误");
|
return AjaxResult.error("参数错误");
|
||||||
}
|
}
|
||||||
try {
|
try {
|
||||||
|
//查看本次退料申请是否合法
|
||||||
|
if (!backApplyService.isBackApplyNumberCorrect(bean)) {
|
||||||
|
return AjaxResult.error("已申请退料数量加上本次退料申请数量,超过领料出库数量,请重试!");
|
||||||
|
}
|
||||||
//生成退料编码
|
//生成退料编码
|
||||||
String code = backApplyService.genderBackCode();
|
String code = backApplyService.genderBackCode();
|
||||||
if (StringUtils.isEmpty(code)) {
|
if (StringUtils.isEmpty(code)) {
|
||||||
|
|
|
||||||
|
|
@ -40,6 +40,8 @@ public interface BackApplyMapper {
|
||||||
*/
|
*/
|
||||||
String selectTaskNumByMonth(@Param("date") Date date, @Param("taskType") Integer taskType);
|
String selectTaskNumByMonth(@Param("date") Date date, @Param("taskType") Integer taskType);
|
||||||
|
|
||||||
|
List<BackApplyInfo> getBackApplyDetailsTypeCount();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 增加
|
* 增加
|
||||||
* @param bean
|
* @param bean
|
||||||
|
|
|
||||||
|
|
@ -30,6 +30,8 @@ public interface BackApplyService {
|
||||||
*/
|
*/
|
||||||
List<BackApplyInfo> getMaterialList(BackApplyInfo bean);
|
List<BackApplyInfo> getMaterialList(BackApplyInfo bean);
|
||||||
|
|
||||||
|
public boolean isBackApplyNumberCorrect(BackApplyInfo bean);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 生成后台退料编号
|
* 生成后台退料编号
|
||||||
* @return
|
* @return
|
||||||
|
|
|
||||||
|
|
@ -85,6 +85,22 @@ public class BackApplyServiceImpl implements BackApplyService {
|
||||||
return backApplyMapper.getMaterialList(bean);
|
return backApplyMapper.getMaterialList(bean);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean isBackApplyNumberCorrect(BackApplyInfo bean) {
|
||||||
|
boolean isCorrect = true; //默认合法
|
||||||
|
// 查看出库数据
|
||||||
|
List<BackApplyInfo> backTypeList = backApplyMapper.getBackApplyDetailsTypeCount();
|
||||||
|
|
||||||
|
// 查看退料已审核数据
|
||||||
|
|
||||||
|
|
||||||
|
// 比较本次退料数据,是否大于前两者的差额,大于就报错
|
||||||
|
List<BackApplyInfo> backApplyDetails = bean.getBackApplyDetails();
|
||||||
|
|
||||||
|
|
||||||
|
return isCorrect;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String genderBackCode() {
|
public String genderBackCode() {
|
||||||
SimpleDateFormat dateFormat = new SimpleDateFormat("yyyyMMdd");
|
SimpleDateFormat dateFormat = new SimpleDateFormat("yyyyMMdd");
|
||||||
|
|
|
||||||
|
|
@ -529,6 +529,16 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
ORDER BY create_time DESC LIMIT 1
|
ORDER BY create_time DESC LIMIT 1
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
|
<select id="getBackApplyDetailsTypeCount" resultType="com.bonus.sgzb.base.api.domain.BackApplyInfo">
|
||||||
|
select bad.type_id as typeId, sum(bad.audit_num) as backNum
|
||||||
|
from back_apply_details bad
|
||||||
|
LEFT join back_apply_info bai on bai.id = bad.parent_id
|
||||||
|
LEFT join tm_task tt on bai.task_id = tt.task_id
|
||||||
|
LEFT join tm_task_agreement tta on tta.task_id = tt.task_id
|
||||||
|
where tta.agreement_id = #{agreementId}
|
||||||
|
group by bad.type_id
|
||||||
|
</select>
|
||||||
|
|
||||||
<select id="getView" resultType="com.bonus.sgzb.base.api.domain.BackApplyInfo">
|
<select id="getView" resultType="com.bonus.sgzb.base.api.domain.BackApplyInfo">
|
||||||
SELECT
|
SELECT
|
||||||
bai.back_person AS backPerson,
|
bai.back_person AS backPerson,
|
||||||
|
|
@ -950,5 +960,4 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
(SELECT * FROM back_apply_info bai2 WHERE bai2.id = #{id}) dd
|
(SELECT * FROM back_apply_info bai2 WHERE bai2.id = #{id}) dd
|
||||||
on bai1.task_id = dd.task_id
|
on bai1.task_id = dd.task_id
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
</mapper>
|
</mapper>
|
||||||
Loading…
Reference in New Issue