退料申请表数据问题修改
This commit is contained in:
parent
32b9538771
commit
73195a84c5
|
|
@ -126,7 +126,7 @@ public class BackApplyController extends BaseController {
|
||||||
*/
|
*/
|
||||||
@ApiOperation(value = "退料申请详情修改")
|
@ApiOperation(value = "退料申请详情修改")
|
||||||
@PostMapping("/setModify")
|
@PostMapping("/setModify")
|
||||||
public AjaxResult setModify(@RequestBody BackApplyInfo bean) {
|
public AjaxResult setModify(@RequestBody List<BackApplyInfo> bean) {
|
||||||
return backApplyService.setModify(bean);
|
return backApplyService.setModify(bean);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -77,7 +77,7 @@ public interface BackApplyService {
|
||||||
* @param bean
|
* @param bean
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
AjaxResult setModify(BackApplyInfo bean);
|
AjaxResult setModify(List<BackApplyInfo> bean);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 删除
|
* 删除
|
||||||
|
|
|
||||||
|
|
@ -153,22 +153,28 @@ public class BackApplyServiceImpl implements BackApplyService {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public AjaxResult setModify(BackApplyInfo bean) {
|
public AjaxResult setModify(List<BackApplyInfo> bean) {
|
||||||
if (!StringUtils.isEmpty(bean.getDetailsId()) && !StringUtils.isEmpty(bean.getNum())) {
|
if (CollUtil.isNotEmpty(bean)) {
|
||||||
String[] detailsId = bean.getDetailsId().split(",");
|
for (BackApplyInfo backApplyInfo : bean) {
|
||||||
String[] num = bean.getNum().split(",");
|
if (!StringUtils.isEmpty(backApplyInfo.getDetailsId()) && !StringUtils.isEmpty(backApplyInfo.getNum())) {
|
||||||
for (int i = 0; i < detailsId.length; i++) {
|
String[] detailsId = backApplyInfo.getDetailsId().split(",");
|
||||||
String detailsIds = detailsId[i];
|
String[] num = backApplyInfo.getNum().split(",");
|
||||||
String nums = num[i];
|
for (int i = 0; i < detailsId.length; i++) {
|
||||||
int re = backApplyMapper.setModify(detailsIds, nums);
|
String detailsIds = detailsId[i];
|
||||||
if (re < 1) {
|
String nums = num[i];
|
||||||
return AjaxResult.error("修改失败");
|
int re = backApplyMapper.setModify(detailsIds, nums);
|
||||||
|
if (re < 1) {
|
||||||
|
return AjaxResult.error("修改失败");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
return AjaxResult.error("未获取到详情id或退料数量");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return AjaxResult.success("修改成功");
|
|
||||||
} else {
|
} else {
|
||||||
return AjaxResult.error("修改失败,未获取到参数");
|
return AjaxResult.error("未获取到参数");
|
||||||
}
|
}
|
||||||
|
return AjaxResult.success("修改成功");
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
||||||
|
|
@ -672,6 +672,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
mt2.type_name AS typeName,
|
mt2.type_name AS typeName,
|
||||||
bagi.agreement_code as agreementCode,
|
bagi.agreement_code as agreementCode,
|
||||||
bai.`status` as `status`,
|
bai.`status` as `status`,
|
||||||
|
bad.id as detailsId,
|
||||||
bad.pre_num AS num
|
bad.pre_num AS num
|
||||||
FROM
|
FROM
|
||||||
back_apply_details bad
|
back_apply_details bad
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue