chenc 3 anos atrás
pai
commit
9550483e9e

+ 1 - 0
src/main/java/org/jeecg/config/ShiroConfig.java

@@ -49,6 +49,7 @@ public class ShiroConfig {
 		// 配置不会被拦截的链接 顺序判断
 		filterChainDefinitionMap.put("/sys/login", "anon"); //登录接口排除
 		filterChainDefinitionMap.put("/sys/login2", "anon"); //登录接口排除
+		filterChainDefinitionMap.put("/sys/loginByUserName", "anon"); //登录接口排除
 		filterChainDefinitionMap.put("/auth/2step-code", "anon");//登录验证码
 		filterChainDefinitionMap.put("/test/jeecgDemo/**", "anon"); //测试接口
 		filterChainDefinitionMap.put("/test/jeecgOrderMain/**", "anon"); //测试接口

+ 23 - 0
src/main/java/org/jeecg/modules/contract/file/controller/ContractFileController.java

@@ -459,4 +459,27 @@ public class ContractFileController {
 	  return result;
   }
 
+  /**
+  * @Author chenchuang
+  * @Description //TODO 根据id查询合同数据
+  * @Date 2021/11/30 11:55
+  * @Param [id]
+  * @return org.jeecg.common.api.vo.Result<org.jeecg.modules.contract.file.entity.ContractFile>
+  */
+  @GetMapping(value = "/getContractFileById")
+  public Result<ContractFile> getContractFileById(@RequestParam(name="id",required=true) String id){
+  	Result<ContractFile> result =new Result();
+	  ContractFile contractFile = contractFileService.getById(id);
+	  if(contractFile==null) {
+		  result.error500("未找到对应实体");
+	  }else {
+
+		  //获取所有子表数据
+		  contractFile=contractFileService.getContractFileById(id);
+		  result.setResult(contractFile);
+		  result.setSuccess(true);
+	  }
+  	return result;
+  }
+
 }

+ 9 - 0
src/main/java/org/jeecg/modules/contract/file/mapper/ContractFileMapper.java

@@ -23,4 +23,13 @@ public interface ContractFileMapper extends BaseMapper<ContractFile> {
     * @return com.baomidou.mybatisplus.core.metadata.IPage<org.jeecg.modules.contract.file.entity.ContractFile>
     */
     IPage<ContractFile> getPageList(IPage<ContractFile> page, @Param("ew") QueryWrapper<ContractFile> queryWrapper);
+
+    /**
+    * @Author chenchuang
+    * @Description //TODO 根据id查询合同数据
+    * @Date 2021/11/30 11:20
+    * @Param [id]
+    * @return org.jeecg.modules.contract.file.entity.ContractFile
+    */
+    ContractFile getContractFileById(@Param("id")String id);
 }

+ 21 - 0
src/main/java/org/jeecg/modules/contract/file/mapper/xml/ContractFileMapper.xml

@@ -12,4 +12,25 @@
             LEFT JOIN base_archives_project_approval bapa ON bapa.id = cf.pro_id
             ${ew.customSqlSegment}
     </select>
+
+    <select id="getContractFileById" resultType="org.jeecg.modules.contract.file.entity.ContractFile" parameterType="java.lang.String">
+        SELECT
+            cf.*,
+            bapa.name as proName,
+            (select item_text from sys_dict_item where item_value=cf.milestone_id and dict_id=(select id from sys_dict where dict_code='base_archives_milestone_type')) as milestoneName,
+            fc.name as fdCustomerName,
+            fc.address as fdCustomerAddress,
+            fcc.contact_psn as fdCustomerPersonnelId,
+            fcc.contect_tel as fdCustomerPersonnelTel,
+            fp.name as salesmanName,
+            (select item_text from sys_dict_item where item_value=cf.business_type_dict_id and dict_id=(select id from sys_dict where dict_code='business_type')) as businessTypeDictName
+        FROM
+            contract_file cf
+            left join base_archives_project_approval bapa on cf.pro_id=bapa.id
+            left join fd_customer fc on cf.fd_customer_id=fc.id
+            left join fd_customer_contacts fcc on cf.fd_customer_personnel_id=fcc.id
+            left join fd_personnel fp on cf.salesman_id=fp.id
+        WHERE
+            cf.id=#{id}
+    </select>
 </mapper>

+ 9 - 0
src/main/java/org/jeecg/modules/contract/file/service/IContractFileService.java

@@ -57,4 +57,13 @@ public interface IContractFileService extends IService<ContractFile> {
     * @return void
     */
     void queryMainAndChildById(ContractFile contractFile);
+
+    /**
+     * @Author chenchuang
+     * @Description //TODO 根据id查询合同数据
+     * @Date 2021/11/30 11:20
+     * @Param [id]
+     * @return org.jeecg.modules.contract.file.entity.ContractFile
+     */
+    ContractFile getContractFileById(String id);
 }

+ 5 - 0
src/main/java/org/jeecg/modules/contract/file/service/impl/ContractFileServiceImpl.java

@@ -116,6 +116,11 @@ public class ContractFileServiceImpl extends ServiceImpl<ContractFileMapper, Con
         }
     }
 
+    @Override
+    public ContractFile getContractFileById(String id) {
+        return contractFileMapper.getContractFileById(id);
+    }
+
     /**新增所有子表*/
     public void saveChildAll(ContractFile contractFile){
         //新增合同产品表

+ 33 - 0
src/main/java/org/jeecg/modules/system/controller/LoginController.java

@@ -147,6 +147,39 @@ public class LoginController {
 //		}
 		return result;
 	}
+
+	@RequestMapping(value = "/loginByUserName", method = RequestMethod.POST)
+	@ApiOperation("根据名称登录接口")
+	public Result<JSONObject> loginByUserName(@RequestBody SysLoginModel sysLoginModel) {
+		Result<JSONObject> result = new Result<JSONObject>();
+		String username = sysLoginModel.getUsername();
+		SysUser sysUser = sysUserService.getUserByName(username);
+
+//		LDAPAuthentication ldapAuthentication=new LDAPAuthentication();
+//		ldapAuthentication.authenricate("aaa","123");
+		if(sysUser==null) {
+			result.error500("该用户不存在");
+			sysBaseAPI.addLog("登录失败,用户名:"+username+"不存在!", CommonConstant.LOG_TYPE_1, null);
+			return result;
+		}else {
+
+			//生成token
+//			String token = JwtUtil.sign(username, syspassword);
+			String token = JwtUtil.sign(username, sysUser.getPassword());
+			redisUtil.set(CommonConstant.PREFIX_USER_TOKEN + token, token);
+			//设置超时时间
+			redisUtil.expire(CommonConstant.PREFIX_USER_TOKEN + token, JwtUtil.EXPIRE_TIME/1000);
+
+			JSONObject obj = new JSONObject();
+			obj.put("token", token);
+			obj.put("userInfo", sysUser);
+			obj.put("timeTag", DateUtils.getTimeTag());
+			result.setResult(obj);
+			result.success("登录成功");
+			sysBaseAPI.addLog("用户名: "+username+",登录成功!", CommonConstant.LOG_TYPE_1, null);
+		}
+		return result;
+	}
 	
 	/**
 	 * 退出登录