消息通知功能,业务统计列表提单人修改

master
shijie 4 years ago
parent 742e8c2bdc
commit cdda61d513
  1. 6
      dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/feign/HrmsFeignService.java
  2. 18
      dq-financial-guarantee/src/main/java/com/daqing/financial/guarantee/service/impl/DgStatisticsServiceImpl.java
  3. 21
      dq-financial-hrms-auth/src/main/java/com/daqing/financial/hrauth/controller/UserLoginController.java
  4. 2
      dq-financial-hrms-auth/src/main/java/com/daqing/financial/hrauth/dao/UserLoginDao.java
  5. 4
      dq-financial-hrms-auth/src/main/java/com/daqing/financial/hrauth/service/UserLoginService.java
  6. 32
      dq-financial-hrms-auth/src/main/java/com/daqing/financial/hrauth/service/impl/UserLoginServiceImpl.java
  7. 4
      dq-financial-hrms-auth/src/main/resources/mapper/hrauth/UserLoginMapper.xml
  8. 6
      dq-financial-hrms/src/main/java/com/daqing/financial/hrms/controller/EmployeeController.java
  9. 2
      dq-financial-hrms/src/main/java/com/daqing/financial/hrms/dao/EmployeeDao.java
  10. 1
      dq-financial-hrms/src/main/java/com/daqing/financial/hrms/service/EmployeeService.java
  11. 6
      dq-financial-hrms/src/main/java/com/daqing/financial/hrms/service/impl/EmployeeServiceImpl.java
  12. 13
      dq-financial-hrms/src/main/resources/mapper/hrms/EmployeeDao.xml
  13. 5
      dq-framework-common/src/main/java/com/daqing/framework/model/UserEntity.java
  14. 2
      dq-framework-model/src/main/java/com/daqing/framework/domain/hrms/UserEntity.java

