Sfoglia il codice sorgente

企业人员问题修改

xiao547607 4 anni fa
parent
commit
c1dd61b945

+ 10 - 1
web/src/main/java/com/jpsoft/enterprise/modules/base/controller/CompanyInfoController.java

@@ -278,7 +278,9 @@ public class CompanyInfoController {
 
     @ApiOperation(value="所有单位列表")
     @RequestMapping(value = "list",method = RequestMethod.POST)
-    public MessageResult<List<CompanyInfo>> list(String companyName,
+    public MessageResult<List<CompanyInfo>> list(
+                 String companyId,
+                 String companyName,
                  @RequestParam(value="pageIndex",defaultValue="1") int pageIndex,
                  @RequestParam(value="pageSize",defaultValue="10") int pageSize,
                  @RequestAttribute String subject){
@@ -302,6 +304,13 @@ public class CompanyInfoController {
         List<Sort> sortList = new ArrayList<>();
         sortList.add(new Sort("create_time","desc"));
 
+        if (StringUtils.isNotEmpty(companyId)) {
+            CompanyInfo ci = companyInfoService.get(companyId);
+            if(ci != null) {
+                searchParams.put("companyName", "%" + ci.getCompanyName() + "%");
+            }
+        }
+
         if (StringUtils.isNotEmpty(companyName)) {
             searchParams.put("companyName","%" + companyName + "%");
         }

+ 32 - 0
web/src/main/java/com/jpsoft/enterprise/modules/base/controller/PersonInfoController.java

@@ -78,6 +78,7 @@ public class PersonInfoController {
             personInfo.setDelFlag(false);
             personInfo.setCreateBy(subject);
             personInfo.setCreateTime(new Date());
+            personInfo.setPassword(AESUtil.encrypt("123456",AESUtil.MYSQL_ENC_KEY));//初始密码设置
             
             int affectCount = personInfoService.insert(personInfo);
 
@@ -391,4 +392,35 @@ public class PersonInfoController {
 
         return msgResult;
     }
+
+    @PostMapping("resetPassword")
+    @ApiOperation(value = "重置密码")
+    public MessageResult<Map> resetPassword(
+            @RequestParam(value="id",defaultValue="") String id,
+            @RequestAttribute String subject) {
+
+        MessageResult<Map> messageResult = new MessageResult<>();
+
+        try {
+
+            Map<String, Object> dataMap = new HashMap<String, Object>();
+            PersonInfo personInfo = personInfoService.get(id);
+
+            if (personInfo != null) {
+                personInfo.setPassword(AESUtil.encrypt("123456",AESUtil.MYSQL_ENC_KEY));
+                personInfo.setUpdateTime(new Date());
+                personInfoService.update(personInfo);
+            }
+
+            messageResult.setData(dataMap);
+            messageResult.setResult(true);
+            messageResult.setCode(200);
+        } catch (Exception ex) {
+            messageResult.setCode(400);
+            messageResult.setResult(false);
+            messageResult.setMessage(ex.getMessage());
+        }
+
+        return messageResult;
+    }
 }