app内部驳回操作
This commit is contained in:
parent
9200a1e869
commit
75db3516e3
|
|
@ -54,7 +54,7 @@ public class BackApplyController extends BaseController {
|
||||||
@PostMapping("getbackList")
|
@PostMapping("getbackList")
|
||||||
public AjaxResult getbackList(@RequestBody BackApplyInfo record) {
|
public AjaxResult getbackList(@RequestBody BackApplyInfo record) {
|
||||||
try {
|
try {
|
||||||
List<BackApplyInfo> list =backApplyService.getbackList(record);
|
List<BackApplyInfo> list = backApplyService.getbackList(record);
|
||||||
return success(list);
|
return success(list);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
throw new RuntimeException(e);
|
throw new RuntimeException(e);
|
||||||
|
|
@ -71,7 +71,7 @@ public class BackApplyController extends BaseController {
|
||||||
@PostMapping("materialList")
|
@PostMapping("materialList")
|
||||||
public AjaxResult materialList(@RequestBody BackApplyInfo record) {
|
public AjaxResult materialList(@RequestBody BackApplyInfo record) {
|
||||||
try {
|
try {
|
||||||
List<BackApplyInfo> list =backApplyService.materialList(record);
|
List<BackApplyInfo> list = backApplyService.materialList(record);
|
||||||
return success(list);
|
return success(list);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
throw new RuntimeException(e);
|
throw new RuntimeException(e);
|
||||||
|
|
@ -88,7 +88,7 @@ public class BackApplyController extends BaseController {
|
||||||
@PostMapping("view")
|
@PostMapping("view")
|
||||||
public AjaxResult view(@RequestBody BackApplyInfo record) {
|
public AjaxResult view(@RequestBody BackApplyInfo record) {
|
||||||
try {
|
try {
|
||||||
List<BackApplyInfo> list =backApplyService.view(record);
|
List<BackApplyInfo> list = backApplyService.view(record);
|
||||||
return success(list);
|
return success(list);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
throw new RuntimeException(e);
|
throw new RuntimeException(e);
|
||||||
|
|
@ -105,7 +105,7 @@ public class BackApplyController extends BaseController {
|
||||||
@PostMapping("examineView")
|
@PostMapping("examineView")
|
||||||
public AjaxResult examineView(@RequestBody BackApplyInfo record) {
|
public AjaxResult examineView(@RequestBody BackApplyInfo record) {
|
||||||
try {
|
try {
|
||||||
List<BackApplyInfo> list =backApplyService.examineView(record);
|
List<BackApplyInfo> list = backApplyService.examineView(record);
|
||||||
return success(list);
|
return success(list);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
throw new RuntimeException(e);
|
throw new RuntimeException(e);
|
||||||
|
|
@ -122,10 +122,10 @@ public class BackApplyController extends BaseController {
|
||||||
@PostMapping("del")
|
@PostMapping("del")
|
||||||
public AjaxResult del(@RequestBody BackApplyInfo record) {
|
public AjaxResult del(@RequestBody BackApplyInfo record) {
|
||||||
try {
|
try {
|
||||||
int re =backApplyService.del(record);
|
int re = backApplyService.del(record);
|
||||||
if (re>0){
|
if (re > 0) {
|
||||||
return AjaxResult.success("删除成功");
|
return AjaxResult.success("删除成功");
|
||||||
}else {
|
} else {
|
||||||
return AjaxResult.error("删除失败");
|
return AjaxResult.error("删除失败");
|
||||||
}
|
}
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
|
|
@ -143,7 +143,7 @@ public class BackApplyController extends BaseController {
|
||||||
@PostMapping("getbackUnit")
|
@PostMapping("getbackUnit")
|
||||||
public AjaxResult getbackUnit(@RequestBody BmAgreementInfo record) {
|
public AjaxResult getbackUnit(@RequestBody BmAgreementInfo record) {
|
||||||
try {
|
try {
|
||||||
List<BmAgreementInfo> list =backApplyService.getbackUnit(record);
|
List<BmAgreementInfo> list = backApplyService.getbackUnit(record);
|
||||||
return success(list);
|
return success(list);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
throw new RuntimeException(e);
|
throw new RuntimeException(e);
|
||||||
|
|
@ -160,7 +160,7 @@ public class BackApplyController extends BaseController {
|
||||||
@PostMapping("getbackPro")
|
@PostMapping("getbackPro")
|
||||||
public AjaxResult getbackPro(@RequestBody BmAgreementInfo record) {
|
public AjaxResult getbackPro(@RequestBody BmAgreementInfo record) {
|
||||||
try {
|
try {
|
||||||
List<BmAgreementInfo> list =backApplyService.getbackPro(record);
|
List<BmAgreementInfo> list = backApplyService.getbackPro(record);
|
||||||
return success(list);
|
return success(list);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
throw new RuntimeException(e);
|
throw new RuntimeException(e);
|
||||||
|
|
@ -183,21 +183,21 @@ public class BackApplyController extends BaseController {
|
||||||
// 创建任务(tm_task)
|
// 创建任务(tm_task)
|
||||||
task.setCode(code);
|
task.setCode(code);
|
||||||
boolean addTaskResult = backApplyService.insertTask(task) > 0;
|
boolean addTaskResult = backApplyService.insertTask(task) > 0;
|
||||||
if (addTaskResult){
|
if (addTaskResult) {
|
||||||
//任务协议表(tm_task_agreement)
|
//任务协议表(tm_task_agreement)
|
||||||
Boolean addTaskAgreementRes = backApplyService.insertTaskAgreement(task)>0;
|
Boolean addTaskAgreementRes = backApplyService.insertTaskAgreement(task) > 0;
|
||||||
if (addTaskAgreementRes){
|
if (addTaskAgreementRes) {
|
||||||
//退料任务表(back_apply_info)
|
//退料任务表(back_apply_info)
|
||||||
Boolean addBackApply=backApplyService.insertBackApply(task)>0;
|
Boolean addBackApply = backApplyService.insertBackApply(task) > 0;
|
||||||
if (addBackApply){
|
if (addBackApply) {
|
||||||
return AjaxResult.success("任务创建成功,已完成");
|
return AjaxResult.success("任务创建成功,已完成");
|
||||||
}else {
|
} else {
|
||||||
return AjaxResult.error("退料任务创建失败");
|
return AjaxResult.error("退料任务创建失败");
|
||||||
}
|
}
|
||||||
}else {
|
} else {
|
||||||
return AjaxResult.error("创建任务协议失败");
|
return AjaxResult.error("创建任务协议失败");
|
||||||
}
|
}
|
||||||
}else {
|
} else {
|
||||||
return AjaxResult.error("创建任务失败");
|
return AjaxResult.error("创建任务失败");
|
||||||
}
|
}
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
|
|
@ -215,18 +215,18 @@ public class BackApplyController extends BaseController {
|
||||||
@PostMapping("upload")
|
@PostMapping("upload")
|
||||||
public AjaxResult upload(@RequestBody BackApplyInfo record) {
|
public AjaxResult upload(@RequestBody BackApplyInfo record) {
|
||||||
try {
|
try {
|
||||||
if (CollUtil.isEmpty(record.getBackApplyDetails())){
|
if (CollUtil.isEmpty(record.getBackApplyDetails())) {
|
||||||
return AjaxResult.error("退料设备明细为空,请重新选择后上传!");
|
return AjaxResult.error("退料设备明细为空,请重新选择后上传!");
|
||||||
}
|
}
|
||||||
for (BackApplyInfo backApplyInfo : record.getBackApplyDetails()){
|
for (BackApplyInfo backApplyInfo : record.getBackApplyDetails()) {
|
||||||
backApplyInfo.setParentId(record.getParentId());
|
backApplyInfo.setParentId(record.getParentId());
|
||||||
boolean re =backApplyService.upload(backApplyInfo)>0;
|
boolean re = backApplyService.upload(backApplyInfo) > 0;
|
||||||
if (!re){
|
if (!re) {
|
||||||
return AjaxResult.error("退料任务明细插入失败");
|
return AjaxResult.error("退料任务明细插入失败");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return AjaxResult.success("退料任务明细插入成功,已完成");
|
return AjaxResult.success("退料任务明细插入成功,已完成");
|
||||||
}catch (Exception e){
|
} catch (Exception e) {
|
||||||
return AjaxResult.error("创建任务失败," + e.getCause().toString() + "," + e.getMessage());
|
return AjaxResult.error("创建任务失败," + e.getCause().toString() + "," + e.getMessage());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -236,20 +236,19 @@ public class BackApplyController extends BaseController {
|
||||||
SimpleDateFormat dateFormat = new SimpleDateFormat("yyyyMMdd");
|
SimpleDateFormat dateFormat = new SimpleDateFormat("yyyyMMdd");
|
||||||
Date nowDate = DateUtils.getNowDate();
|
Date nowDate = DateUtils.getNowDate();
|
||||||
String format = dateFormat.format(nowDate);
|
String format = dateFormat.format(nowDate);
|
||||||
int taskNum = tmTaskService.selectTaskNumByMonth(nowDate,36) + 1;
|
int taskNum = tmTaskService.selectTaskNumByMonth(nowDate, 36) + 1;
|
||||||
String code="";
|
String code = "";
|
||||||
if (taskNum>9 && taskNum<100){
|
if (taskNum > 9 && taskNum < 100) {
|
||||||
code = "T" + format + "-00" + taskNum;
|
code = "T" + format + "-00" + taskNum;
|
||||||
}else if (taskNum>99 && taskNum<1000){
|
} else if (taskNum > 99 && taskNum < 1000) {
|
||||||
code = "T" + format + "-0" + taskNum;
|
code = "T" + format + "-0" + taskNum;
|
||||||
}else {
|
} else {
|
||||||
code = "T" + format + "-000" + taskNum;
|
code = "T" + format + "-000" + taskNum;
|
||||||
}
|
}
|
||||||
return code;
|
return code;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 退料审核列表
|
* 退料审核列表
|
||||||
*
|
*
|
||||||
|
|
@ -260,7 +259,7 @@ public class BackApplyController extends BaseController {
|
||||||
@PostMapping("examineList")
|
@PostMapping("examineList")
|
||||||
public AjaxResult examineList(@RequestBody BackApplyInfo record) {
|
public AjaxResult examineList(@RequestBody BackApplyInfo record) {
|
||||||
try {
|
try {
|
||||||
List<BackApplyInfo> list =backApplyService.examineList(record);
|
List<BackApplyInfo> list = backApplyService.examineList(record);
|
||||||
return success(list);
|
return success(list);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
throw new RuntimeException(e);
|
throw new RuntimeException(e);
|
||||||
|
|
@ -268,12 +267,17 @@ public class BackApplyController extends BaseController {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ApiOperation("退料审核列表-审核")
|
@ApiOperation("退料审核通过")
|
||||||
@Log(title = "退料审核列表-审核", businessType = BusinessType.UPDATE)
|
@Log(title = "退料审核通过", businessType = BusinessType.UPDATE)
|
||||||
@PostMapping("/audit")
|
@PostMapping("/audit")
|
||||||
public AjaxResult audit(@RequestBody BackApplyInfo record)
|
public AjaxResult audit(@RequestBody BackApplyInfo record) {
|
||||||
{
|
|
||||||
return toAjax(backApplyService.audit(record));
|
return toAjax(backApplyService.audit(record));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ApiOperation("退料审核驳回")
|
||||||
|
@Log(title = "退料审核驳回", businessType = BusinessType.UPDATE)
|
||||||
|
@PostMapping("/refuse")
|
||||||
|
public AjaxResult refuse(@RequestBody BackApplyInfo record) {
|
||||||
|
return toAjax(backApplyService.refuse(record));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -56,24 +56,24 @@ public class TmTaskController extends BaseController {
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 领料审核,分公司,分管,机具分公司统一接口
|
* 领料审核通过,分公司,分管,机具分公司统一接口
|
||||||
*
|
*
|
||||||
* @param task 审核信息
|
* @param task 审核信息
|
||||||
* @return 结果
|
* @return 结果
|
||||||
*/
|
*/
|
||||||
@Log(title = "领料审核", businessType = BusinessType.UPDATE)
|
@Log(title = "领料审核通过", businessType = BusinessType.UPDATE)
|
||||||
@PostMapping("auditLeaseByCompany")
|
@PostMapping("auditLeaseByCompany")
|
||||||
public AjaxResult auditLeaseByCompany(@RequestBody TmTask task) {
|
public AjaxResult auditLeaseByCompany(@RequestBody TmTask task) {
|
||||||
return toAjax(tmTaskService.updateLeaseTaskAuditInfo(task));
|
return toAjax(tmTaskService.updateLeaseTaskAuditInfo(task));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 领料驳回,分公司,分管,机具分公司统一接口
|
* 领料审核驳回,分公司,分管,机具分公司统一接口
|
||||||
*
|
*
|
||||||
* @param task
|
* @param task
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
@Log(title = "领料驳回", businessType = BusinessType.UPDATE)
|
@Log(title = "领料审核驳回", businessType = BusinessType.UPDATE)
|
||||||
@PostMapping("rejectLeaseByCompany")
|
@PostMapping("rejectLeaseByCompany")
|
||||||
public AjaxResult rejectLeaseByCompany(@RequestBody TmTask task) {
|
public AjaxResult rejectLeaseByCompany(@RequestBody TmTask task) {
|
||||||
return toAjax(tmTaskService.updateLeaseTaskRejectInfo(task));
|
return toAjax(tmTaskService.updateLeaseTaskRejectInfo(task));
|
||||||
|
|
|
||||||
|
|
@ -41,4 +41,6 @@ public interface BackApplyMapper {
|
||||||
List<BackApplyInfo> examineView(BackApplyInfo record);
|
List<BackApplyInfo> examineView(BackApplyInfo record);
|
||||||
|
|
||||||
int audit(BackApplyInfo record);
|
int audit(BackApplyInfo record);
|
||||||
|
|
||||||
|
int refuse(BackApplyInfo record);
|
||||||
}
|
}
|
||||||
|
|
@ -45,4 +45,6 @@ public interface BackApplyService {
|
||||||
List<BackApplyInfo> examineView(BackApplyInfo record);
|
List<BackApplyInfo> examineView(BackApplyInfo record);
|
||||||
|
|
||||||
int audit(BackApplyInfo record);
|
int audit(BackApplyInfo record);
|
||||||
|
|
||||||
|
int refuse(BackApplyInfo record);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -83,4 +83,9 @@ public class BackApplyServiceImpl implements BackApplyService {
|
||||||
return backApplyMapper.audit(record);
|
return backApplyMapper.audit(record);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int refuse(BackApplyInfo record) {
|
||||||
|
return backApplyMapper.refuse(record);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -276,12 +276,44 @@
|
||||||
</insert>
|
</insert>
|
||||||
<update id="audit">
|
<update id="audit">
|
||||||
UPDATE tm_task tt
|
UPDATE tm_task tt
|
||||||
LEFT JOIN back_apply_info bai ON bai.task_id = tt.task_id
|
LEFT JOIN back_apply_info bai ON bai.task_id = tt.task_id
|
||||||
LEFT JOIN back_apply_details bad on bad.parent_id=bai.id
|
LEFT JOIN back_apply_details bad on bad.parent_id=bai.id
|
||||||
SET tt.task_status = '38',bad.audit_num=bad.pre_num,bai.direct_audit_by=#{createBy},bai.direct_audit_time=NOW()
|
<if test="taskStatus == 107">
|
||||||
|
SET tt.task_status = #{taskStatus},bad.audit_num=bad.pre_num,bai.direct_audit_by=#{createBy},bad.status='5',bai.direct_audit_time=NOW()
|
||||||
|
</if>
|
||||||
|
<if test="taskStatus == 109">
|
||||||
|
SET tt.task_status = #{taskStatus},bad.audit_num=bad.pre_num,bai.direct_audit_by=#{createBy},bad.status='7',bai.direct_audit_time=NOW()
|
||||||
|
</if>
|
||||||
|
<if test="taskStatus == 103">
|
||||||
|
SET tt.task_status = #{taskStatus},bad.audit_num=bad.pre_num,bai.direct_audit_by=#{createBy},bad.status='1',bai.direct_audit_time=NOW()
|
||||||
|
</if>
|
||||||
|
<if test="taskStatus == 105">
|
||||||
|
SET tt.task_status = #{taskStatus},bad.audit_num=bad.pre_num,bai.direct_audit_by=#{createBy},bad.status='3',bai.direct_audit_time=NOW()
|
||||||
|
</if>
|
||||||
WHERE
|
WHERE
|
||||||
bai.id = #{id}
|
bai.id = #{id}
|
||||||
</update>
|
</update>
|
||||||
|
|
||||||
|
<update id="refuse">
|
||||||
|
UPDATE tm_task tt
|
||||||
|
LEFT JOIN back_apply_info bai ON bai.task_id = tt.task_id
|
||||||
|
LEFT JOIN back_apply_details bad on bad.parent_id=bai.id
|
||||||
|
<if test="taskStatus == 108">
|
||||||
|
SET tt.task_status = #{taskStatus},bad.audit_num=bad.pre_num,bai.direct_audit_by=#{createBy},bad.status='6',bai.direct_audit_time=NOW()
|
||||||
|
</if>
|
||||||
|
<if test="taskStatus == 110">
|
||||||
|
SET tt.task_status = #{taskStatus},bad.audit_num=bad.pre_num,bai.direct_audit_by=#{createBy},bad.status='8',bai.direct_audit_time=NOW()
|
||||||
|
</if>
|
||||||
|
<if test="taskStatus == 104">
|
||||||
|
SET tt.task_status = #{taskStatus},bad.audit_num=bad.pre_num,bai.direct_audit_by=#{createBy},bad.status='2',bai.direct_audit_time=NOW()
|
||||||
|
</if>
|
||||||
|
<if test="taskStatus == 106">
|
||||||
|
SET tt.task_status = #{taskStatus},bad.audit_num=bad.pre_num,bai.direct_audit_by=#{createBy},bad.status='4',bai.direct_audit_time=NOW()
|
||||||
|
</if>
|
||||||
|
WHERE
|
||||||
|
bai.id = #{id}
|
||||||
|
</update>
|
||||||
|
|
||||||
<delete id="del">
|
<delete id="del">
|
||||||
DELETE
|
DELETE
|
||||||
FROM tm_task_agreement
|
FROM tm_task_agreement
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue