master
shijie 4 years ago
parent 19332c82be
commit 2b5adfa158
  1. 60
      dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/controller/DgApplyAmountInfoController.java
  2. 4
      dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/feign/HrmsFeignService.java
  3. 5
      dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/service/impl/DgApplyAmountInfoServiceImpl.java
  4. 17
      dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/service/impl/DgAssetsInvestigationServiceImpl.java
  5. 4
      dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/service/impl/DgMessageInvestigationServiceImpl.java
  6. 8
      dq-financial-hrms/src/main/java/com/daqing/financial/hrms/controller/EmployeeController.java
  7. 2
      dq-financial-hrms/src/main/java/com/daqing/financial/hrms/dao/EmployeeDao.java
  8. 2
      dq-financial-hrms/src/main/java/com/daqing/financial/hrms/service/EmployeeService.java
  9. 4
      dq-financial-hrms/src/main/java/com/daqing/financial/hrms/service/impl/EmployeeServiceImpl.java
  10. 37
      dq-financial-hrms/src/main/resources/mapper/hrms/EmployeeDao.xml

@ -1,6 +1,9 @@
package com.daqing.financial.guarantee.controller;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.daqing.financial.guarantee.DgApplyAmountInfoControllerApi;
import com.daqing.financial.guarantee.feign.CrmsFeignService;
import com.daqing.financial.guarantee.feign.HrmsFeignService;
@ -16,6 +19,8 @@ import com.daqing.financial.guarantee.service.IDgApplyAmountInfoService;
import com.daqing.financial.guarantee.service.IDgApplyAmountListService;
import com.daqing.framework.domain.crms.request.DgApplyAmountInfoRequest;
import com.daqing.framework.domain.guarantee.response.EmployeeMessageResponse;
import com.daqing.framework.domain.hrms.UserEntity;
import com.daqing.framework.domain.hrms.ext.EmployeeTO;
import com.daqing.framework.model.response.PromptSuccess;
import com.daqing.framework.model.response.ResponseResult;
import com.daqing.framework.util.JwtUtils;
@ -169,7 +174,8 @@ public class DgApplyAmountInfoController implements DgApplyAmountInfoControllerA
public ResponseResult businessApplicationList(@RequestParam(value="page",required=false) Integer page,@RequestParam(value="size",required=false) Integer size,
@RequestParam(value = "CustomerNumberOrName", required = false) String CustomerNumberOrName){
//获取当前登录用户id
String userId = getUserId();
//String userId = getUserId();
String userId ="9";
//根据角色查询资产部调查列表
String roleIds = RedisUtil.get("dq:userRole:" + userId);
@ -182,19 +188,47 @@ public class DgApplyAmountInfoController implements DgApplyAmountInfoControllerA
}
//遍历data里面的数据提单人id,找出匹配id,将用户名以及部门名称赋值进去
List<BusinessApplicationListResponse> list = (List<BusinessApplicationListResponse>) data.getList();
if(list.size()>0){
Integer presenterId = list.get(0).getPresenterId();
//根据提单人id查询其部门名称
ResponseResult<EmployeeMessageResponse> employeeMessage = hrmsFeignService.getAccountAndDeptNameById(presenterId.longValue());
for (BusinessApplicationListResponse response:list) {
if(employeeMessage.getData() != null){
if(response.getPresenterId().equals(employeeMessage.getData().getId())){//如果提单人id相同情况下,就往对象里面赋值
response.setAccount(employeeMessage.getData().getAccount());
response.setDeptName(employeeMessage.getData().getDeptName());
}
if(data != null){
List<BusinessApplicationListResponse> list = (List<BusinessApplicationListResponse>) data.getList();
if(list.size()>0){
List<Integer> arr = new ArrayList<>();
for (BusinessApplicationListResponse res : list) {
arr.add(res.getPresenterId());
}
//根据提单人id查询其部门名称
ResponseResult responseResult = hrmsFeignService.getAccountAndDeptNameById(arr);
List<EmployeeMessageResponse> employeeMessage = null;
if(responseResult.getData() != null){
employeeMessage = (List<EmployeeMessageResponse>) responseResult.getData();
}
System.out.println("employeeMessage============"+employeeMessage);
List<String> empList = new ArrayList<>();
for (EmployeeMessageResponse resq : employeeMessage) {
empList.add(resq.getId().toString());
}
/* List<String> strList = new ArrayList<>();
String temp = null;
for (int n=0; n<list.size(); n++){
temp = list.get(n).getPresenterId().toString();
}
if(empList.contains(temp)){
strList.add(temp);
}
System.out.println("strList=============="+strList);*/
//int i=0;
//List<EmployeeMessageResponse> employeelist = JSONObject.parseArray(employeeMessage,EmployeeMessageResponse.class);
/* for (BusinessApplicationListResponse response:list) {
for(EmployeeMessageResponse res : employeelist){
if(response.getPresenterId().equals(res.getId())){//如果提单人id相同情况下,就往对象里面赋值
response.setAccount(res.getAccount());
response.setDeptName(res.getDeptName());
}
}
// i++;
}*/
}
}
return new ResponseResult<PageUtils>().SUCCESS(data);

@ -40,8 +40,8 @@ public interface HrmsFeignService {
/**
* 根据userId获取用户名以及部门名称
*/
@GetMapping("hrms/employee/getAccountAndDeptNameById")
ResponseResult<EmployeeMessageResponse> getAccountAndDeptNameById(@RequestParam("userId") Long userId);
@PostMapping("hrms/employee/getAccountAndDeptNameById")
ResponseResult getAccountAndDeptNameById(@RequestBody List<Integer> ids);
/**
* 新增用户角色

@ -399,7 +399,7 @@ public class DgApplyAmountInfoServiceImpl extends ServiceImpl<DgApplyAmountInfoM
@Transactional
@Override
public Boolean excelExport(List<String> ids, HttpServletResponse response) {
//根据ids查询业务申请列表信息
/* //根据ids查询业务申请列表信息
List<BusinessApplicationListResponse>applyList = this.baseMapper.selectListByIds(ids);
System.out.println("applyList==========================="+applyList);
List<Integer>list2= new ArrayList<>();
@ -430,7 +430,8 @@ public class DgApplyAmountInfoServiceImpl extends ServiceImpl<DgApplyAmountInfoM
} catch (Exception e) {
ExceptionCast.cast(CrmsCode.CUSTOMER_EXPORT_EXSIT);
return false;
}
}*/
return false;
}
@Transactional

@ -134,6 +134,23 @@ public class DgAssetsInvestigationServiceImpl extends ServiceImpl<DgAssetsInvest
}
}
//新增代码,未测试--------------------------------------------------------
//根据业务id以及type为1查询资产详细
DgAssetsInvestigation assetsInvestigation = this.baseMapper.selectOne(new QueryWrapper<DgAssetsInvestigation>()
.eq("business_id", assetsResponse.getBusinessId()).eq("type", 1));
assetsResponse.setAssetsAmount(assetsInvestigation.getAssetsAmount());
assetsResponse.setAmount(assetsInvestigation.getAmount());
assetsResponse.setAssetsAmount(assetsInvestigation.getAssetsAmount());
assetsResponse.setApplyContent(assetsInvestigation.getApplyContent());
assetsResponse.setAssetsCode(assetsInvestigation.getAssetsCode());
assetsResponse.setAssetsName(assetsInvestigation.getAssetsName());
assetsResponse.setAssetsTime(assetsInvestigation.getAssetsTime());
assetsResponse.setAuditAmount(assetsInvestigation.getAuditAmount());
assetsResponse.setAuditCode(assetsInvestigation.getAuditCode());
assetsResponse.setAuditName(assetsInvestigation.getAuditName());
//结束---------------------------------------------------------------------
//根据业务id查询评估价值List
/* List<DgAssetsAssessmentAssetsLog> assessmentlist = dgAssetsAssessmentAssetsLogMapper.selectList(
new QueryWrapper<DgAssetsAssessmentAssetsLog>().eq("business_id",assetsResponse.getBusinessId()));

@ -105,7 +105,7 @@ public class DgMessageInvestigationServiceImpl extends ServiceImpl<DgMessageInve
messageInvestigation.setBusinessId(messageRequest.getBusinessId());//业务id
messageInvestigation.setCompanyId(messageRequest.getCompanyId());//企业id
messageInvestigation.setEmpId(messageRequest.getEmpId());//信息部调查员id
messageInvestigation.setRoleId(PromptSuccess.ZC_ZY_ID);//角色设置为信息部专员
messageInvestigation.setRoleId(PromptSuccess.XX_ZY_ID);//角色设置为信息部专员
messageInvestigation.setType(1);//专员操作
messageInvestigation.setStatus(StatusCode.SP_IN_REVIEW);//审批状态为审核中
messageInvestigation.setOperatingStatus(StatusCode.CZ_ON_HAND);//操作状态设置为待处理
@ -257,7 +257,7 @@ public class DgMessageInvestigationServiceImpl extends ServiceImpl<DgMessageInve
DgMessageInvestigation message2 = new DgMessageInvestigation();
message2.setOperatingStatus(StatusCode.CZ_ON_HAND);//待处理
this.baseMapper.update(message,new QueryWrapper<DgMessageInvestigation>()
.eq("business_id",messageInvestigation.getBusinessId()).eq("type",3));
.eq("business_id",messageInvestigation.getBusinessId()).eq("type",3 ));
}
DgMessageInvestigation dgMessageInvestigation = new DgMessageInvestigation();

@ -237,12 +237,12 @@ public class EmployeeController implements EmployeeControllerApi {
/**
* 根据userId获取用户名以及部门名称
*
* @param userId
* @param ids
* @return
*/
@GetMapping("/getAccountAndDeptNameById")
public ResponseResult getAccountAndDeptNameById(@RequestParam("userId") Long userId) {
return new ResponseResult<EmployeeMessageResponse>().SUCCESS(employeeService.getAccountAndDeptNameById(userId));
@PostMapping("/getAccountAndDeptNameById")
public ResponseResult getAccountAndDeptNameById(@RequestBody List<Integer> ids) {
return new ResponseResult<>().SUCCESS(employeeService.getAccountAndDeptNameById(ids));
}
/**

@ -98,7 +98,7 @@ public interface EmployeeDao extends BaseMapper<EmployeeEntity> {
EmployeeRepetition getEmployeeRepetitionByEmpId(Long empId);
EmployeeMessageResponse getAccountAndDeptNameById(Long userId);
List<EmployeeMessageResponse> getAccountAndDeptNameById(@Param("ids")List<Integer> ids);
boolean insertUserRole(Long userId, Long roleId);

@ -64,7 +64,7 @@ public interface EmployeeService extends IService<EmployeeEntity> {
EmployeeEntity getEmployeeByUserId(Long userId);
EmployeeMessageResponse getAccountAndDeptNameById(Long userId);
List<EmployeeMessageResponse> getAccountAndDeptNameById(List<Integer> ids);
boolean insertUserRole(Long userId, Long roleId);

@ -592,8 +592,8 @@ public class EmployeeServiceImpl extends ServiceImpl<EmployeeDao, EmployeeEntity
}
@Override
public EmployeeMessageResponse getAccountAndDeptNameById(Long userId) {
return this.getBaseMapper().getAccountAndDeptNameById(userId);
public List<EmployeeMessageResponse> getAccountAndDeptNameById(List<Integer> ids) {
return this.getBaseMapper().getAccountAndDeptNameById(ids);
}
@Override

@ -210,16 +210,25 @@
<!-- 根据部门id获取该部门下面所有的员工 -->
<select id="employeeListByDeptId" parameterType="long" resultType="com.daqing.framework.domain.hrms.ext.UserDeptVO">
SELECT u.id,u.account
FROM hrms_employee e
LEFT JOIN hrms_employee_dept ed
ON e.id = ed.employee_id
LEFT JOIN hrms_dept d
ON ed.dept_id = d.id
LEFT JOIN hrms_user u
ON e.user_id = u.id
WHERE u.del_or_not = 0
AND d.id = #{id}
select * from (
SELECT
u.id,
u.account , GROUP_CONCAT(er.role_id SEPARATOR ',') roleId
FROM
hrms_employee e
LEFT JOIN hrms_employee_dept ed ON e.id = ed.employee_id
LEFT JOIN hrms_dept d ON ed.dept_id = d.id
LEFT JOIN hrms_user u ON e.user_id = u.id
left join hrms_employee_role er on e.user_id = er.user_id
WHERE
u.del_or_not = 0
AND d.id = #{id}
GROUP BY u.id
)alias
where
(!FIND_IN_SET(59,roleId) AND !FIND_IN_SET(60,roleId) AND
!FIND_IN_SET(63,roleId) AND !FIND_IN_SET(66,roleId) AND
!FIND_IN_SET(69,roleId)) or roleId is null
</select>
<!-- 查询所有的员工姓名和id -->
@ -569,14 +578,18 @@
AND e.id = #{empId}
</select>
<select id="getAccountAndDeptNameById" parameterType="long"
<select id="getAccountAndDeptNameById"
resultType="com.daqing.framework.domain.guarantee.response.EmployeeMessageResponse">
select hu.id, hu.account, GROUP_CONCAT(hd.`name` SEPARATOR '/')deptName
from hrms_employee_dept ed
LEFT JOIN hrms_dept hd on hd.id=ed.dept_id
LEFT JOIN hrms_employee he on he.id=ed.employee_id
LEFT JOIN hrms_user hu on hu.id = he.user_id
where hu.id=#{userId}
where hu.id IN
<foreach collection="ids" open="(" separator="," close=")" item="id">
#{id}
</foreach>
GROUP BY hu.id
</select>
</mapper>
Loading…
Cancel
Save