Revert "小程序端申请记录优化、申请额度优化、更新员工图像(小程序端)"

This reverts commit b8be3595
master
river 4 years ago
parent b8be35958c
commit 163ac6431a
  1. 19
      dq-financial-api/src/main/java/com/daqing/financial/hrms/UserControllerApi.java
  2. 3
      dq-financial-crms/src/main/java/com/daqing/financial/crms/controller/CustomerAppletController.java
  3. 3
      dq-financial-crms/src/main/java/com/daqing/financial/crms/model/request/PersonalAppletRequest.java
  4. 11
      dq-financial-crms/src/main/java/com/daqing/financial/crms/service/impl/CustomerAppletServiceImpl.java
  5. 86
      dq-financial-crms/src/main/resources/bootstrap.properties
  6. 9
      dq-financial-crms/src/main/resources/mapper/crms/CustomerAppletDao.xml
  7. 2
      dq-financial-crms/src/main/resources/mapper/crms/PersonalCustomerDao.xml
  8. 12
      dq-financial-hrms/src/main/java/com/daqing/financial/hrms/controller/UserController.java
  9. 2
      dq-financial-hrms/src/main/java/com/daqing/financial/hrms/dao/UserDao.java
  10. 2
      dq-financial-hrms/src/main/java/com/daqing/financial/hrms/service/UserService.java
  11. 14
      dq-financial-hrms/src/main/java/com/daqing/financial/hrms/service/impl/UserServiceImpl.java
  12. 4
      dq-financial-hrms/src/main/resources/mapper/hrms/UserDao.xml
  13. 1
      dq-framework-model/src/main/java/com/daqing/framework/domain/hrms/response/HrmsCode.java

@ -16,24 +16,27 @@ import javax.servlet.http.HttpServletResponse;
@Api(value = "用户相关操作", tags = "提供工作台人力资源等相关方法") @Api(value = "用户相关操作", tags = "提供工作台人力资源等相关方法")
public interface UserControllerApi { public interface UserControllerApi {
@ApiOperation(value = "用户详情",notes = "用户详情",response = EmployeeAndUserVO.class) @ApiOperation(value = "用户详情", notes = "用户详情", response = EmployeeAndUserVO.class)
ResponseResult info(); ResponseResult info();
@ApiOperation(value = "修改用户信息",notes = "修改用户信息") @ApiOperation(value = "修改用户信息", notes = "修改用户信息")
ResponseResult update(EmployeeAndUserVO employeeAndUserVO); ResponseResult update(EmployeeAndUserVO employeeAndUserVO);
@ApiOperation(value = "获取验证码",notes = "获取验证码") @ApiOperation(value = "获取验证码", notes = "获取验证码")
ResponseResult code(String phone); ResponseResult code(String phone);
@ApiOperation(value = "修改密码",notes = "修改密码") @ApiOperation(value = "修改密码", notes = "修改密码")
ResponseResult updatePassword(String primaryPassword, String newPassword, String affirmNewPassword); ResponseResult updatePassword(String primaryPassword, String newPassword, String affirmNewPassword);
@ApiOperation(value = "绑定手机号",notes = "绑定手机号") @ApiOperation(value = "绑定手机号", notes = "绑定手机号")
ResponseResult binding(String phone,String code); ResponseResult binding(String phone, String code);
@ApiOperation(value = "取消微信绑定",notes = "取消微信绑定") @ApiOperation(value = "取消微信绑定", notes = "取消微信绑定")
ResponseResult cancel(); ResponseResult cancel();
@ApiOperation(value = "图像文件上传",notes = "图像文件上传") @ApiOperation(value = "图像文件上传", notes = "图像文件上传")
ResponseResult uploadFile(MultipartFile file); ResponseResult uploadFile(MultipartFile file);
@ApiOperation(value = "更新员工图像(小程序端)", notes = "更新员工图像(小程序端)")
ResponseResult updateHeadPortraitUrl(String headPortraitUrl);
} }

