|
@@ -1,6 +1,7 @@
|
|
package org.jeecg.modules.report.controller;
|
|
package org.jeecg.modules.report.controller;
|
|
|
|
|
|
|
|
|
|
|
|
+import cn.hutool.core.date.DateTime;
|
|
import com.alibaba.fastjson.JSON;
|
|
import com.alibaba.fastjson.JSON;
|
|
import com.alibaba.fastjson.JSONObject;
|
|
import com.alibaba.fastjson.JSONObject;
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
@@ -10,6 +11,7 @@ import lombok.extern.slf4j.Slf4j;
|
|
import org.jeecg.common.api.vo.Result;
|
|
import org.jeecg.common.api.vo.Result;
|
|
import org.jeecg.common.aspect.annotation.AutoLog;
|
|
import org.jeecg.common.aspect.annotation.AutoLog;
|
|
import org.jeecg.common.system.api.ISysBaseAPI;
|
|
import org.jeecg.common.system.api.ISysBaseAPI;
|
|
|
|
+import org.jeecg.common.util.DateUtils;
|
|
import org.jeecg.common.util.oConvertUtils;
|
|
import org.jeecg.common.util.oConvertUtils;
|
|
import org.jeecg.modules.base.service.BaseCommonService;
|
|
import org.jeecg.modules.base.service.BaseCommonService;
|
|
import org.jeecg.modules.report.entity.*;
|
|
import org.jeecg.modules.report.entity.*;
|
|
@@ -26,6 +28,7 @@ import javax.annotation.Resource;
|
|
import java.io.IOException;
|
|
import java.io.IOException;
|
|
import java.net.URLEncoder;
|
|
import java.net.URLEncoder;
|
|
import java.util.Collection;
|
|
import java.util.Collection;
|
|
|
|
+import java.util.Date;
|
|
import java.util.List;
|
|
import java.util.List;
|
|
import java.util.Map;
|
|
import java.util.Map;
|
|
|
|
|
|
@@ -170,4 +173,64 @@ public class FabricLossController {
|
|
ret.setMessage("保存成功");
|
|
ret.setMessage("保存成功");
|
|
return ret;
|
|
return ret;
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ /**
|
|
|
|
+ *
|
|
|
|
+ * @param params
|
|
|
|
+ * ccode - 计划号
|
|
|
|
+ * actionUser - 执行人
|
|
|
|
+ * actionTime - 执行时间
|
|
|
|
+ * action - 执行内容:提交,面损表初审,面损表终审,面损表初审驳回,面损表终审驳回
|
|
|
|
+ * @return
|
|
|
|
+ */
|
|
|
|
+ @AutoLog(value = "面料损耗-流程回调")
|
|
|
|
+ @ApiOperation(value="面料损耗-流程回调", notes="面料损耗-流程回调")
|
|
|
|
+ @PostMapping(value = "/applyCallback")
|
|
|
|
+ public Result<?> applyCallback(@RequestBody Map<String,Object> params) {
|
|
|
|
+ Result<String> result = new Result<>();
|
|
|
|
+ try {
|
|
|
|
+ String ccode = oConvertUtils.getString(params.get("ccode"));
|
|
|
|
+ String actionUser = oConvertUtils.getString(params.get("actionUser"));
|
|
|
|
+ String actionTime = oConvertUtils.getString(params.get("actionTime"));
|
|
|
|
+ String action = oConvertUtils.getString(params.get("action"));
|
|
|
|
+ Date dtActionTime = DateUtils.str2Date(actionTime, DateUtils.datetimeFormat.get());
|
|
|
|
+
|
|
|
|
+ System.out.println("面损表流程回调参数:" + ccode + "," + actionUser + "," + actionTime + "," + action);
|
|
|
|
+
|
|
|
|
+ QueryWrapper<SyFabricLossReport> queryWrapper = new QueryWrapper<>();
|
|
|
|
+ queryWrapper.eq("plan_code", ccode);
|
|
|
|
+ List<SyFabricLossReport> fabricLossReportList = syFabricLossReportService.list(queryWrapper);
|
|
|
|
+ if (fabricLossReportList.size()>0){
|
|
|
|
+ SyFabricLossReport fabricLossReport = fabricLossReportList.get(0);
|
|
|
|
+ if ("提交".equalsIgnoreCase(action)){
|
|
|
|
+ fabricLossReport.setSubmitBy(actionUser);
|
|
|
|
+ fabricLossReport.setSubmitDate(dtActionTime);
|
|
|
|
+ fabricLossReport.setStatus(action);
|
|
|
|
+ syFabricLossReportService.updateById(fabricLossReport);
|
|
|
|
+ }else if ("面损表初审".equalsIgnoreCase(action)){
|
|
|
|
+ fabricLossReport.setFirstApproveBy(actionUser);
|
|
|
|
+ fabricLossReport.setFirstApproveDate(dtActionTime);
|
|
|
|
+ fabricLossReport.setStatus("初审通过");
|
|
|
|
+ syFabricLossReportService.updateById(fabricLossReport);
|
|
|
|
+ }else if ("面损表终审".equalsIgnoreCase(action)){
|
|
|
|
+ fabricLossReport.setFinalApproveBy(actionUser);
|
|
|
|
+ fabricLossReport.setFinalApproveDate(dtActionTime);
|
|
|
|
+ fabricLossReport.setStatus("完成");
|
|
|
|
+ syFabricLossReportService.updateById(fabricLossReport);
|
|
|
|
+ }else if (("面损表初审驳回".equalsIgnoreCase(action) || "面损表终审驳回".equalsIgnoreCase(action)) &&
|
|
|
|
+ oConvertUtils.isEmpty(fabricLossReport.getRejectBy())){
|
|
|
|
+ fabricLossReport.setRejectBy(actionUser);
|
|
|
|
+ fabricLossReport.setRejectDate(dtActionTime);
|
|
|
|
+ fabricLossReport.setStatus("返单");
|
|
|
|
+ syFabricLossReportService.updateById(fabricLossReport);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ result.success("");
|
|
|
|
+ }catch (Exception ex){
|
|
|
|
+ ex.printStackTrace();
|
|
|
|
+ result.error500(ex.getMessage());
|
|
|
|
+ }
|
|
|
|
+ return result;
|
|
|
|
+ }
|
|
|
|
+
|
|
}
|
|
}
|