@ -33,6 +33,12 @@ public interface HrmsFeignService {
@GetMapping("/hrms/employee/getEmployeeAndDeptById") // 远程调用传递集合类型的参数必须以数组封装,不然会导致数据接收不完整
ResponseResult<List<EmployeeTO>> getEmployeeAndDeptById(@RequestParam("ids") Long[] ids);
/**
* 根据userId获取用户名以及部门名称
*/
@GetMapping("hrms/employee/getAccountAndDeptNameByIds")
ResponseResult<List<EmployeeTO>> getAccountAndDeptNameByIds(@RequestParam("ids") Long[] ids);
/**
* 根据部门id获取该部门下所有员工信息
*/

@ -96,7 +96,8 @@ public class DgStatisticsServiceImpl extends ServiceImpl<DgStatisticsMapper, DgA
for (int i = 0; i < presenterIds.length; i++) {
ids[i] = presenterIds[i].longValue();
}
ResponseResult<List<EmployeeTO>> empAndDeptList = hrmsFeignService.getEmployeeAndDeptById(ids);
//ResponseResult<List<EmployeeTO>> empAndDeptList = hrmsFeignService.getEmployeeAndDeptById(ids);
ResponseResult<List<EmployeeTO>> empAndDeptList = hrmsFeignService.getAccountAndDeptNameByIds(ids);
if (empAndDeptList.getData() != null) {
List<DgStatisticsListResponse> listResponse = this.jointStatistics(dgStatisticsPOList, empAndDeptList.getData());
IPage<DgStatisticsListResponse> iPages = new Page<>();
@ -129,7 +130,8 @@ public class DgStatisticsServiceImpl extends ServiceImpl<DgStatisticsMapper, DgA
for (int i = 0; i < presenterIds.length; i++) {
ids[i] = presenterIds[i].longValue();
}
ResponseResult<List<EmployeeTO>> empAndDeptList = hrmsFeignService.getEmployeeAndDeptById(ids);
//ResponseResult<List<EmployeeTO>> empAndDeptList = hrmsFeignService.getEmployeeAndDeptById(ids);
ResponseResult<List<EmployeeTO>> empAndDeptList = hrmsFeignService.getAccountAndDeptNameByIds(ids);
if (empAndDeptList.getData() != null) {
List<DgStatisticsListResponse> listResponse = this.jointStatistics(dgStatisticsPOList, empAndDeptList.getData());
List<DgStatisticsExcelResponse> excelResponse = new ArrayList<>();
@ -237,7 +239,8 @@ public class DgStatisticsServiceImpl extends ServiceImpl<DgStatisticsMapper, DgA
for (int i = 0; i < presenterIds.length; i++) {
ids[i] = presenterIds[i].longValue();
}
ResponseResult<List<EmployeeTO>> empAndDeptList = hrmsFeignService.getEmployeeAndDeptById(ids);
//ResponseResult<List<EmployeeTO>> empAndDeptList = hrmsFeignService.getEmployeeAndDeptById(ids);
ResponseResult<List<EmployeeTO>> empAndDeptList = hrmsFeignService.getAccountAndDeptNameByIds(ids);
if (empAndDeptList.getData() != null) {
List<DgStatisticsListRefuseResponse> listResponse = this.jointRefuseStatistics(dgStatisticsRefusePOList, empAndDeptList.getData());
IPage<DgStatisticsListRefuseResponse> iPages = new Page<>();
@ -270,7 +273,8 @@ public class DgStatisticsServiceImpl extends ServiceImpl<DgStatisticsMapper, DgA
for (int i = 0; i < presenterIds.length; i++) {
ids[i] = presenterIds[i].longValue();
}
ResponseResult<List<EmployeeTO>> empAndDeptList = hrmsFeignService.getEmployeeAndDeptById(ids);
//ResponseResult<List<EmployeeTO>> empAndDeptList = hrmsFeignService.getEmployeeAndDeptById(ids);
ResponseResult<List<EmployeeTO>> empAndDeptList = hrmsFeignService.getAccountAndDeptNameByIds(ids);
if (empAndDeptList.getData() != null) {
// 提单人姓名、部门拼装
List<DgStatisticsListRefuseResponse> listResponse = this.jointRefuseStatistics(statisticsRefusePOList, empAndDeptList.getData());
@ -317,6 +321,9 @@ public class DgStatisticsServiceImpl extends ServiceImpl<DgStatisticsMapper, DgA
dgStatisticsListResponse.setDepartment(employeeTO.getDeptNames());
}
}
if(dgStatisticsListResponse.getEmployeeName()== null){
dgStatisticsListResponse.setEmployeeName("客户");
}
BeanUtils.copyProperties(dgStatisticsPO, dgStatisticsListResponse);
listResponse.add(dgStatisticsListResponse);
}
@ -336,6 +343,9 @@ public class DgStatisticsServiceImpl extends ServiceImpl<DgStatisticsMapper, DgA
dgStatisticsListRefuseResponse.setDepartment(employeeTO.getDeptNames());
}
}
if(dgStatisticsListRefuseResponse.getEmployeeName()== null){
dgStatisticsListRefuseResponse.setEmployeeName("客户");
}
BeanUtils.copyProperties(dgStatisticsRefusePO, dgStatisticsListRefuseResponse);
listResponse.add(dgStatisticsListRefuseResponse);
}

@ -207,4 +207,25 @@ public class UserLoginController implements UserLoginControllerApi {
Integer identify = xccLoginReq.getIdentify();
return userLoginService.wxAuthLogin(encryptedData,iv,code,identify);
}
/**
* 是否开启通知提醒
* @param isRemind
* @return
*/
@GetMapping("/isRemind")
public ResponseResult isRemind(@RequestParam("isRemind") Integer isRemind){
int result = userLoginService.isRemind(isRemind);
return result>0 ? ResponseResult.SUCCESS() : ResponseResult.FAIL(55003,"开启通知提醒失败!");
}
/**
* 读取是否已开启通知提醒
* @return
*/
@GetMapping("/readIsRemind")
public ResponseResult readIsRemind(){
String result = userLoginService.readIsRemind();
return ResponseResult.SUCCESS(result);
}
}

@ -41,4 +41,6 @@ public interface UserLoginDao extends BaseMapper<UserEntity> {
int selectUserEmpCount(@Param("md5UnionId")String md5UnionId);
UserEntity xcxLogin(LoginRequest loginRequest);
String readIsRemind(Long id);
}

@ -26,4 +26,8 @@ public interface UserLoginService extends IService<UserEntity> {
int isPhoneExist(String mobile);
ResponseResult wxAuthLogin(String encryptedData, String iv, String code, Integer identify);
int isRemind(Integer isRemind);
String readIsRemind();
}