@ -102,7 +102,8 @@ public class CustomerAppletController {
*/ */
@GetMapping("/get/record") @GetMapping("/get/record")
@ApiOperation(value = "获取申请记录", response = ApplicationRecordResponse.class) @ApiOperation(value = "获取申请记录", response = ApplicationRecordResponse.class)
public ResponseResult getApplicationRecord(@RequestParam("page") Integer page, @RequestParam("size") Integer size, Integer type, Integer status) { public ResponseResult getApplicationRecord(@RequestParam("page") Integer page,
@RequestParam("size") Integer size, Integer type, Integer status) {
return ResponseResult.SUCCESS(customerAppletService.getApplicationRecord(page, size, type, status)); return ResponseResult.SUCCESS(customerAppletService.getApplicationRecord(page, size, type, status));
} }

@ -20,6 +20,9 @@ import java.io.Serializable;
@ToString @ToString
public class PersonalAppletRequest implements Serializable { public class PersonalAppletRequest implements Serializable {
@ApiModelProperty("客户表id")
private Long companyId;
@NotNull(message = "客户名称不能为空") @NotNull(message = "客户名称不能为空")
@ApiModelProperty(value = "客户名称") @ApiModelProperty(value = "客户名称")
private String name; private String name;

@ -203,6 +203,7 @@ public class CustomerAppletServiceImpl extends ServiceImpl<CustomerAppletDao, Cu
PersonalCustomerEntity personalCustomerEntity = personalCustomerDao.queryPersonalCustomerById((long) customerId); PersonalCustomerEntity personalCustomerEntity = personalCustomerDao.queryPersonalCustomerById((long) customerId);
BeanUtils.copyProperties(customer, personalAppletRequest); BeanUtils.copyProperties(customer, personalAppletRequest);
BeanUtils.copyProperties(personalCustomerEntity, personalAppletRequest); BeanUtils.copyProperties(personalCustomerEntity, personalAppletRequest);
personalAppletRequest.setCompanyId(personalCustomerEntity.getId());
return personalAppletRequest; return personalAppletRequest;
} }
if (type == 1) { if (type == 1) {
@ -211,12 +212,13 @@ public class CustomerAppletServiceImpl extends ServiceImpl<CustomerAppletDao, Cu
.eq("customer_id", (long) customerId)); .eq("customer_id", (long) customerId));
BeanUtils.copyProperties(customer, companyAppletRequest); BeanUtils.copyProperties(customer, companyAppletRequest);
BeanUtils.copyProperties(companyCustomerEntity, companyAppletRequest); BeanUtils.copyProperties(companyCustomerEntity, companyAppletRequest);
if (companyAppletRequest.getIsExistRelated() == 1) { /*if (companyAppletRequest.getIsExistRelated() == 1) {
Integer companyId = this.getBaseMapper().getCompanyId(customerId); Integer companyId = this.getBaseMapper().getCompanyId(customerId);
if (companyId != null) { if (companyId != null) {
companyAppletRequest.setCustomerId(companyId); companyAppletRequest.setCustomerId(companyId);
} }
} }*/
companyAppletRequest.setCustomerId(this.getBaseMapper().getCompanyId(customerId));
return companyAppletRequest; return companyAppletRequest;
} }
return null; return null;
@ -376,8 +378,11 @@ public class CustomerAppletServiceImpl extends ServiceImpl<CustomerAppletDao, Cu
Integer companyId = this.getBaseMapper().getCompanyId(customerId); Integer companyId = this.getBaseMapper().getCompanyId(customerId);
// 查询申请记录信息 // 查询申请记录信息
List<ApplicationRecordPO> applicationRecordPOList = this.getBaseMapper().getApplyMount(companyId); List<ApplicationRecordPO> applicationRecordPOList = this.getBaseMapper().getApplyMount(companyId);
if (applicationRecordPOList.size() < 1) {
return map;
}
for (ApplicationRecordPO applicationRecordPO : applicationRecordPOList) { for (ApplicationRecordPO applicationRecordPO : applicationRecordPOList) {
company += applicationRecordPO.getApplyAmount(); company += applicationRecordPO.getApplyAmount() == null ? 0.00 : applicationRecordPO.getApplyAmount();
} }
map.put("company", company); map.put("company", company);
} }

@ -1,24 +1,24 @@
#服务名称 #服务名称
spring.application.name=dq-financial-crms #spring.application.name=dq-financial-crms
#配置中心地址 ##配置中心地址
spring.cloud.nacos.config.server-addr=192.168.31.140:8848 #spring.cloud.nacos.config.server-addr=192.168.31.140:8848
spring.cloud.nacos.config.file-extension=yml #spring.cloud.nacos.config.file-extension=yml
#redis配置 ##redis配置
spring.redis.host=127.0.0.1 #spring.redis.host=127.0.0.1
spring.redis.port=6379 #spring.redis.port=6379
spring.redis.password= #spring.redis.password=
spring.redis.database=0 #spring.redis.database=0
spring.redis.timeout=30000 #spring.redis.timeout=30000
spring.redis.jedis.pool.max-active=8 #spring.redis.jedis.pool.max-active=8
spring.redis.jedis.pool.max-wait=-1 #spring.redis.jedis.pool.max-wait=-1
spring.redis.jedis.pool.max-idle=8 #spring.redis.jedis.pool.max-idle=8
spring.redis.jedis.pool.min-idle=0 #spring.redis.jedis.pool.min-idle=0
#本地测试环境 #本地测试环境
spring.cloud.nacos.config.namespace=1520c5ea-5f15-4ac1-9eb1-d25924825b99 #spring.cloud.nacos.config.namespace=1520c5ea-5f15-4ac1-9eb1-d25924825b99
#线上测试环境 #线上测试环境
#spring.cloud.nacos.config.namespace=5698e60a-9d0b-433f-a69f-12b0a2d23128 #spring.cloud.nacos.config.namespace=5698e60a-9d0b-433f-a69f-12b0a2d23128
#
#线上生产环境 #线上生产环境
#spring.cloud.nacos.config.namespace=6054a175-069a-492d-8679-820758416406 #spring.cloud.nacos.config.namespace=6054a175-069a-492d-8679-820758416406
@ -29,30 +29,30 @@ ribbon.ConnectTimeout: 120000
# 正式环境(prod) # 正式环境(prod)
#服务名称 #服务名称
#spring.application.name=dq-financial-crms spring.application.name=dq-financial-crms
###配置中心地址 ##配置中心地址
#spring.cloud.nacos.config.server-addr=120.78.127.12:8848 spring.cloud.nacos.config.server-addr=120.78.127.12:8848
#spring.cloud.nacos.config.namespace=25ce05e2-a0eb-4842-92e4-d8b550a489dd spring.cloud.nacos.config.namespace=25ce05e2-a0eb-4842-92e4-d8b550a489dd
##spring.cloud.nacos.config.group=prod #spring.cloud.nacos.config.group=prod
#
#spring.cloud.nacos.config.ext-config[0].data-id=datasource.yml spring.cloud.nacos.config.ext-config[0].data-id=datasource.yml
#spring.cloud.nacos.config.ext-config[0].group=prod spring.cloud.nacos.config.ext-config[0].group=prod
#spring.cloud.nacos.config.ext-config[0].refresh=true spring.cloud.nacos.config.ext-config[0].refresh=true
#
#spring.cloud.nacos.config.ext-config[1].data-id=mybatis.yml spring.cloud.nacos.config.ext-config[1].data-id=mybatis.yml
#spring.cloud.nacos.config.ext-config[1].group=prod spring.cloud.nacos.config.ext-config[1].group=prod
#spring.cloud.nacos.config.ext-config[1].refresh=true spring.cloud.nacos.config.ext-config[1].refresh=true
#
#spring.cloud.nacos.config.ext-config[2].data-id=other.yml spring.cloud.nacos.config.ext-config[2].data-id=other.yml
#spring.cloud.nacos.config.ext-config[2].group=prod spring.cloud.nacos.config.ext-config[2].group=prod
#spring.cloud.nacos.config.ext-config[2].refresh=true spring.cloud.nacos.config.ext-config[2].refresh=true
#
#spring.redis.host=127.0.0.1 spring.redis.host=127.0.0.1
#spring.redis.port=6379 spring.redis.port=6379
#spring.redis.password=dq123456 spring.redis.password=dq123456
#spring.redis.database=0 spring.redis.database=0
#spring.redis.timeout=30000 spring.redis.timeout=30000
#spring.redis.jedis.pool.max-active=8 spring.redis.jedis.pool.max-active=8
#spring.redis.jedis.pool.max-wait=-1 spring.redis.jedis.pool.max-wait=-1
#spring.redis.jedis.pool.max-idle=8 spring.redis.jedis.pool.max-idle=8
#spring.redis.jedis.pool.min-idle=0 spring.redis.jedis.pool.min-idle=0

