Kaynağa Gözat

注册已审核的排序修改

huZhiHao 5 yıl önce
ebeveyn
işleme
52b0154ce8

+ 1 - 0
src/main/java/platform/common/util/VerificationCodeUtil.java

@@ -38,6 +38,7 @@ public class VerificationCodeUtil {
     //验证 验证码
     public boolean validateVerificationCode(String phone, String code) {
         String verificationCode = redisUtil.get(VerificationCode + phone) + "";
+        //验证成功 销毁原来的验证码
         if (Objects.equals(code, verificationCode)) {
             redisUtil.remove(VerificationCode + phone);
             return true;

+ 3 - 1
src/main/java/platform/modules/government/service/SlidesService.java

@@ -68,7 +68,9 @@ public class SlidesService extends BaseService<Slides> {
 		List<Slides> Slides = this.selectByExample(example);
 		for (Slides slide : Slides) {
 			Attachment attachment = attachmentService.findByBizIdAndBizType(slide.getId(), Constant.Attachment.SLIDES);
-			slide.setFileDown(new FileDown(attachment.getId(), attachment.getFile_name(), attachment.getFile_url(), attachment.getDownload_uri()));
+			if(attachment!=null){
+				slide.setFileDown(new FileDown(attachment.getId(), attachment.getFile_name(), attachment.getFile_url(), attachment.getDownload_uri()));
+			}
 		}
 		return new PageInfo<>(Slides);
 	}

+ 42 - 43
src/main/java/platform/modules/government/web/RegisterApproval.java

@@ -61,7 +61,7 @@ public class RegisterApproval extends BaseController {
     private DictionaryItemService dictionaryItemService;
     @Autowired
     private ApprovalService approvalService;
-    
+
     @Autowired
     private UserService userService;
 
@@ -73,23 +73,23 @@ public class RegisterApproval extends BaseController {
 
     @OperationLog(value = "查看企业注册列表")
     @RequestMapping("/list")
-    public String pageInfo(@RequestParam(value = "pageNum",defaultValue = "1") Integer pageNum , ModelMap modelMap,String keyword,Company searchCondition){
-        PageInfo<Company> pageInfo = companyInfoManageService.findRegisterPage(pageNum, PAGESIZE, keyword,searchCondition);
-        modelMap.put("pageInfo",pageInfo);
-        modelMap.put("keyword",keyword);
-        modelMap.put("searchCondition",searchCondition);
+    public String pageInfo(@RequestParam(value = "pageNum", defaultValue = "1") Integer pageNum, ModelMap modelMap, String keyword, Company searchCondition) {
+        PageInfo<Company> pageInfo = companyInfoManageService.findRegisterPage(pageNum, PAGESIZE, keyword, searchCondition);
+        modelMap.put("pageInfo", pageInfo);
+        modelMap.put("keyword", keyword);
+        modelMap.put("searchCondition", searchCondition);
         return "/admin/government/register/index";
     }
 
     @RequestMapping("/details")
-    public String details(Integer id,ModelMap modelMap){
+    public String details(Integer id, ModelMap modelMap) {
 
         Company company = companyService.findById(id);
 
         //
-        if(Objects.equals(company.getIndustry_code(),"Empty")){
+        if (Objects.equals(company.getIndustry_code(), "Empty")) {
             company.setIndustry_code(company.getIndustry_name());
-        }else{
+        } else {
             company.setIndustry_code(dictionaryItemService.findNameByTypeAndValue(Constant.DictionaryType.INDUSTRY_TYPE, company.getIndustry_code()));
         }
 
@@ -114,7 +114,6 @@ public class RegisterApproval extends BaseController {
         List<DictionaryItem> itemList = dictionaryItemService.findListByTypeName(Constant.DictionaryType.CURRENCY_UNIT);
         modelMap.put("itemList", itemList);
 
-
         List<Approval> approvalList = approvalService.getRegisterApprovalList(id);
         modelMap.put("approvalList", approvalList);
 
@@ -125,15 +124,15 @@ public class RegisterApproval extends BaseController {
         usercriteria.andEqualTo("company_id", id);
         userexample.orderBy("create_time").asc();
         List<User> users = userService.selectByExample(userexample);
-        if(null != users && users.size()>0) {
-        	modelMap.put("user", users.get(0));
-        }else {
+        if (null != users && users.size() > 0) {
+            modelMap.put("user", users.get(0));
+        } else {
             modelMap.put("user", new User());
         }
 
         modelMap.put("companyContract", companyContactService.findByCompanyId(id));
 
-        modelMap.put("fileUrl",getFileDownloadUri());
+        modelMap.put("fileUrl", getFileDownloadUri());
 
         Example materialexample = new Example(CompanyMaterial.class);
         Example.Criteria materialcriteria = materialexample.createCriteria();
@@ -144,9 +143,9 @@ public class RegisterApproval extends BaseController {
         List<CompanyMaterial> materialList = companyMaterialService.selectByExample(materialexample);
         List<Attachment> attachments = attachmentService.selectByIdAndBusinessId(Constant.Attachment.COMPANY_MATERIAL, id, null);
         if (null != attachments && attachments.size() > 0 && null != materialList && materialList.size() > 0) {
-            for(Attachment attachment:attachments){
-                for(CompanyMaterial material:materialList){
-                    if(Objects.equals(material.getAttachment_id(),attachment.getId())){
+            for (Attachment attachment : attachments) {
+                for (CompanyMaterial material : materialList) {
+                    if (Objects.equals(material.getAttachment_id(), attachment.getId())) {
                         CompanyFileDto companyFileDto = new CompanyFileDto();
                         FileDown fileDown = new FileDown(attachment.getId(), attachment.getFile_name(), attachment.getFile_url(), attachment.getDownload_uri());
                         companyFileDto.setFile_name(material.getFile_name());
@@ -164,14 +163,14 @@ public class RegisterApproval extends BaseController {
 
 
     @RequestMapping("/approval")
-    public String approval(Integer id,ModelMap modelMap){
+    public String approval(Integer id, ModelMap modelMap) {
 
         Company company = companyService.findById(id);
 
         //
-        if(Objects.equals(company.getIndustry_code(),"Empty")){
+        if (Objects.equals(company.getIndustry_code(), "Empty")) {
             company.setIndustry_code(company.getIndustry_name());
-        }else{
+        } else {
             company.setIndustry_code(dictionaryItemService.findNameByTypeAndValue(Constant.DictionaryType.INDUSTRY_TYPE, company.getIndustry_code()));
         }
 
@@ -206,14 +205,14 @@ public class RegisterApproval extends BaseController {
         usercriteria.andEqualTo("company_id", id);
         userexample.orderBy("create_time").asc();
         List<User> users = userService.selectByExample(userexample);
-        if(null != users && users.size()>0) {
-        	modelMap.put("user", users.get(0));
-        }else {
+        if (null != users && users.size() > 0) {
+            modelMap.put("user", users.get(0));
+        } else {
             modelMap.put("user", new User());
         }
         modelMap.put("companyContract", companyContactService.findByCompanyId(id));
 
-        modelMap.put("fileUrl",getFileDownloadUri());
+        modelMap.put("fileUrl", getFileDownloadUri());
 
         Example materialexample = new Example(CompanyMaterial.class);
         Example.Criteria materialcriteria = materialexample.createCriteria();
@@ -224,9 +223,9 @@ public class RegisterApproval extends BaseController {
         List<CompanyMaterial> materialList = companyMaterialService.selectByExample(materialexample);
         List<Attachment> attachments = attachmentService.selectByIdAndBusinessId(Constant.Attachment.COMPANY_MATERIAL, id, null);
         if (null != attachments && attachments.size() > 0 && null != materialList && materialList.size() > 0) {
-            for(Attachment attachment:attachments){
-                for(CompanyMaterial material:materialList){
-                    if(Objects.equals(material.getAttachment_id(),attachment.getId())){
+            for (Attachment attachment : attachments) {
+                for (CompanyMaterial material : materialList) {
+                    if (Objects.equals(material.getAttachment_id(), attachment.getId())) {
                         CompanyFileDto companyFileDto = new CompanyFileDto();
                         FileDown fileDown = new FileDown(attachment.getId(), attachment.getFile_name(), attachment.getFile_url(), attachment.getDownload_uri());
                         companyFileDto.setFile_name(material.getFile_name());
@@ -241,33 +240,33 @@ public class RegisterApproval extends BaseController {
         return "/admin/government/register/approval";
 
     }
-    
+
     @OperationLog(value = "企业注册审核")
     @RequestMapping("/submit")
     @ResponseBody
-    public ResponseMessage submit(Integer type,Integer id,String approval_comment){
+    public ResponseMessage submit(Integer type, Integer id, String approval_comment) {
         try {
-        	if(IsTooFrequently()) {
-    			return ResponseMessage.error("操作过于频繁,请稍后再试!");
-        	}
-            return companyService.approval(type,id,approval_comment);
+            if (IsTooFrequently()) {
+                return ResponseMessage.error("操作过于频繁,请稍后再试!");
+            }
+            return companyService.approval(type, id, approval_comment);
         } catch (Exception e) {
             e.printStackTrace();
             return ResponseMessage.error("审核失败");
         }
     }
-    
+
     @OperationLog(value = "查看企业注册审核列表")
     @RequestMapping("/already_list")
-    public String already_pageInfo(@RequestParam(value = "pageNum",defaultValue = "1") Integer pageNum , ModelMap modelMap, String keyword,Company searchCondition){
+    public String already_pageInfo(@RequestParam(value = "pageNum", defaultValue = "1") Integer pageNum, ModelMap modelMap, String keyword, Company searchCondition) {
         PageInfo<Company> pageInfo = companyInfoManageService.findAlready_RegisterPage(pageNum, PAGESIZE, keyword, searchCondition);
-        modelMap.put("pageInfo",pageInfo);
-        modelMap.put("keyword",keyword);
-        modelMap.put("searchCondition",searchCondition);
+        modelMap.put("pageInfo", pageInfo);
+        modelMap.put("keyword", keyword);
+        modelMap.put("searchCondition", searchCondition);
         return "/admin/government/register/index1";
     }
-    
-    
+
+
     /**
      * 检验手机号是否存在
      *
@@ -295,7 +294,7 @@ public class RegisterApproval extends BaseController {
         log.info("检验用户名是否存在结果! flag = {}", flag);
         return flag;
     }
-    
+
     /**
      * 检验用户名是否存在
      *
@@ -323,7 +322,7 @@ public class RegisterApproval extends BaseController {
         log.info("检验用户名是否存在结果! flag = {}", flag);
         return flag;
     }
-    
+
     /**
      * 检验组织机构代码是否存在
      *
@@ -350,6 +349,6 @@ public class RegisterApproval extends BaseController {
         log.info("检验组织机构代码是否存在结果! flag = {}", flag);
         return flag;
     }*/
-    
+
 
 }

+ 16 - 9
src/main/java/platform/modules/home/web/HomeRefactorController.java

@@ -364,12 +364,15 @@ public class HomeRefactorController extends BaseController {
     @PostMapping("/personalRegister")
     @ResponseBody
     public ResponseMessage personalRegister(@RequestBody User userInfo) {
+        if (IsTooFrequently()) {
+            ResponseMessage.error("操作过于频繁,请稍后再试!");
+        }
         try {
-            if (!Constant.Environment.PROD_TEST.equals(profiles) && !Constant.Environment.TEST.equals(profiles)) {
-                if (!verificationCodeUtil.validateVerificationCode(userInfo.getPhone(), userInfo.getValidateNum())) {
-                    return ResponseMessage.error("验证码错误!");
-                }
+//            if (!Constant.Environment.PROD_TEST.equals(profiles) && !Constant.Environment.TEST.equals(profiles)) {
+            if (!verificationCodeUtil.validateVerificationCode(userInfo.getPhone(), userInfo.getValidateNum())) {
+                return ResponseMessage.error("验证码错误!");
             }
+//            }
             User user = new User();
             user.setUser_name(userInfo.getUser_name());
             user.setNick_name(userInfo.getNick_name().trim());
@@ -402,13 +405,17 @@ public class HomeRefactorController extends BaseController {
     @PostMapping("/register")
     @ResponseBody
     public ResponseMessage register(@RequestBody Company information) {
+
+        if (IsTooFrequently()) {
+            ResponseMessage.error("操作过于频繁,请稍后再试!");
+        }
         try {
             Approval approval = new Approval();
-            if (!Constant.Environment.PROD_TEST.equals(profiles) && !Constant.Environment.TEST.equals(profiles)) {
-                if (!verificationCodeUtil.validateVerificationCode(information.getPhone(), information.getValidateNum())) {
-                    return ResponseMessage.error("验证码错误!");
-                }
+//            if (!Constant.Environment.PROD_TEST.equals(profiles) && !Constant.Environment.TEST.equals(profiles)) {
+            if (!verificationCodeUtil.validateVerificationCode(information.getPhone(), information.getValidateNum())) {
+                return ResponseMessage.error("验证码错误!");
             }
+//            }
             Street street = new Street();
             if (null != information.getStreet_id()) {
                 street = streetService.findById(information.getStreet_id());
@@ -432,7 +439,7 @@ public class HomeRefactorController extends BaseController {
             if (company != null) {
                 information.setId(company.getId());
                 information.setIs_register(0);
-                companyService.update(information);
+                companyService.updateSelective(information);
             } else {
                 information.setStreet_name(street.getName());
                 companyService.insertAndGetId(information);

+ 12 - 11
src/main/java/platform/modules/sys/service/ApprovalService.java

@@ -170,17 +170,18 @@ public class ApprovalService extends BaseService<Approval> {
 
     //获取注册审核流程数据
     public List<Approval> getRegisterApprovalList(Integer apply_id) {
-        Example example = new Example(Approval.class);
-        Example.Criteria criteria = example.createCriteria();
-        criteria.andEqualTo("apply_id", apply_id);
-        List<Approval> approvals = this.selectByExample(example);
-        for (Approval approval : approvals) {
-            if (StringUtils.isNotBlank(approval.getBefore_approvalstatus())) {
-                approval.setBefore_approvalstatus_str(dictionaryItemService.findNameByTypeAndValue(Constant.DictionaryType.STOCKLAND_APPROVE_STATUS, approval.getBefore_approvalstatus()));
-            }
-            //绑定审核材料
-            getApproveFiles(approval);
-        }
+//        Example example = new Example(Approval.class);
+//        Example.Criteria criteria = example.createCriteria();
+//        criteria.andEqualTo("apply_id", apply_id);
+//        List<Approval> approvals = this.selectByExample(example);
+//        for (Approval approval : approvals) {
+//            if (StringUtils.isNotBlank(approval.getBefore_approvalstatus())) {
+//                approval.setBefore_approvalstatus_str(dictionaryItemService.findNameByTypeAndValue(Constant.DictionaryType.STOCKLAND_APPROVE_STATUS, approval.getBefore_approvalstatus()));
+//            }
+//            //绑定审核材料
+//            getApproveFiles(approval);
+//        }
+        List<Approval> approvals = this.getApprovalList(apply_id, Constant.DictionaryType.COMPANY_REGISTER, Constant.DictionaryType.COMPANY_REGISTER);
         return approvals;
     }
 

+ 7 - 4
src/main/resources/mapper/build/CompanyDao.xml

@@ -140,6 +140,7 @@
 
 
 
+
         ]]>
     </select>
 
@@ -329,19 +330,21 @@
         c.user_name,
         c.nick_name,
         c.phone,
-        c.create_time
+        c.create_time_approval
         FROM
         (
         SELECT
         a.*,
         b.CHECKER,
+        a.create_time create_time_company,
+        b.create_time create_time_approval,
         u.user_name as user_name,
         u.nick_name as nick_name,
         u.phone as phone
         FROM
         y_company a
         LEFT JOIN (
-            <include refid="query_last_approval"/>
+        <include refid="query_last_approval"/>
         )
         b ON a.id = b.APPLY_ID
         LEFT JOIN z_user u ON a.create_by = u.id
@@ -368,7 +371,7 @@
         </if>
         and b.after_approvalstatus is not null
         ) c
-        ORDER BY c.create_time DESC
+        ORDER BY c.create_time_approval DESC
     </select>
 
     <sql id="query_last_approval">
@@ -390,7 +393,7 @@
         FROM
         y_company a
         LEFT JOIN (
-            <include refid="query_last_approval" />
+        <include refid="query_last_approval"/>
         ) b ON a.id = b.APPLY_ID
         LEFT JOIN z_user u ON a.create_by = u.id
         WHERE

+ 37 - 36
src/main/resources/templates/admin/government/register/details.html

@@ -185,40 +185,40 @@
             </div>
         </div>
 
-       <!-- <div class="row cl">
-            <input type="hidden" name="street_id" id="street_id"/>
-            <input type="hidden" name="street_name" id="street_name"/>
-            <label class="form-label col-xs-4 col-sm-2"><span class="c-red"></span>街道:</label>
-            <div class="formControls col-xs-8 col-sm-3">
-                <select id="Street" style="width: 200px" onchange="getStreet_ids1()" disabled="disabled">
-                    <option value="-1">&#45;&#45;请选择&#45;&#45;</option>
-                    <option th:selected="${company.street_id==item.id}" th:each="item : ${streetList}"
-                            th:value="${item.id}" th:text="${item.name}">
-                    </option>
-                </select>
-            </div>
+        <!-- <div class="row cl">
+             <input type="hidden" name="street_id" id="street_id"/>
+             <input type="hidden" name="street_name" id="street_name"/>
+             <label class="form-label col-xs-4 col-sm-2"><span class="c-red"></span>街道:</label>
+             <div class="formControls col-xs-8 col-sm-3">
+                 <select id="Street" style="width: 200px" onchange="getStreet_ids1()" disabled="disabled">
+                     <option value="-1">&#45;&#45;请选择&#45;&#45;</option>
+                     <option th:selected="${company.street_id==item.id}" th:each="item : ${streetList}"
+                             th:value="${item.id}" th:text="${item.name}">
+                     </option>
+                 </select>
+             </div>
 
-            <input type="hidden" name="build_id" id="build_id"/>
-            <input type="hidden" name="build_name" id="build_name"/>
-            <label class="form-label col-xs-4 col-sm-2"><span>园区:</span></label>
-            <dd class="pushBuildsList">
-                <div class="formControls col-xs-8 col-sm-3">
-                    <select id="Builds" style="width: 200px" onchange="getBuild_ids1()" disabled="disabled">
-                        <option value="-1">&#45;&#45;请选择&#45;&#45;</option>
-                        <option th:selected="${company.build_id==item.id}" th:each="item : ${buildInfo}"
-                                th:value="${item.id}" th:text="${item.name}">
-                        </option>
-                    </select>
-                </div>
-            <dd/>
-        </div>
-        <div class="row cl">
-            <label class="form-label col-xs-4 col-sm-2"><span class="c-red"></span>管理部门:</label>
-            <div class="formControls col-xs-8 col-sm-3">
-                <input type="text" class="input-text" th:id="relation_name" th:name="relation_name"
-                       th:value="${company.relation_name}" disabled="disabled"/>
-            </div>
-        </div>-->
+             <input type="hidden" name="build_id" id="build_id"/>
+             <input type="hidden" name="build_name" id="build_name"/>
+             <label class="form-label col-xs-4 col-sm-2"><span>园区:</span></label>
+             <dd class="pushBuildsList">
+                 <div class="formControls col-xs-8 col-sm-3">
+                     <select id="Builds" style="width: 200px" onchange="getBuild_ids1()" disabled="disabled">
+                         <option value="-1">&#45;&#45;请选择&#45;&#45;</option>
+                         <option th:selected="${company.build_id==item.id}" th:each="item : ${buildInfo}"
+                                 th:value="${item.id}" th:text="${item.name}">
+                         </option>
+                     </select>
+                 </div>
+             <dd/>
+         </div>
+         <div class="row cl">
+             <label class="form-label col-xs-4 col-sm-2"><span class="c-red"></span>管理部门:</label>
+             <div class="formControls col-xs-8 col-sm-3">
+                 <input type="text" class="input-text" th:id="relation_name" th:name="relation_name"
+                        th:value="${company.relation_name}" disabled="disabled"/>
+             </div>
+         </div>-->
         <div class="row cl">
             <label class="form-label col-xs-4 col-sm-2"><span class="c-red"></span>地址:</label>
             <div class="formControls col-xs-8 col-sm-8">
@@ -239,7 +239,8 @@
                     <tbody>
                     <tr class="text-c" th:each="m,iterStat:${companyMaterial}">
                         <td th:text="${m.file_name}" th:title="${m.file_name}"></td>
-                        <td th:title="${m.fileDown.file_name}"><a th:href="${fileUrl} + ${m.fileDown.file_url}" target="_blank">[[${m.fileDown.file_name}]]</a></td>
+                        <td th:title="${m.fileDown.file_name}"><a th:href="${fileUrl} + ${m.fileDown.file_url}"
+                                                                  target="_blank">[[${m.fileDown.file_name}]]</a></td>
                     </tr>
                     </tbody>
                 </table>
@@ -306,7 +307,7 @@
                     <thead>
                     <tr class="text-c">
                         <th>时间</th>
-                        <th>审核状态</th>
+                        <!--<th>审核状态</th>-->
                         <th>部门</th>
                         <th>操作人</th>
                         <th>操作</th>
@@ -317,7 +318,7 @@
                     <tbody>
                     <tr class="text-c" th:each="model,iterStat:${approvalList}" th:object="${model}">
                         <td th:text="*{create_time}"></td>
-                        <td th:text="*{before_approvalstatus_str}"></td>
+                        <!--<td th:text="*{before_approvalstatus_str}"></td>-->
                         <td th:text="*{department}"></td>
                         <td th:text="*{create_name}"></td>
                         <td th:text="*{oper_type}"></td>