|
@@ -0,0 +1,76 @@
|
|
|
+package com.huyi.service.credit.controller;
|
|
|
+
|
|
|
+import com.alibaba.fastjson.JSONObject;
|
|
|
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
|
+import com.huyi.service.base.entity.SysCompany;
|
|
|
+import com.huyi.service.base.entity.ZcFinanceInf;
|
|
|
+import com.huyi.service.base.service.ISysCompanyService;
|
|
|
+import com.huyi.service.base.service.IZcFinanceInfService;
|
|
|
+import com.huyi.service.util.FlowableService;
|
|
|
+import com.tianhu.common.core.domain.R;
|
|
|
+import com.tianhu.common.core.utils.CommonUtil;
|
|
|
+import com.tianhu.common.core.utils.DateUtils;
|
|
|
+import com.tianhu.common.core.web.controller.BaseController;
|
|
|
+import com.tianhu.common.security.annotation.PreAuthorize;
|
|
|
+import com.tianhu.common.security.service.TokenService;
|
|
|
+import com.tianhu.system.api.domain.SysUser;
|
|
|
+import com.tianhu.system.api.model.LoginUser;
|
|
|
+import org.springframework.beans.factory.annotation.Autowired;
|
|
|
+import org.springframework.web.bind.annotation.PutMapping;
|
|
|
+import org.springframework.web.bind.annotation.RequestBody;
|
|
|
+import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
+import org.springframework.web.bind.annotation.RestController;
|
|
|
+import java.util.HashMap;
|
|
|
+import java.util.List;
|
|
|
+import java.util.Map;
|
|
|
+
|
|
|
+/**
|
|
|
+ * 融信相关审批
|
|
|
+ */
|
|
|
+@RestController
|
|
|
+@RequestMapping("/approvalRelatedCredit")
|
|
|
+public class ApprovalRelatedCreditController extends BaseController {
|
|
|
+ @Autowired
|
|
|
+ private TokenService tokenService;
|
|
|
+
|
|
|
+ @Autowired
|
|
|
+ private FlowableService flowableService;
|
|
|
+
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 查询有无开启审批
|
|
|
+ * @param map
|
|
|
+ * @return
|
|
|
+ * @throws Exception
|
|
|
+ */
|
|
|
+ @PutMapping("/isOpenApproval")
|
|
|
+ public R isOpenApproval(@RequestBody Map<String,Object> map ) throws Exception {
|
|
|
+ LoginUser userInfo = tokenService.getLoginUser();
|
|
|
+ SysUser use = userInfo.getSysUser();
|
|
|
+ //获取当前公司
|
|
|
+ String companyId = use.getCompanyId();
|
|
|
+ map.put("companyId",companyId);
|
|
|
+ //menuId
|
|
|
+ map.put("menuId",CommonUtil.objToString(map.get("menuId")));
|
|
|
+ Map<String,Object> mmp = flowableService.selectApproval(map);
|
|
|
+ //不等于200
|
|
|
+ if(CommonUtil.compare(CommonUtil.objToString(mmp.get("code")),"200") != 0){
|
|
|
+ throw new Exception("查询审批流程失败");
|
|
|
+ }
|
|
|
+ List<Map<String,Object>> list = (List<Map<String, Object>>) mmp.get("data");
|
|
|
+ Map<String,Object> p = new HashMap<>();
|
|
|
+ //未开启流程审批
|
|
|
+ if(list.size() < 1){
|
|
|
+ p.put("isOpen",false);
|
|
|
+ }else{
|
|
|
+ //开启
|
|
|
+ p.put("isOpen",true);
|
|
|
+ }
|
|
|
+ return R.ok(p);
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+}
|