@ -18,7 +18,7 @@
<!-- 更新客户基本信息 --> <!-- 更新客户基本信息 -->
<update id="updateCustomer" parameterType="com.daqing.framework.domain.crms.CustomerEntity"> <update id="updateCustomer" parameterType="com.daqing.framework.domain.crms.CustomerEntity">
UPDATE crms_customer UPDATE crms_customer
SET name=#{customer.name},addr=#{customer.addr},phone=#{customer.phone},motify_time=#{customer.motifyTime} SET name = #{customer.name},addr = #{customer.addr},phone = #{customer.phone},motify_time = #{customer.motifyTime}
WHERE id = #{customer.id} WHERE id = #{customer.id}
</update> </update>
@ -29,7 +29,7 @@
<!-- 申请记录 --> <!-- 申请记录 -->
<select id="getApplicationRecord" resultType="com.daqing.framework.domain.crms.ext.ApplicationRecordPO"> <select id="getApplicationRecord" resultType="com.daqing.framework.domain.crms.ext.ApplicationRecordPO">
SELECT a.id AS id,a.create_time AS apply_date,a.amount_wide AS amount_wide,a.apply_time AS apply_time,l.status AS audit_status, SELECT l.id AS id,a.create_time AS apply_date,a.amount_wide AS amount_wide,a.apply_time AS apply_time,l.status AS audit_status,
a.apply_amount AS apply_amount,b.business_status AS business_status a.apply_amount AS apply_amount,b.business_status AS business_status
FROM dg_apply_amount_info AS a FROM dg_apply_amount_info AS a
LEFT JOIN dg_business_process_status AS b LEFT JOIN dg_business_process_status AS b
@ -46,7 +46,7 @@
<if test="status == 1 or status == 2 or status == 3 or status == 4 or status == 5"> <if test="status == 1 or status == 2 or status == 3 or status == 4 or status == 5">
AND l.status = #{status} AND l.status = #{status}
</if> </if>
GROUP BY a.id AND l.role_id = 58
</select> </select>
<!-- 获取已申请额度 --> <!-- 获取已申请额度 -->
@ -69,8 +69,7 @@
FROM dg_apply_amount_list AS l FROM dg_apply_amount_list AS l
LEFT JOIN dg_business_process_status AS b LEFT JOIN dg_business_process_status AS b
ON l.business_id = b.business_id ON l.business_id = b.business_id
WHERE l.role_id = 58 WHERE l.id = #{id}
AND l.business_id = #{id}
</select> </select>
</mapper> </mapper>

@ -26,7 +26,7 @@
<!-- 根据客户基本信息id查询个人类型客户的信息 --> <!-- 根据客户基本信息id查询个人类型客户的信息 -->
<select id="queryPersonalCustomerById" parameterType="long" resultType="com.daqing.framework.domain.crms.PersonalCustomerEntity"> <select id="queryPersonalCustomerById" parameterType="long" resultType="com.daqing.framework.domain.crms.PersonalCustomerEntity">
SELECT id_card,age,gender,marital_status,education,employer,position,working_years,social_security_num, SELECT id,id_card,age,gender,marital_status,education,employer,position,working_years,social_security_num,
living_situation,residence_addr,business_source,emergency_linkman,emergency_linkman_relationship, living_situation,residence_addr,business_source,emergency_linkman,emergency_linkman_relationship,
emergency_linkman_phone emergency_linkman_phone
FROM crms_personal_customer FROM crms_personal_customer