@ -23,15 +23,19 @@ import com.daqing.framework.exception.ExceptionCast;
import com.daqing.framework.model.response.ResponseResult;
import com.daqing.framework.util.JwtUtils;
import com.daqing.framework.util.Md5Util;
import com.daqing.framework.util.RedisUtil;
import com.daqing.framework.util.SendUtil;
import lombok.extern.java.Log;
import org.apache.commons.codec.binary.Base64;
import org.apache.commons.lang.StringEscapeUtils;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.core.userdetails.User;
import org.springframework.security.core.userdetails.UsernameNotFoundException;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.context.request.RequestContextHolder;
import org.springframework.web.context.request.ServletRequestAttributes;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
@ -437,4 +441,32 @@ public class UserLoginServiceImpl extends ServiceImpl<UserLoginDao, UserEntity>
return result;
}
@Override
public int isRemind(Integer isRemind) {
String userId = this.getUserId();
UserEntity entity = new UserEntity();
entity.setIsRemind(isRemind);
entity.setId(Long.valueOf(userId));
return userLoginDao.updateById(entity);
}
@Override
public String readIsRemind() {
String userId = this.getUserId();
UserEntity entity = new UserEntity();
entity.setId(Long.valueOf(userId));
return userLoginDao.readIsRemind(entity.getId());
}
/**
* 获取当前登录用户信息
*/
private String getUserId() {
HttpServletRequest request = ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest();
String token = request.getHeader("token");
return RedisUtil.get("dq:token:" + token);
}
}

@ -96,4 +96,8 @@
SELECT COUNT(0) FROM hrms_user hu INNER JOIN hrms_employee he ON he.user_id=hu.id WHERE hu.wechat_id = #{md5UnionId}
</select>
<select id="readIsRemind" parameterType="long" resultType="string">
SELECT is_remind FROM hrms_user WHERE id = #{id}
</select>
</mapper>

@ -217,6 +217,12 @@ public class EmployeeController implements EmployeeControllerApi {
return new ResponseResult<List<EmployeeTO>>().SUCCESS(employeeTO);
}
@GetMapping("/getAccountAndDeptNameByIds")
public ResponseResult getAccountAndDeptNameByIds(@RequestParam("ids") Long[] ids) {
List<EmployeeTO> employeeTO = employeeService.getAccountAndDeptNameByIds(Arrays.asList(ids));
return new ResponseResult<List<EmployeeTO>>().SUCCESS(employeeTO);
}
/**
* 根据id查询员工姓名
*

@ -117,4 +117,6 @@ public interface EmployeeDao extends BaseMapper<EmployeeEntity> {
Boolean deleteRoleByUserId(@Param("ids") List<Long> ids);
EmployeeEntity getEmpmsgById(Long id);
List<EmployeeTO> getAccountAndDeptNameByIds(@Param("ids")List<Long> ids);
}

@ -80,5 +80,6 @@ public interface EmployeeService extends IService<EmployeeEntity> {
EmployeeEntity getEmpmsgById(Long id);
List<EmployeeTO> getAccountAndDeptNameByIds(List<Long> ids);
}

@ -628,6 +628,12 @@ public class EmployeeServiceImpl extends ServiceImpl<EmployeeDao, EmployeeEntity
return this.getBaseMapper().getEmployeeAndDeptById(ids);
}
@Override
public List<EmployeeTO> getAccountAndDeptNameByIds(List<Long> ids) {
return this.getBaseMapper().getAccountAndDeptNameByIds(ids);
}
/**
* 根据userId查询员工的头像
*

@ -160,6 +160,19 @@
</foreach>
</select>
<select id="getAccountAndDeptNameByIds" resultMap="employeeTO">
select hu.id eid, he.name as emp_name, GROUP_CONCAT(hd.`name` SEPARATOR '/')dept_name
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 IN
<foreach collection="ids" open="(" separator="," close=")" item="id">
#{id}
</foreach>
GROUP BY hu.id
</select>
<!-- 根据id查询员工姓名 -->
<select id="getEmployeeById" parameterType="long" resultType="com.daqing.framework.domain.hrms.EmployeeEntity">
SELECT e.name name

@ -99,4 +99,9 @@ public class UserEntity implements Serializable {
*/
private String headPortaritUrl;
/**
* 是否通知提醒0->默认开启1->关闭
*/
private Integer isRemind;
}

@ -105,4 +105,6 @@ public class UserEntity implements Serializable {
*/
private Integer type;
private Integer isRemind;
}

Loading…
Cancel
Save