ApplyPaymentController.java 25 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602
  1. package com.idea.oa.apply.controller;
  2. import com.github.pagehelper.PageInfo;
  3. import com.rockstar.flow.exception.FlowException;
  4. import com.idea.oa.apply.model.ApplyPayment;
  5. import com.idea.oa.apply.model.inout.AddConfirmResultPayment;
  6. import com.idea.oa.apply.model.inout.ApplyPaymentIn;
  7. import com.idea.oa.apply.service.ApplyPaymentService;
  8. import com.idea.oa.apply.util.constant.ConstantFlowType;
  9. import com.idea.oa.flow2.model.FlowMain;
  10. import com.idea.oa.flow2.model.FlowMainPush;
  11. import com.idea.oa.flow2.model.in.FlowMainCcVo;
  12. import com.idea.oa.flow2.service.FlowMainCcService;
  13. import com.idea.oa.flow2.service.FlowMainPushService;
  14. import com.idea.oa.flow2.service.FlowMainService;
  15. import com.idea.oa.outsource.model.OutOrderPay;
  16. import com.idea.oa.outsource.service.OutOrderPayService;
  17. import com.rockstar.common.base.BaseController;
  18. import com.rockstar.common.domain.AjaxResult;
  19. import com.rockstar.frame.model.extend.DateTrans;
  20. import com.rockstar.frame.model.extend.TableSplitResult;
  21. import com.rockstar.frame.model.extend.Tablepar;
  22. import com.rockstar.shiro.util.ShiroUtils;
  23. import io.swagger.annotations.Api;
  24. import org.springframework.beans.factory.annotation.Autowired;
  25. import org.springframework.stereotype.Controller;
  26. import org.springframework.transaction.annotation.Transactional;
  27. import org.springframework.util.StringUtils;
  28. import org.springframework.web.bind.annotation.PathVariable;
  29. import org.springframework.web.bind.annotation.PostMapping;
  30. import org.springframework.web.bind.annotation.RequestMapping;
  31. import org.springframework.web.bind.annotation.ResponseBody;
  32. import java.util.Date;
  33. import java.util.List;
  34. import java.util.Map;
  35. /**
  36. * Created by zt
  37. */
  38. @Controller
  39. @RequestMapping(value = "/ApplyPaymentController")
  40. @Api(value = "申请流程/分表_付款申请表")
  41. public class ApplyPaymentController extends BaseController {
  42. // @Autowired
  43. // private FlowService flowService;
  44. // @Autowired
  45. // private TaskService taskService;
  46. //主表
  47. @Autowired
  48. private ApplyPaymentService modelService;
  49. @Autowired
  50. private FlowMainService flowMainService;
  51. // @Autowired
  52. // private FlowMainLogService flowMainLogService;
  53. @Autowired
  54. private FlowMainCcService flowMainCcService;
  55. @Autowired
  56. private FlowMainPushService flowMainPushService;
  57. @Autowired
  58. private OutOrderPayService outOrderPayService;
  59. // @Autowired
  60. // private ProActiService proActiService;
  61. @PostMapping(value = "findApplyPaymentListByInfo", produces = {"application/json;charset=UTF-8"})
  62. @ResponseBody
  63. public TableSplitResult findApplyPaymentListByInfo(Tablepar tablepar, String name,String startTime,String endTime) {
  64. PageInfo<Map> page=modelService.findApplyPaymentListByInfo(tablepar, name, startTime, endTime);
  65. TableSplitResult<Map> result=new TableSplitResult<>(page.getPageNum(), page.getTotal(), page.getList());
  66. return result;
  67. }
  68. @PostMapping(value = "findAllApplyPaymentListByInfo", produces = {"application/json;charset=UTF-8"})
  69. @ResponseBody
  70. public List<Map> findAllApplyPaymentListByInfo(String name,String startTime,String endTime) {
  71. List<Map> result=modelService.findAllApplyPaymentListByInfo(name, startTime, endTime);
  72. return result;
  73. }
  74. /**
  75. * 添加审核结果
  76. * 根据不同的状态值confirmResult判断是 1:审核通过,转下一步;2:退回发起人;3:退回上节点;4:结束流程;
  77. *
  78. * @param addConfirmResult
  79. * @return
  80. */
  81. @PostMapping(value = "AddConfirmResultApplyPayment", produces = {"application/json;charset=UTF-8"})
  82. @ResponseBody
  83. @Transactional
  84. public AjaxResult AddConfirmResultApplyPayment(AddConfirmResultPayment addConfirmResult) throws FlowException {
  85. System.out.println("AddConfirmResultApplyPayment");
  86. System.out.println(addConfirmResult);
  87. if (addConfirmResult.getConfirmResult() == null) {
  88. return result(-1);
  89. }
  90. String deploymentid = ConstantFlowType.PAYMEN_DEPLOYMENTID;
  91. String constantFlowType = ConstantFlowType.PAYMEN;
  92. FlowMainPush flowMainPush = flowMainPushService.selectByPrimaryKey(addConfirmResult.getFlowMainPushId());
  93. String isOkString=null;
  94. {//进行审核判断
  95. // ApplyUseMoneyDetailExample example = new ApplyUseMoneyDetailExample();
  96. // example.createCriteria().andUseMoneyIdEqualTo(flowMainPush.getFormId());
  97. // List<ApplyUseMoneyDetail> applyUseMoneyDetails = applyUseMoneyDetailService.selectByExample(example);
  98. // // 付款总金额
  99. // BigDecimal feeMoneyTotal = new BigDecimal(0);
  100. // for (ApplyUseMoneyDetail applyUseMoneyDetail : applyUseMoneyDetails) {
  101. // BigDecimal feeMoney = applyUseMoneyDetail.getFeeMoney() == null ? new BigDecimal(0) : applyUseMoneyDetail.getFeeMoney();
  102. // feeMoneyTotal = feeMoneyTotal.add(feeMoney, MathContext.DECIMAL32);
  103. // }
  104. // double feeMoneyTotalDouble = feeMoneyTotal.doubleValue();
  105. // //添加判断条件
  106. // HashMap<String, Object> conditionMap = new HashMap<>();
  107. // conditionMap.put("billMoney", feeMoneyTotalDouble);
  108. isOkString=flowMainService.doConfirmResult(addConfirmResult,deploymentid,constantFlowType,flowMainPush,null);
  109. if (!"ok_end".equals(isOkString)&&!"ok_noEnd".equals(isOkString)) {
  110. return AjaxResult.error(isOkString);
  111. }
  112. }
  113. Boolean isEnd = false;//是否结束
  114. Boolean isAgree = false;//是否同意
  115. if (addConfirmResult.getConfirmResult().equals("4")) {//结束流程
  116. isEnd = true;
  117. isAgree = false;
  118. } else if (addConfirmResult.getConfirmResult().equals("1")) {//1:审核通过,转下一步
  119. if ("ok_end".equals(isOkString)) {
  120. isEnd = true;
  121. isAgree = true;
  122. }
  123. }
  124. //添加业务信息
  125. if (!StringUtils.isEmpty(addConfirmResult.getPayRemark())||addConfirmResult.getPayTime()!=null) {
  126. ApplyPayment applyPayment = new ApplyPayment();
  127. applyPayment.setId(flowMainPush.getFormId());
  128. applyPayment.setPayTime(addConfirmResult.getPayTime());
  129. applyPayment.setPayRemark(addConfirmResult.getPayRemark());
  130. applyPayment.setUpdatedAt(new Date());
  131. applyPayment.setUpdatedBy(ShiroUtils.getUser().getId());
  132. modelService.updateByPrimaryKeySelective(applyPayment);
  133. }
  134. //添加业务信息(将请假信息中的修改掉,剩余年假,剩余调休,冻结年假,冻结调休都修改掉)
  135. if (isEnd&&isAgree) {
  136. // 添加付款台账支付明细
  137. OutOrderPay outOrderPay = modelService.getApplyPaymentByFlowMainId(flowMainPush.getFormId());
  138. outOrderPay.setSource("2");
  139. outOrderPayService.insert(outOrderPay);
  140. }
  141. return result(1);
  142. }
  143. /**
  144. * 发起付款申请流程
  145. *
  146. * @param record
  147. * @return
  148. */
  149. @PostMapping(value = "addApplyPayment", produces = {"application/json;charset=UTF-8"})
  150. @ResponseBody
  151. @Transactional
  152. public AjaxResult addApplyPayment(ApplyPaymentIn record) throws FlowException {
  153. System.out.println("addApplyPayment");
  154. System.out.println(record);
  155. if (false) {
  156. return AjaxResult.error("这是一个错误测试信息");
  157. }
  158. return myaddApplyPayment(record,null);
  159. }
  160. /**
  161. * 申请人重新发起申请
  162. *
  163. * @param record
  164. * @return
  165. */
  166. @PostMapping(value = "addApplyPaymentAgain", produces = {"application/json;charset=UTF-8"})
  167. @ResponseBody
  168. @Transactional
  169. public AjaxResult addApplyPaymentAgain(ApplyPaymentIn record) throws FlowException {
  170. System.out.println("addApplyPaymentAgain");
  171. if (StringUtils.isEmpty(record.getFlowMainId())){
  172. return AjaxResult.error("没有传入flowMainId的值");
  173. }
  174. System.out.println(record);
  175. // record.setRemark("重新发起申请[" + record.getFlowMainId() + "],");
  176. {//修改重新发起前的表状态
  177. FlowMain flowMain1 = new FlowMain();
  178. flowMain1.setId(record.getFlowMainId());
  179. flowMain1.setReturnStatus(1);//0/null无状态,1已撤回/已退回发起人并且已重新发起
  180. flowMain1.setUpdatedAt(new Date());
  181. flowMain1.setUpdatedBy(ShiroUtils.getUser().getId());
  182. flowMainService.updateByPrimaryKeySelective(flowMain1);
  183. }
  184. return myaddApplyPayment(record,"重新发起申请[" + record.getFlowMainId() + "],");
  185. }
  186. /**
  187. * 根据推送表的FlowMainPushId获取信息
  188. *
  189. * @param flowMainPushId
  190. * @return
  191. */
  192. @PostMapping(value = "getInfoByFlowMainPushId", produces = {"application/json;charset=UTF-8"})
  193. @ResponseBody
  194. public ApplyPaymentIn getInfoByFlowMainPushId(String flowMainPushId) {
  195. ApplyPaymentIn myApplyPaymentIn = modelService.getInfoByFlowMainPushId(flowMainPushId);
  196. if (myApplyPaymentIn != null) {
  197. {//获取抄送人
  198. List<FlowMainCcVo> flowMainCcList = flowMainCcService.selectVoByFlowMainId(myApplyPaymentIn.getFlowMainId());
  199. myApplyPaymentIn.setFlowMainCcList(flowMainCcList);
  200. }
  201. }
  202. return myApplyPaymentIn;
  203. }
  204. /**
  205. * 根据主表的FlowMainId获取信息
  206. *
  207. * @param flowMainId
  208. * @return
  209. */
  210. @PostMapping(value = "getInfoByFlowMainId", produces = {"application/json;charset=UTF-8"})
  211. @ResponseBody
  212. public ApplyPaymentIn getInfoByFlowMainId(String flowMainId) {
  213. ApplyPaymentIn myApplyPaymentIn = modelService.getInfoByFlowMainId(flowMainId);
  214. if (myApplyPaymentIn != null) {
  215. {//获取抄送人
  216. // FlowMainCcExample example = new FlowMainCcExample();
  217. // example.createCriteria().andFlowMainIdEqualTo(myApplyUseMoneyIn.getFlowMainId());
  218. // List<FlowMainCc> flowMainCcList = flowMainCcService.selectByExample(example);
  219. List<FlowMainCcVo> flowMainCcList = flowMainCcService.selectVoByFlowMainId(myApplyPaymentIn.getFlowMainId());
  220. // HashSet<String> set = new HashSet<>();
  221. // for (FlowMainCc flowMainCc : flowMainCcList) {
  222. // set.add(flowMainCc.getCcUser());
  223. // }
  224. // StringBuilder stringBuilder = new StringBuilder();
  225. // if (!set.isEmpty()) {
  226. // for (String s : set) {
  227. // stringBuilder.append(s + ",");
  228. // }
  229. // }
  230. // myApplyUseMoneyIn.setCcList(stringBuilder.toString());
  231. myApplyPaymentIn.setFlowMainCcList(flowMainCcList);
  232. }
  233. }
  234. return myApplyPaymentIn;
  235. }
  236. /**
  237. * 根据项目id获取所有已收款金额
  238. */
  239. @PostMapping(value = "getTotalMoneyByProId", produces = {"application/json;charset=UTF-8"})
  240. @ResponseBody
  241. public AjaxResult getTotalMoneyByProId(String proId) {
  242. Double total = modelService.getTotalMoneyByProId(proId);
  243. return AjaxResult.success(total);
  244. }
  245. /**
  246. * 根据项目id获取所有已付款款金额
  247. */
  248. @PostMapping(value = "getTotalPayMoneyByProId", produces = {"application/json;charset=UTF-8"})
  249. @ResponseBody
  250. public AjaxResult getTotalPayMoneyByProId(String proId) {
  251. Double total = modelService.getTotalPayMoneyByProId(proId);
  252. return AjaxResult.success(total);
  253. }
  254. /**
  255. * 改成根据订单编号查累计已付款款金额
  256. */
  257. @PostMapping(value = "getTotalPayMoneyByOrderNo", produces = {"application/json;charset=UTF-8"})
  258. @ResponseBody
  259. public AjaxResult getTotalPayMoneyByOrderNo(String orderNo) {
  260. Double total = modelService.getTotalPayMoneyByOrderNo(orderNo);
  261. return AjaxResult.success(total);
  262. }
  263. /**
  264. * 发起付款申请流程
  265. *
  266. * @param record
  267. * @return
  268. */
  269. public AjaxResult myaddApplyPayment(ApplyPaymentIn record,String addSystemRemark) throws FlowException {
  270. // 存入付款申请
  271. // record
  272. {
  273. record.setUpdatedAt(new Date());
  274. record.setCreatedAt(record.getUpdatedAt());
  275. record.setCreatedBy(ShiroUtils.getUser().getId());
  276. record.setUpdatedBy(record.getCreatedBy());
  277. record.setStatus(0);
  278. modelService.insert(record);
  279. }
  280. String applyTheme="关于" + record.getCustomerName() + "_" + record.getProjectName() + "_" + record.getSupplierName() + "_" + record.getPayName() + "的付款申请单";
  281. AjaxResult ajaxResult = flowMainService.doFlowMain(applyTheme, record.getId(), addSystemRemark, record.getCcList(), ConstantFlowType.PAYMEN_PROCESSDEFINE, ConstantFlowType.PAYMEN_DEPLOYMENTID, null, ConstantFlowType.PAYMEN_NAME, ConstantFlowType.PAYMEN,ShiroUtils.getUser());
  282. if (ajaxResult.get("code").equals(1688)) {
  283. return AjaxResult.success();
  284. }
  285. return ajaxResult;
  286. }
  287. /**
  288. * 通用方法,加载到流程业务模块
  289. * @return
  290. */
  291. // public AjaxResult doFlowMain(String ApplyTheme,String recordId,String recordRemark,String recordCcList){
  292. // // 存入流程主表 ok
  293. // FlowMain flowMain = new FlowMain();
  294. // flowMain.setId(UUIDUtils.middleUUID());
  295. // // 进入流程引擎,开始启动流程
  296. // {
  297. // //启动流程引擎
  298. // Map<String, String> stringStringMap = proActiService.startTask(ConstantFlowType.PAYMEN_PROCESSDEFINE, ConstantFlowType.PAYMEN_DEPLOYMENTID, flowMain.getId(), ShiroUtils.getUser(), null);
  299. // if (stringStringMap == null) {
  300. // return AjaxResult.error("流程引擎开启失败,请查看原因!");
  301. // }
  302. //
  303. // }
  304. // //存入流程日志表的id
  305. // String flowMainLogUuid = UUIDUtils.middleUUID();
  306. //
  307. // {
  308. //
  309. //// 关于@客户名称@项目名称@供应商名称@付款名称的付款申请单
  310. // flowMain.setApplyTheme(ApplyTheme);
  311. // flowMain.setFormId(recordId);
  312. // flowMain.setApplyUser(ShiroUtils.getUser().getId());
  313. // flowMain.setDeptId(ShiroUtils.getUser().getDepartment());
  314. // flowMain.setFlowStatus(1);
  315. // flowMain.setCcList(recordCcList);
  316. // flowMain.setFlowName(ConstantFlowType.PAYMEN_NAME);
  317. // flowMain.setFlowType(ConstantFlowType.PAYMEN);
  318. ////当前流程邮递操作人(frame_user)id 去除岗位的设定
  319. // flowMain.setFlowPost(ShiroUtils.getUser().getId());
  320. // {// 需要工作流引擎的支持
  321. // flowMain.setFlowId(flowMain.getFlowId());
  322. // flowMain.setTaskId(null);
  323. // }
  324. // flowMain.setReturnStatus(0);
  325. // flowMain.setLastMainLogId(flowMainLogUuid);
  326. //
  327. // flowMain.setUpdatedAt(new Date());
  328. // flowMain.setCreatedAt(flowMain.getUpdatedAt());
  329. // flowMain.setCreatedBy(ShiroUtils.getUser().getId());
  330. // flowMain.setUpdatedBy(flowMain.getCreatedBy());
  331. // flowMain.setGroupId(ShiroUtils.getUser().getGroupId());
  332. // flowMain.setStatus(0);
  333. // if (!StringUtils.isEmpty(recordRemark)) {
  334. // flowMain.setRemark(recordRemark);
  335. // }
  336. // flowMainService.insertWithoutId(flowMain);
  337. // }
  338. //
  339. // // 存入流程日志表 ok
  340. // FlowMainLog flowMainLog = new FlowMainLog();
  341. // {
  342. // flowMainLog.setId(flowMainLogUuid);
  343. // flowMainLog.setFlowMainId(flowMain.getId());
  344. // flowMainLog.setFormId(recordId);
  345. // flowMainLog.setAuditUser(ShiroUtils.getUser().getId());
  346. // flowMainLog.setAuditContent(null);
  347. // flowMainLog.setAuditResult(null);
  348. // //审批类型(0流程开始状态还是1流程审核状态还是2流程结束状态还是3申请人暂停状态4申请人结束状态
  349. // flowMainLog.setAuditType("0");
  350. // flowMainLog.setFlowType(ConstantFlowType.PAYMEN);
  351. // flowMainLog.setFlowPost(ShiroUtils.getUser().getId());
  352. // {// 需要工作流引擎的支持
  353. // flowMainLog.setFlowId(flowMain.getFlowId());
  354. // flowMainLog.setTaskId(null);
  355. // }
  356. //// 下一环节操作人(审核人/委托人/退回申请人),列表例如:,张三,李四,
  357. //// 因为感觉用不到,暂时不放进去
  358. //// flowMainLog.setNextPersons();
  359. // flowMainLog.setUpMainLogId(null);
  360. // flowMainLog.setCcList(recordCcList);
  361. //
  362. // flowMainLog.setCreatedAt(new Date());
  363. // flowMainLog.setCreatedBy(ShiroUtils.getUser().getId());
  364. // flowMainLog.setGroupId(ShiroUtils.getUser().getGroupId());
  365. // flowMainLog.setStatus(0);
  366. // flowMainLogService.insertWithoutId(flowMainLog);
  367. // }
  368. //
  369. //
  370. // // 存入抄送人信息 ok
  371. // if (!StringUtils.isEmpty(recordCcList)) {
  372. // String[] split = recordCcList.split(",");
  373. // for (String ccId : split) {
  374. // if (!StringUtils.isEmpty(ccId)) {
  375. // FlowMainCc flowMainCc = new FlowMainCc();
  376. // flowMainCc.setFlowMainId(flowMain.getId());
  377. // flowMainCc.setCcUser(ccId);
  378. // //选择抄送人时的记录表id(flow_main_log):例如:112122
  379. // flowMainCc.setMainLogIds(flowMainLog.getId());
  380. //
  381. // flowMainCc.setUpdatedAt(new Date());
  382. // flowMainCc.setCreatedAt(flowMainCc.getUpdatedAt());
  383. // flowMainCc.setCreatedBy(ShiroUtils.getUser().getId());
  384. // flowMainCc.setUpdatedBy(flowMainCc.getCreatedBy());
  385. // flowMainCc.setGroupId(ShiroUtils.getUser().getGroupId());
  386. // flowMainCc.setStatus(0);
  387. // flowMainCcService.insert(flowMainCc);
  388. // }
  389. // }
  390. //
  391. // }
  392. // // 存入推送人
  393. // //查看各个任务
  394. // List<Task> listTask = taskService.createTaskQuery().processInstanceBusinessKey(flowMain.getId()).list();
  395. // List<UserTask> TaskList = flowService.getTaskList(ConstantFlowType.PAYMEN_DEPLOYMENTID);
  396. // for (Task task : listTask) {
  397. // UserTask myUserTask = null;
  398. // {
  399. // String taskDefinitionKey = task.getTaskDefinitionKey();
  400. // for (int i = 0; i < TaskList.size(); i++) {
  401. // if (TaskList.get(i).getId().equals(taskDefinitionKey)) {
  402. // myUserTask = TaskList.get(i);
  403. // break;
  404. // }
  405. // }
  406. // String pushUserKey = null;
  407. // Integer pushType = null;
  408. // if (myUserTask != null) {
  409. // pushUserKey = myUserTask.getCandidateGroups().get(0);
  410. // if (listTask.size() > 1) {
  411. // String[] s1 = pushUserKey.substring(0, pushUserKey.indexOf("-")).split("_");
  412. // if (s1.length >= 5) {
  413. // String pushTypeNum = s1[4];
  414. // if ("0".equals(pushTypeNum)) {
  415. // pushType = 2;
  416. // } else if ("1".equals(pushTypeNum)) {
  417. // pushType = 3;
  418. // }
  419. //
  420. // }
  421. // } else {
  422. // pushType = 1;
  423. // }
  424. // }
  425. //
  426. //
  427. // FlowMainPush flowMainPush = new FlowMainPush();
  428. // flowMainPush.setFlowMainId(flowMain.getId());
  429. // flowMainPush.setFormId(recordId);
  430. // {// 需要工作流引擎的支持
  431. // flowMainPush.setPushUser(task.getAssignee());//推送人id'
  432. // flowMainPush.setPushUserKey(pushUserKey);//推送时彭总给的key值
  433. // flowMainPush.setPushType(pushType);//推送类型1单流程推送,2串联推送,3并联推送
  434. // flowMainPush.setPushRole(1);//'推送人身份:1本人审核,2被委托人(代理审核人审核权限)',
  435. // flowMainPush.setFlowType(ConstantFlowType.PAYMEN);
  436. // flowMainPush.setFlowPost(ShiroUtils.getUser().getId());
  437. // flowMainPush.setFlowId(flowMain.getFlowId());
  438. // flowMainPush.setTaskId(task.getId());
  439. // }
  440. // flowMainPush.setUpMainLogId(flowMainLog.getId());
  441. // flowMainPush.setUpdatedAt(new Date());
  442. // flowMainPush.setCreatedAt(flowMainPush.getUpdatedAt());
  443. // flowMainPush.setCreatedBy(ShiroUtils.getUser().getId());
  444. // flowMainPush.setUpdatedBy(flowMainPush.getCreatedBy());
  445. // flowMainPush.setGroupId(ShiroUtils.getUser().getGroupId());
  446. // flowMainPush.setStatus(0);
  447. // flowMainPushService.insert(flowMainPush);
  448. // }
  449. // }
  450. // return result(1);
  451. // }
  452. // /**
  453. // * 添加审核结果
  454. // * 根据不同的状态值confirmResult判断是 1:审核通过,转下一步;2:退回发起人;3:退回上节点;4:结束流程;
  455. // *
  456. // * @param addConfirmResult
  457. // * @return
  458. // */
  459. // @PostMapping(value = "addConfirmResult", produces = {"application/json;charset=UTF-8"})
  460. // @ResponseBody
  461. // public AjaxResult addConfirmResult(AddConfirmResult addConfirmResult) {
  462. // if (addConfirmResult.getConfirmResult() == null) {
  463. // return result(-1);
  464. // }
  465. // FlowMainPush flowMainPush = flowMainPushService.selectByPrimaryKey(addConfirmResult.getFlowMainPushId());
  466. // FlowMain flowMain = flowMainService.selectByPrimaryKey(flowMainPush.getFlowMainId());
  467. // //审核通过,转下一步
  468. // if (addConfirmResult.getConfirmResult().equals(1)) {
  469. // {// 发起流程引擎操作 并查看下一节点的操作要求
  470. // //1.如果当前角色是自己,就进行正常的审核流程
  471. // //2.先查看当前角色是不是自己,不是自己就移动到自己的角色,然后再进行正常的审核流程
  472. //
  473. //
  474. // }
  475. // {
  476. // //1修改主表状态
  477. // //2添加日志
  478. // //3判断是否存在串并联并修改推送状态
  479. // //4添加新的推送人员
  480. // }
  481. //
  482. // } else if (addConfirmResult.getConfirmResult().equals(2)) {//退回发起人
  483. // {// 发起流程引擎操作 并查看下一节点的操作要求
  484. //
  485. // }
  486. // { //1修改主表状态
  487. // //2添加日志
  488. // //3判断是否存在串并联并修改推送状态
  489. // //4添加新的推送人员
  490. // }
  491. // } else if (addConfirmResult.getConfirmResult().equals(3)) {//退回上节点
  492. // {// 发起流程引擎操作 并查看下一节点的操作要求
  493. //
  494. // }
  495. // { //1修改主表状态
  496. // //2添加日志
  497. // //3判断是否存在串并联并修改推送状态
  498. // //4添加新的推送人员
  499. // }
  500. // } else if (addConfirmResult.getConfirmResult().equals(4)) {//结束流程
  501. // {// 发起流程引擎操作 并结束该流程
  502. //
  503. // }
  504. // {
  505. // //1修改主表状态
  506. // //2添加日志
  507. // //3判断是否存在串并联并修改推送状态
  508. // }
  509. // }
  510. //
  511. // return result(1);
  512. // }
  513. @PostMapping(value = "list", produces = {"application/json;charset=UTF-8"})
  514. @ResponseBody
  515. public Object list(Tablepar tablepar, ApplyPayment model, DateTrans dt) {
  516. PageInfo<ApplyPayment> page = modelService.list(tablepar, model, dt);
  517. TableSplitResult<ApplyPayment> result = new TableSplitResult<ApplyPayment>(page.getPageNum(), page.getTotal(), page.getList());
  518. return result;
  519. }
  520. @PostMapping(value = "listAll", produces = {"application/json;charset=UTF-8"})
  521. @ResponseBody
  522. public Object listAll(ApplyPayment model, DateTrans dt) {
  523. return modelService.listAll(model, dt);
  524. }
  525. @PostMapping(value = "add", produces = {"application/json;charset=UTF-8"})
  526. @ResponseBody
  527. public AjaxResult add(ApplyPayment record) {
  528. record.setCreatedAt(new Date());
  529. int result = modelService.insert(record);
  530. return result(result);
  531. }
  532. @PostMapping(value = "remove/{id}", produces = {"application/json;charset=UTF-8"})
  533. @ResponseBody
  534. public AjaxResult remove(@PathVariable("id") String id) {
  535. int result = modelService.deleteByPrimaryKey(id);
  536. return result(result);
  537. }
  538. @PostMapping(value = "edit", produces = {"application/json;charset=UTF-8"})
  539. @ResponseBody
  540. public AjaxResult editSave(ApplyPayment model) {
  541. int result = modelService.updateByPrimaryKeySelective(model);
  542. return result(result);
  543. }
  544. @PostMapping(value = "getById", produces = {"application/json;charset=UTF-8"})
  545. @ResponseBody
  546. public ApplyPayment getById(String id) {
  547. return modelService.selectByPrimaryKey(id);
  548. }
  549. }