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