@ -118,6 +118,18 @@ public class UserController implements UserControllerApi {
return result ? ResponseResult.SUCCESS() : ResponseResult.FAIL(); return result ? ResponseResult.SUCCESS() : ResponseResult.FAIL();
} }
/**
* 更新员工图像(小程序端)
* @param headPortraitUrl 图像路径
*/
@GetMapping("/update/url")
public ResponseResult updateHeadPortraitUrl(@RequestParam("headPortraitUrl") String headPortraitUrl){
Boolean result = userService.updateHeadPortraitUrl(headPortraitUrl);
return result ? ResponseResult.SUCCESS() : ResponseResult.FAIL();
}
/** /**
* 只有当访问用户具有 ROLE_ADMIN 权限时才能访问否则返回 401 未授权 * 只有当访问用户具有 ROLE_ADMIN 权限时才能访问否则返回 401 未授权
* 通过 Authentication 参数或者 SecurityContextHolder.getContext().getAuthentication() 可以拿到授权信息进行查看 * 通过 Authentication 参数或者 SecurityContextHolder.getContext().getAuthentication() 可以拿到授权信息进行查看

@ -32,4 +32,6 @@ public interface UserDao extends BaseMapper<UserEntity> {
Long getEmployeeIdByUserId(Long userId); Long getEmployeeIdByUserId(Long userId);
List<String> listPhoneAccount(); List<String> listPhoneAccount();
Boolean updateHeadPortraitUrl(@Param("id") Long employee_id, @Param("url") String headPortraitUrl);
} }

@ -28,5 +28,7 @@ public interface UserService extends IService<UserEntity> {
Boolean bindingPhoneAccount(String phone,String code); Boolean bindingPhoneAccount(String phone,String code);
Boolean cancel(); Boolean cancel();
Boolean updateHeadPortraitUrl(String headPortraitUrl);
} }

@ -14,6 +14,7 @@ import com.daqing.framework.util.Md5Util;
import com.daqing.framework.util.RedisUtil; import com.daqing.framework.util.RedisUtil;
import com.daqing.framework.util.SendSMS; import com.daqing.framework.util.SendSMS;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang.StringUtils;
import org.springframework.beans.BeanUtils; import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
@ -244,6 +245,19 @@ public class UserServiceImpl extends ServiceImpl<UserDao, UserEntity> implements
return this.getBaseMapper().updateWeChat(Long.parseLong(userId), null); return this.getBaseMapper().updateWeChat(Long.parseLong(userId), null);
} }
/**
* 更新图像(小程序端)
* @param headPortraitUrl 图像路径
*/
@Override
public Boolean updateHeadPortraitUrl(String headPortraitUrl) {
if (StringUtils.isEmpty(headPortraitUrl) || headPortraitUrl.trim().length() == 0) {
ExceptionCast.cast(HrmsCode.USER_HEAD_PORTRAIT_URL_IS_NULL);
}
String userId = this.getUserId();
return this.getBaseMapper().updateHeadPortraitUrl(this.getBaseMapper().getEmployeeIdByUserId(Long.parseLong(userId)), headPortraitUrl);
}
/** /**
* 获取当前登录用户信息 * 获取当前登录用户信息
*/ */

@ -59,4 +59,8 @@
SELECT phone_account FROM hrms_user WHERE del_or_not = 0 SELECT phone_account FROM hrms_user WHERE del_or_not = 0
</select> </select>
<!-- 更新员工表的图像 -->
<update id="updateHeadPortraitUrl">
UPDATE hrms_employee SET head_portarit_url = #{url} WHERE id = #{id}
</update>
</mapper> </mapper>

@ -61,6 +61,7 @@ public enum HrmsCode implements ResultCode {
USER_FILE_TYPE_MISTAKE(false,88013,"文件格式不正确,请重新选择图片文件!"), USER_FILE_TYPE_MISTAKE(false,88013,"文件格式不正确,请重新选择图片文件!"),
USER_FILE_UPLOAD_FAIL(false,88014,"上传图像失败,请稍后刷新再试!"), USER_FILE_UPLOAD_FAIL(false,88014,"上传图像失败,请稍后刷新再试!"),
USER_PHONE_ACCOUNT_REPETITION(false,88015,"该手机号已绑定过用户,请更换手机号!"), USER_PHONE_ACCOUNT_REPETITION(false,88015,"该手机号已绑定过用户,请更换手机号!"),
USER_HEAD_PORTRAIT_URL_IS_NULL(false, 88016, "当前图片不存在,请重新选择!"),
PHNOE_ACCOUNT_NOT_EMPTY(false,33001,"手机号码为空!"), PHNOE_ACCOUNT_NOT_EMPTY(false,33001,"手机号码为空!"),
VERIFY_CODE_NOT_EMPTY(false,33002,"短信验证码为空!"), VERIFY_CODE_NOT_EMPTY(false,33002,"短信验证码为空!"),

Loading…
Cancel
Save