调整代码结构
This commit is contained in:
parent
c6fe823a57
commit
778a96c07a
|
|
@ -14,6 +14,10 @@
|
|||
<version>2.0.0</version>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.nursingunit.boot</groupId>
|
||||
<artifactId>nursing-unit-common</artifactId>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<artifactId>nu-admin-local-api</artifactId>
|
||||
|
|
|
|||
|
|
@ -0,0 +1,9 @@
|
|||
package com.nu.modules.advisoryinfo.api;
|
||||
|
||||
import com.nu.entity.AdvisoryInfoEntity;
|
||||
|
||||
public interface IAdvisoryInfoApi {
|
||||
|
||||
void updataByOpenId(AdvisoryInfoEntity advisoryInfoEntity);
|
||||
|
||||
}
|
||||
|
|
@ -1,21 +0,0 @@
|
|||
package com.nu.modules.nubaseinfo.api;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.nu.modules.nubaseinfo.entity.NuBaseInfoApiDto;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public interface INuBaseInfoApi {
|
||||
|
||||
public void save(NuBaseInfoApiDto dto);
|
||||
|
||||
void sync();
|
||||
|
||||
IPage<NuBaseInfoApiDto> queryPadPageList(Page<NuBaseInfoApiDto> page, QueryWrapper<NuBaseInfoApiDto> queryWrapper);
|
||||
|
||||
NuBaseInfoApiDto queryinfoByBuId(QueryWrapper<NuBaseInfoApiDto> queryWrapper);
|
||||
|
||||
int updateBaseInfo(NuBaseInfoApiDto nuBaseInfoApiDto);
|
||||
}
|
||||
|
|
@ -10,24 +10,7 @@
|
|||
<artifactId>nu-admin-biz</artifactId>
|
||||
|
||||
<dependencies>
|
||||
<!-- 微信支付 SDK -->
|
||||
<dependency>
|
||||
<groupId>com.github.wechatpay-apiv3</groupId>
|
||||
<artifactId>wechatpay-apache-httpclient</artifactId>
|
||||
<version>0.4.9</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>com.github.wechatpay-apiv3</groupId>
|
||||
<artifactId>wechatpay-java</artifactId>
|
||||
<version>0.2.17</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>com.github.wxpay</groupId>
|
||||
<artifactId>wxpay-sdk</artifactId>
|
||||
<version>0.0.3</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.nursingunit.boot</groupId>
|
||||
<artifactId>nu-admin-local-api</artifactId>
|
||||
|
|
@ -71,6 +54,12 @@
|
|||
<version>2.0.0</version>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
<dependency>
|
||||
<groupId>com.nursingunit.boot</groupId>
|
||||
<artifactId>nu-elder-local-api</artifactId>
|
||||
<version>2.0.0</version>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
</project>
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
package com.nu.modules.nuBizAdvisoryInfo.entity;
|
||||
package com.nu.modules.advisoryinfo.entity;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
|
@ -16,7 +16,7 @@ import lombok.experimental.Accessors;
|
|||
|
||||
/**
|
||||
* @Description: 咨询信息
|
||||
* @Author: jeecg-boot
|
||||
* @Author: 张明远
|
||||
* @Date: 2025-04-07
|
||||
* @Version: V1.0
|
||||
*/
|
||||
|
|
@ -25,103 +25,107 @@ import lombok.experimental.Accessors;
|
|||
@Accessors(chain = true)
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@ApiModel(value="nu_biz_advisory_info对象", description="咨询信息")
|
||||
public class NuBizAdvisoryInfo implements Serializable {
|
||||
public class AdvisoryInfo implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**id*/
|
||||
@TableId(type = IdType.ASSIGN_ID)
|
||||
@ApiModelProperty(value = "id")
|
||||
private java.lang.String id;
|
||||
private String id;
|
||||
/**平台id*/
|
||||
@ApiModelProperty(value = "平台Id")
|
||||
private Long platId;
|
||||
/**微信id*/
|
||||
@Excel(name = "微信id", width = 15)
|
||||
@ApiModelProperty(value = "微信id")
|
||||
private java.lang.String openId;
|
||||
private String openId;
|
||||
/**微信名称*/
|
||||
@Excel(name = "微信名称", width = 15)
|
||||
@ApiModelProperty(value = "微信名称")
|
||||
private java.lang.String wechatName;
|
||||
private String wechatName;
|
||||
/**咨询人姓名*/
|
||||
@Excel(name = "咨询人姓名", width = 15)
|
||||
@ApiModelProperty(value = "咨询人姓名")
|
||||
private java.lang.String name;
|
||||
private String name;
|
||||
/**昵称*/
|
||||
@Excel(name = "昵称", width = 15)
|
||||
@ApiModelProperty(value = "昵称")
|
||||
private String nickName;
|
||||
/**头像*/
|
||||
@ApiModelProperty(value = "头像")
|
||||
private String avatar;
|
||||
/**性别*/
|
||||
@Excel(name = "性别", width = 15, dicCode = "sex")
|
||||
@Dict(dicCode = "sex")
|
||||
@ApiModelProperty(value = "性别")
|
||||
private java.lang.String sex;
|
||||
private String sex;
|
||||
/**联系电话*/
|
||||
@Excel(name = "联系电话", width = 15)
|
||||
@ApiModelProperty(value = "联系电话")
|
||||
private java.lang.String tel;
|
||||
private String tel;
|
||||
/**咨询类型 1入住nu 2入驻机构 3我要加盟*/
|
||||
@Excel(name = "咨询类型", width = 15, dicCode = "advisory_type")
|
||||
@Dict(dicCode = "advisory_type")
|
||||
@ApiModelProperty(value = "咨询类型")
|
||||
private java.lang.String advisoryType;
|
||||
private String advisoryType;
|
||||
/**状态 1审核中 2审核完成 3驳回*/
|
||||
@Excel(name = "状态", width = 15, dicCode = "advisory_approval")
|
||||
@Dict(dicCode = "advisory_approval")
|
||||
@ApiModelProperty(value = "状态")
|
||||
private java.lang.String status;
|
||||
private String status;
|
||||
/**审核备注*/
|
||||
@Excel(name = "审核备注", width = 15)
|
||||
@ApiModelProperty(value = "审核备注")
|
||||
private java.lang.String content;
|
||||
private String content;
|
||||
/**机构访问地址*/
|
||||
@Excel(name = "机构访问地址", width = 15)
|
||||
@ApiModelProperty(value = "机构访问地址")
|
||||
private java.lang.String serverUrl;
|
||||
private String serverUrl;
|
||||
/**创建人*/
|
||||
@ApiModelProperty(value = "创建人")
|
||||
private java.lang.String createBy;
|
||||
private String createBy;
|
||||
/**创建日期*/
|
||||
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
|
||||
@ApiModelProperty(value = "创建日期")
|
||||
private java.util.Date createTime;
|
||||
private Date createTime;
|
||||
/**更新人*/
|
||||
@ApiModelProperty(value = "更新人")
|
||||
private java.lang.String updateBy;
|
||||
private String updateBy;
|
||||
/**更新日期*/
|
||||
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
|
||||
@ApiModelProperty(value = "更新日期")
|
||||
private java.util.Date updateTime;
|
||||
private Date updateTime;
|
||||
/**所属部门*/
|
||||
@ApiModelProperty(value = "所属部门")
|
||||
private java.lang.String sysOrgCode;
|
||||
private String sysOrgCode;
|
||||
|
||||
/**老人姓名*/
|
||||
private java.lang.String oldManName;
|
||||
/**老人年龄*/
|
||||
private java.lang.String oldManAge;
|
||||
/**医保类型*/
|
||||
@Dict(dicCode = "medical_insurance_type")
|
||||
private java.lang.String medicalInsuranceType;
|
||||
/**老人性别*/
|
||||
@Dict(dicCode = "sex")
|
||||
private java.lang.String oldManSex;
|
||||
/**报销类型*/
|
||||
@Dict(dicCode = "reimb_type")
|
||||
private java.lang.String reimbType;
|
||||
/**护理单元*/
|
||||
private java.lang.String nuId;
|
||||
private String izYg;//是否是员工 0否 1是
|
||||
private String izJs;//是否是家属 0否 1是
|
||||
private String izJg;//是否是机构 0否 1是
|
||||
|
||||
/**身份证号*/
|
||||
@ApiModelProperty(value = "身份证号")
|
||||
private String idCard;
|
||||
|
||||
/**家庭住址*/
|
||||
@ApiModelProperty(value = "家庭住址")
|
||||
private String homeAddress;
|
||||
|
||||
/**工作单位*/
|
||||
@ApiModelProperty(value = "工作单位")
|
||||
private String workUnit;
|
||||
|
||||
@TableField(exist = false)
|
||||
private java.lang.String advisoryTypeName;
|
||||
private String advisoryTypeName;
|
||||
@TableField(exist = false)
|
||||
private java.lang.String sexName;
|
||||
private String sexName;
|
||||
@TableField(exist = false)
|
||||
private java.lang.String sysOrgCodeName;
|
||||
private String sysOrgCodeName;
|
||||
@TableField(exist = false)
|
||||
private java.lang.String statusName;
|
||||
private String statusName;
|
||||
@TableField(exist = false)
|
||||
private java.lang.String oldManSexName;
|
||||
@TableField(exist = false)
|
||||
private java.lang.String medicalInsuranceTypeName;
|
||||
@TableField(exist = false)
|
||||
private java.lang.String reimbTypeName;
|
||||
|
||||
private String token;
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,14 @@
|
|||
package com.nu.modules.advisoryinfo.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.nu.modules.advisoryinfo.entity.AdvisoryInfo;
|
||||
|
||||
/**
|
||||
* @Description: 咨询信息
|
||||
* @Author: 张明远
|
||||
* @Date: 2025-04-07
|
||||
* @Version: V1.0
|
||||
*/
|
||||
public interface AdvisoryInfoMapper extends BaseMapper<AdvisoryInfo> {
|
||||
|
||||
}
|
||||
|
|
@ -1,5 +1,5 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.nu.modules.nuBizCustomerInfo.mapper.NuBizCustomerInfoMapper">
|
||||
<mapper namespace="com.nu.modules.advisoryinfo.mapper.AdvisoryInfoMapper">
|
||||
|
||||
</mapper>
|
||||
</mapper>
|
||||
|
|
@ -0,0 +1,14 @@
|
|||
package com.nu.modules.advisoryinfo.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.nu.modules.advisoryinfo.entity.AdvisoryInfo;
|
||||
|
||||
/**
|
||||
* @Description: 咨询信息
|
||||
* @Author: 张明远
|
||||
* @Date: 2025-04-07
|
||||
* @Version: V1.0
|
||||
*/
|
||||
public interface IAdvisoryInfoService extends IService<AdvisoryInfo> {
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,32 @@
|
|||
package com.nu.modules.advisoryinfo.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.nu.entity.AdvisoryInfoEntity;
|
||||
import com.nu.modules.advisoryinfo.api.IAdvisoryInfoApi;
|
||||
import com.nu.modules.advisoryinfo.entity.AdvisoryInfo;
|
||||
import com.nu.modules.advisoryinfo.mapper.AdvisoryInfoMapper;
|
||||
import com.nu.modules.advisoryinfo.service.IAdvisoryInfoService;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
/**
|
||||
* @Description: 咨询信息
|
||||
* @Author: 张明远
|
||||
* @Date: 2025-04-07
|
||||
* @Version: V1.0
|
||||
*/
|
||||
@Service
|
||||
public class AdvisoryInfoServiceImpl extends ServiceImpl<AdvisoryInfoMapper, AdvisoryInfo> implements IAdvisoryInfoService, IAdvisoryInfoApi {
|
||||
|
||||
|
||||
@Override
|
||||
public void updataByOpenId(AdvisoryInfoEntity advisoryInfoEntity) {
|
||||
AdvisoryInfo advisoryInfo = new AdvisoryInfo();
|
||||
BeanUtils.copyProperties(advisoryInfoEntity,advisoryInfo);
|
||||
|
||||
UpdateWrapper<AdvisoryInfo> uw = new UpdateWrapper<>();
|
||||
uw.eq("open_id",advisoryInfoEntity.getOpenId());
|
||||
baseMapper.update(advisoryInfo,uw);
|
||||
}
|
||||
}
|
||||
|
|
@ -1,18 +0,0 @@
|
|||
package com.nu.modules.employessadvisiory.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.nu.modules.employessadvisiory.entity.NuEmployeesAdvisoryInfo;
|
||||
import com.nu.modules.employessadvisiory.mapper.NuEmployeesAdvisoryInfoMapper;
|
||||
import com.nu.modules.employessadvisiory.service.INuEmployeesAdvisoryInfoService;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
/**
|
||||
* @Description: 员工咨询信息
|
||||
* @Author: jeecg-boot
|
||||
* @Date: 2025-06-09
|
||||
* @Version: V1.0
|
||||
*/
|
||||
@Service
|
||||
public class NuEmployeesAdvisoryInfoServiceImpl extends ServiceImpl<NuEmployeesAdvisoryInfoMapper, NuEmployeesAdvisoryInfo> implements INuEmployeesAdvisoryInfoService {
|
||||
|
||||
}
|
||||
|
|
@ -1,171 +0,0 @@
|
|||
package com.nu.modules.nuBaseInfo.service.impl;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.baomidou.dynamic.datasource.annotation.DS;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.nu.modules.camerainfo.api.CameraInfoApi;
|
||||
import com.nu.modules.camerainfo.entity.CameraInfoDto;
|
||||
import com.nu.modules.nuBaseInfo.entity.NuBaseInfo;
|
||||
import com.nu.modules.nuBaseInfo.mapper.NuBaseInfoMapper;
|
||||
import com.nu.modules.nuBaseInfo.service.INuBaseInfoService;
|
||||
import com.nu.modules.nuBizCustomerInfo.entity.NuBizCustomerInfo;
|
||||
import com.nu.modules.nuBizCustomerInfo.mapper.NuBizCustomerInfoMapper;
|
||||
import com.nu.modules.nubaseinfo.api.INuBaseInfoApi;
|
||||
import com.nu.modules.nubaseinfo.entity.CustomerDirectiveDto;
|
||||
import com.nu.modules.nubaseinfo.entity.CustomerInfoDto;
|
||||
import com.nu.modules.nubaseinfo.entity.NuBaseInfoApiDto;
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.jeecg.common.system.api.ISysBaseAPI;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.time.LocalDate;
|
||||
import java.time.format.DateTimeFormatter;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Description: 护理单元
|
||||
* @Author: jeecg-boot
|
||||
* @Date: 2025-04-11
|
||||
* @Version: V1.0
|
||||
*/
|
||||
@Service
|
||||
public class NuBaseInfoServiceImpl extends ServiceImpl<NuBaseInfoMapper, NuBaseInfo> implements INuBaseInfoService, INuBaseInfoApi {
|
||||
|
||||
@Autowired
|
||||
private ISysBaseAPI sysBaseAPI;
|
||||
|
||||
@Autowired
|
||||
private CameraInfoApi cameraInfoApiService;
|
||||
|
||||
@Autowired
|
||||
private NuBizCustomerInfoMapper customerInfoMapper;
|
||||
|
||||
@Override
|
||||
public void setNuId(NuBaseInfo nuBaseInfo) {
|
||||
JSONObject deptInfo = sysBaseAPI.getDeptInfo();
|
||||
String orgCode = deptInfo.getString("code");
|
||||
if (StringUtils.isBlank(orgCode)) {
|
||||
throw new RuntimeException("请先在部门管理中设置机构编码!");
|
||||
}
|
||||
try {
|
||||
String nuId = baseMapper.getNuId();
|
||||
if (nuId == null) {
|
||||
// 年月 + 机构编码 + 001
|
||||
nuBaseInfo.setNuId(LocalDate.now().format(DateTimeFormatter.ofPattern("yyMM")) + orgCode + "001");
|
||||
} else {
|
||||
// 取最后3位
|
||||
String last3Digits = nuId.substring(nuId.length() - 3);
|
||||
// 转为整数并加1
|
||||
int nextNum = Integer.parseInt(last3Digits) + 1;
|
||||
// 格式化为3位数字,不足补零
|
||||
String formattedNum = String.format("%03d", nextNum);
|
||||
// 设置新的nuId
|
||||
nuBaseInfo.setNuId(LocalDate.now().format(DateTimeFormatter.ofPattern("yyMM")) + orgCode + formattedNum);
|
||||
}
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
throw new RuntimeException("护理单元添加失败,请联系管理员进行处理!");
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@DS("#dataSourceCode")
|
||||
public List<NuBaseInfo> getSynchronized(String dataSourceCode,String orgCode) {
|
||||
QueryWrapper<NuBaseInfo> qw = new QueryWrapper<>();
|
||||
qw.eq("sys_org_code",orgCode);
|
||||
qw.eq("iz_sync","1");
|
||||
qw.eq("del_flag","0");
|
||||
return baseMapper.selectList(qw);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void batchInsert(List<NuBaseInfo> syncList) {
|
||||
syncList.stream().forEach(bi -> {
|
||||
bi.setIzSync("0");
|
||||
baseMapper.insert(bi);
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
public IPage<NuBaseInfo> qyList(Page<NuBaseInfo> page, QueryWrapper<NuBaseInfo> queryWrapper) {
|
||||
return baseMapper.qyList(page,queryWrapper);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void save(NuBaseInfoApiDto dto) {
|
||||
NuBaseInfo nuBaseInfo = new NuBaseInfo();
|
||||
BeanUtils.copyProperties(dto,nuBaseInfo);
|
||||
setNuId(nuBaseInfo);
|
||||
nuBaseInfo.setSysOrgCode(dto.getOrgCode());
|
||||
baseMapper.insert(nuBaseInfo);
|
||||
}
|
||||
|
||||
/**
|
||||
* 同步数据
|
||||
* 逻辑:从运维数据库中查出本机构下iz_sync = 1的数据存到自己的库里 存之前把这个状态改为0
|
||||
*/
|
||||
@Override
|
||||
public void sync() {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public IPage<NuBaseInfoApiDto> queryPadPageList(Page<NuBaseInfoApiDto> page, QueryWrapper<NuBaseInfoApiDto> queryWrapper) {
|
||||
//查询护理单元信息
|
||||
IPage<NuBaseInfoApiDto> list = baseMapper.queryPadPageList(page,queryWrapper);
|
||||
//查询相应的摄像头信息
|
||||
List<CameraInfoDto> cameraList = cameraInfoApiService.getCameraInfoList();
|
||||
//查询未退住的老人
|
||||
List<NuBizCustomerInfo> customerList = customerInfoMapper.selectList(new QueryWrapper<NuBizCustomerInfo>().lambda().ne(NuBizCustomerInfo::getCurrentState,"3"));
|
||||
|
||||
//查找list集合里的nuid等于cameraList集合中nuid的就给list集合赋值
|
||||
list.getRecords().forEach(nuBaseInfoApiDto -> {
|
||||
//赋值摄像头信息
|
||||
cameraList.forEach(cameraInfoDto -> {
|
||||
if(StringUtils.equals(nuBaseInfoApiDto.getNuId(),cameraInfoDto.getNuId())){
|
||||
List<CameraInfoDto> cameraInfoList = nuBaseInfoApiDto.getCameraInfo();
|
||||
if (cameraInfoList == null) {
|
||||
cameraInfoList = new ArrayList<>();
|
||||
}
|
||||
cameraInfoList.add(cameraInfoDto);
|
||||
nuBaseInfoApiDto.setCameraInfo(cameraInfoList);
|
||||
}
|
||||
});
|
||||
//赋值老人信息
|
||||
customerList.forEach(nuBizCustomerInfo -> {
|
||||
if(StringUtils.equals(nuBaseInfoApiDto.getNuId(),nuBizCustomerInfo.getNuId())){
|
||||
CustomerInfoDto customerInfo = new CustomerInfoDto();
|
||||
BeanUtils.copyProperties(nuBizCustomerInfo,customerInfo);
|
||||
nuBaseInfoApiDto.setCustomerInfo(customerInfo);
|
||||
//根据客户id查询服务指令
|
||||
// List<NuCustomerDirective> customerDirectiveList = nuCustomerDirectiveService.list(new QueryWrapper<NuCustomerDirective>().lambda().eq(NuCustomerDirective::getCustomerId,customerInfo.getId()));
|
||||
// if(customerDirectiveList != null && customerDirectiveList.size() > 0){
|
||||
// List<CustomerDirectiveDto> customerDirectiveDtoList = new ArrayList<>();
|
||||
// BeanUtils.copyProperties(customerDirectiveList,customerDirectiveDtoList);
|
||||
// nuBaseInfoApiDto.setCustomerDirectiveDtoList(customerDirectiveDtoList);
|
||||
// }
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
return list;
|
||||
}
|
||||
|
||||
@Override
|
||||
public NuBaseInfoApiDto queryinfoByBuId(QueryWrapper<NuBaseInfoApiDto> queryWrapper) {
|
||||
return baseMapper.queryinfoByBuId(queryWrapper);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int updateBaseInfo(NuBaseInfoApiDto nuBaseInfoApiDto) {
|
||||
NuBaseInfo baseInfo = new NuBaseInfo();
|
||||
BeanUtils.copyProperties(nuBaseInfoApiDto,baseInfo);
|
||||
return baseMapper.updateById(baseInfo);
|
||||
}
|
||||
}
|
||||
|
|
@ -1,92 +0,0 @@
|
|||
package com.nu.modules.nuBizAdvisoryInfo.controller;
|
||||
|
||||
import cn.hutool.json.JSONArray;
|
||||
import cn.hutool.json.JSONObject;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.nu.modules.nuBizAdvisoryInfo.entity.NuBizAdvisoryInfo;
|
||||
import com.nu.modules.nuBizAdvisoryInfo.service.INuBizAdvisoryInfoService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.jeecg.common.api.CommonAPI;
|
||||
import org.jeecg.common.api.vo.Result;
|
||||
import org.jeecg.common.aspect.annotation.AutoLog;
|
||||
import org.jeecg.common.system.base.controller.JeecgController;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.context.annotation.Lazy;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
/**
|
||||
* @Description: 咨询信息
|
||||
* @Author: jeecg-boot
|
||||
* @Date: 2025-04-07
|
||||
* @Version: V1.0
|
||||
*/
|
||||
@Api(tags="咨询信息")
|
||||
@RestController
|
||||
@RequestMapping("/h5Api/nuBizAdvisoryInfo")
|
||||
@Slf4j
|
||||
public class H5ApiAdvisoryInfoController extends JeecgController<NuBizAdvisoryInfo, INuBizAdvisoryInfoService> {
|
||||
@Autowired
|
||||
private INuBizAdvisoryInfoService nuBizAdvisoryInfoService;
|
||||
|
||||
@Lazy
|
||||
@Autowired
|
||||
private CommonAPI commonApi;
|
||||
|
||||
/**
|
||||
* 添加
|
||||
*
|
||||
* @param nuBizAdvisoryInfo
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "咨询信息-添加")
|
||||
@ApiOperation(value="咨询信息-添加", notes="咨询信息-添加")
|
||||
@PostMapping(value = "/add")
|
||||
public Result<Object> add(@RequestBody NuBizAdvisoryInfo nuBizAdvisoryInfo) {
|
||||
nuBizAdvisoryInfoService.save(nuBizAdvisoryInfo);
|
||||
return Result.OK(nuBizAdvisoryInfo);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改信息
|
||||
* @param nuBizAdvisoryInfo
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping(value = "/edit", method = {RequestMethod.PUT,RequestMethod.POST})
|
||||
public Result<String> edit(@RequestBody NuBizAdvisoryInfo nuBizAdvisoryInfo) {
|
||||
nuBizAdvisoryInfoService.updateById(nuBizAdvisoryInfo);
|
||||
return Result.OK("编辑成功!");
|
||||
}
|
||||
|
||||
|
||||
|
||||
@GetMapping(value = "/queryByOpenId")
|
||||
public Result<NuBizAdvisoryInfo> queryByOpenId(@RequestParam(name="openId",required=true) String openId) {
|
||||
QueryWrapper<NuBizAdvisoryInfo> queryWrapper = new QueryWrapper<>();
|
||||
queryWrapper.eq("open_id",openId);
|
||||
NuBizAdvisoryInfo nuBizAdvisoryInfo = nuBizAdvisoryInfoService.getOne(queryWrapper);
|
||||
if(nuBizAdvisoryInfo==null) {
|
||||
return Result.error("未找到对应数据");
|
||||
}
|
||||
if(StringUtils.isNotBlank(nuBizAdvisoryInfo.getAdvisoryType())){
|
||||
String dictText = commonApi.translateDict("advisory_type",nuBizAdvisoryInfo.getAdvisoryType());
|
||||
nuBizAdvisoryInfo.setAdvisoryTypeName(dictText);
|
||||
}
|
||||
if(StringUtils.isNotBlank(nuBizAdvisoryInfo.getSex())){
|
||||
String dictText = commonApi.translateDict("sex",nuBizAdvisoryInfo.getSex());
|
||||
nuBizAdvisoryInfo.setSexName(dictText);
|
||||
}
|
||||
if(StringUtils.isNotBlank(nuBizAdvisoryInfo.getSysOrgCode())){
|
||||
String dictText = commonApi.translateDictFromTable("sys_depart","depart_name","id",nuBizAdvisoryInfo.getSysOrgCode());
|
||||
nuBizAdvisoryInfo.setSysOrgCodeName(dictText);
|
||||
}
|
||||
if(StringUtils.isNotBlank(nuBizAdvisoryInfo.getStatus())){
|
||||
String dictText = commonApi.translateDict("advisory_approval",nuBizAdvisoryInfo.getStatus());
|
||||
nuBizAdvisoryInfo.setStatusName(dictText);
|
||||
}
|
||||
return Result.OK(nuBizAdvisoryInfo);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -1,170 +0,0 @@
|
|||
package com.nu.modules.nuBizAdvisoryInfo.controller;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import org.jeecg.common.api.vo.Result;
|
||||
import org.jeecg.common.system.query.QueryGenerator;
|
||||
import org.jeecg.common.system.query.QueryRuleEnum;
|
||||
import com.nu.modules.nuBizAdvisoryInfo.entity.NuBizAdvisoryInfo;
|
||||
import com.nu.modules.nuBizAdvisoryInfo.service.INuBizAdvisoryInfoService;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
import org.jeecg.common.system.base.controller.JeecgController;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.web.servlet.ModelAndView;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.jeecg.common.aspect.annotation.AutoLog;
|
||||
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||
|
||||
/**
|
||||
* @Description: 咨询信息
|
||||
* @Author: jeecg-boot
|
||||
* @Date: 2025-04-07
|
||||
* @Version: V1.0
|
||||
*/
|
||||
@Api(tags="咨询信息")
|
||||
@RestController
|
||||
@RequestMapping("/NuBizAdvisoryInfo/nuBizAdvisoryInfo")
|
||||
@Slf4j
|
||||
public class NuBizAdvisoryInfoController extends JeecgController<NuBizAdvisoryInfo, INuBizAdvisoryInfoService> {
|
||||
@Autowired
|
||||
private INuBizAdvisoryInfoService nuBizAdvisoryInfoService;
|
||||
|
||||
/**
|
||||
* 分页列表查询
|
||||
*
|
||||
* @param nuBizAdvisoryInfo
|
||||
* @param pageNo
|
||||
* @param pageSize
|
||||
* @param req
|
||||
* @return
|
||||
*/
|
||||
//@AutoLog(value = "咨询信息-分页列表查询")
|
||||
@ApiOperation(value="咨询信息-分页列表查询", notes="咨询信息-分页列表查询")
|
||||
@GetMapping(value = "/list")
|
||||
public Result<IPage<NuBizAdvisoryInfo>> queryPageList(NuBizAdvisoryInfo nuBizAdvisoryInfo,
|
||||
@RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
|
||||
@RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
|
||||
HttpServletRequest req) {
|
||||
// 自定义查询规则
|
||||
Map<String, QueryRuleEnum> customeRuleMap = new HashMap<>();
|
||||
// 自定义多选的查询规则为:LIKE_WITH_OR
|
||||
customeRuleMap.put("advisoryType", QueryRuleEnum.LIKE_WITH_OR);
|
||||
customeRuleMap.put("status", QueryRuleEnum.LIKE_WITH_OR);
|
||||
QueryWrapper<NuBizAdvisoryInfo> queryWrapper = QueryGenerator.initQueryWrapper(nuBizAdvisoryInfo, req.getParameterMap(),customeRuleMap);
|
||||
Page<NuBizAdvisoryInfo> page = new Page<NuBizAdvisoryInfo>(pageNo, pageSize);
|
||||
IPage<NuBizAdvisoryInfo> pageList = nuBizAdvisoryInfoService.page(page, queryWrapper);
|
||||
return Result.OK(pageList);
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加
|
||||
*
|
||||
* @param nuBizAdvisoryInfo
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "咨询信息-添加")
|
||||
@ApiOperation(value="咨询信息-添加", notes="咨询信息-添加")
|
||||
@PostMapping(value = "/add")
|
||||
public Result<Object> add(@RequestBody NuBizAdvisoryInfo nuBizAdvisoryInfo) {
|
||||
nuBizAdvisoryInfoService.save(nuBizAdvisoryInfo);
|
||||
return Result.OK(nuBizAdvisoryInfo);
|
||||
}
|
||||
|
||||
/**
|
||||
* 编辑
|
||||
*
|
||||
* @param nuBizAdvisoryInfo
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "咨询信息-编辑")
|
||||
@ApiOperation(value="咨询信息-编辑", notes="咨询信息-编辑")
|
||||
@RequiresPermissions("NuBizAdvisoryInfo:nu_biz_advisory_info:edit")
|
||||
@RequestMapping(value = "/edit", method = {RequestMethod.PUT,RequestMethod.POST})
|
||||
public Result<String> edit(@RequestBody NuBizAdvisoryInfo nuBizAdvisoryInfo) {
|
||||
nuBizAdvisoryInfoService.updateById(nuBizAdvisoryInfo);
|
||||
return Result.OK("编辑成功!");
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过id删除
|
||||
*
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "咨询信息-通过id删除")
|
||||
@ApiOperation(value="咨询信息-通过id删除", notes="咨询信息-通过id删除")
|
||||
@RequiresPermissions("NuBizAdvisoryInfo:nu_biz_advisory_info:delete")
|
||||
@DeleteMapping(value = "/delete")
|
||||
public Result<String> delete(@RequestParam(name="id",required=true) String id) {
|
||||
nuBizAdvisoryInfoService.removeById(id);
|
||||
return Result.OK("删除成功!");
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除
|
||||
*
|
||||
* @param ids
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "咨询信息-批量删除")
|
||||
@ApiOperation(value="咨询信息-批量删除", notes="咨询信息-批量删除")
|
||||
@RequiresPermissions("NuBizAdvisoryInfo:nu_biz_advisory_info:deleteBatch")
|
||||
@DeleteMapping(value = "/deleteBatch")
|
||||
public Result<String> deleteBatch(@RequestParam(name="ids",required=true) String ids) {
|
||||
this.nuBizAdvisoryInfoService.removeByIds(Arrays.asList(ids.split(",")));
|
||||
return Result.OK("批量删除成功!");
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过id查询
|
||||
*
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
//@AutoLog(value = "咨询信息-通过id查询")
|
||||
@ApiOperation(value="咨询信息-通过id查询", notes="咨询信息-通过id查询")
|
||||
@GetMapping(value = "/queryById")
|
||||
public Result<NuBizAdvisoryInfo> queryById(@RequestParam(name="id",required=true) String id) {
|
||||
NuBizAdvisoryInfo nuBizAdvisoryInfo = nuBizAdvisoryInfoService.getById(id);
|
||||
if(nuBizAdvisoryInfo==null) {
|
||||
return Result.error("未找到对应数据");
|
||||
}
|
||||
return Result.OK(nuBizAdvisoryInfo);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出excel
|
||||
*
|
||||
* @param request
|
||||
* @param nuBizAdvisoryInfo
|
||||
*/
|
||||
@RequiresPermissions("NuBizAdvisoryInfo:nu_biz_advisory_info:exportXls")
|
||||
@RequestMapping(value = "/exportXls")
|
||||
public ModelAndView exportXls(HttpServletRequest request, NuBizAdvisoryInfo nuBizAdvisoryInfo) {
|
||||
return super.exportXls(request, nuBizAdvisoryInfo, NuBizAdvisoryInfo.class, "咨询信息");
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过excel导入数据
|
||||
*
|
||||
* @param request
|
||||
* @param response
|
||||
* @return
|
||||
*/
|
||||
@RequiresPermissions("NuBizAdvisoryInfo:nu_biz_advisory_info:importExcel")
|
||||
@RequestMapping(value = "/importExcel", method = RequestMethod.POST)
|
||||
public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) {
|
||||
return super.importExcel(request, response, NuBizAdvisoryInfo.class);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -1,14 +0,0 @@
|
|||
package com.nu.modules.nuBizAdvisoryInfo.mapper;
|
||||
|
||||
import com.nu.modules.nuBizAdvisoryInfo.entity.NuBizAdvisoryInfo;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
|
||||
/**
|
||||
* @Description: 咨询信息
|
||||
* @Author: jeecg-boot
|
||||
* @Date: 2025-04-07
|
||||
* @Version: V1.0
|
||||
*/
|
||||
public interface NuBizAdvisoryInfoMapper extends BaseMapper<NuBizAdvisoryInfo> {
|
||||
|
||||
}
|
||||
|
|
@ -1,14 +0,0 @@
|
|||
package com.nu.modules.nuBizAdvisoryInfo.service;
|
||||
|
||||
import com.nu.modules.nuBizAdvisoryInfo.entity.NuBizAdvisoryInfo;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
|
||||
/**
|
||||
* @Description: 咨询信息
|
||||
* @Author: jeecg-boot
|
||||
* @Date: 2025-04-07
|
||||
* @Version: V1.0
|
||||
*/
|
||||
public interface INuBizAdvisoryInfoService extends IService<NuBizAdvisoryInfo> {
|
||||
|
||||
}
|
||||
|
|
@ -1,14 +0,0 @@
|
|||
package com.nu.modules.nuBizAdvisoryInfo.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.nu.modules.nuBizAdvisoryInfo.entity.NuBizAdvisoryInfo;
|
||||
|
||||
/**
|
||||
* @Description: 咨询信息
|
||||
* @Author: jeecg-boot
|
||||
* @Date: 2025-04-07
|
||||
* @Version: V1.0
|
||||
*/
|
||||
public interface ServerAdvisoryInfoService extends IService<NuBizAdvisoryInfo> {
|
||||
|
||||
}
|
||||
|
|
@ -1,102 +0,0 @@
|
|||
package com.nu.modules.nuBizAdvisoryInfo.service.impl;
|
||||
|
||||
import com.nu.dto.NuBizAdvisoryInfoDto;
|
||||
import com.nu.modules.nuBaseInfo.entity.NuBaseInfo;
|
||||
import com.nu.modules.nuBaseInfo.service.INuBaseInfoService;
|
||||
import com.nu.modules.nuBizAdvisoryInfo.entity.NuBizAdvisoryInfo;
|
||||
import com.nu.modules.nuBizAdvisoryInfo.mapper.NuBizAdvisoryInfoMapper;
|
||||
import com.nu.modules.nuBizAdvisoryInfo.service.INuBizAdvisoryInfoService;
|
||||
import com.nu.modules.nuBizAdvisoryInfo.service.ServerAdvisoryInfoService;
|
||||
import com.nu.modules.employeesInfo.entity.BizEmployeesInfo;
|
||||
import com.nu.modules.employeesInfo.service.IBizEmployeesInfoService;
|
||||
import com.nu.modules.nuBizCustomerInfo.entity.NuBizCustomerInfo;
|
||||
import com.nu.modules.nuBizCustomerInfo.service.INuBizCustomerInfoService;
|
||||
import com.nu.utils.RabbitMQUtil;
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
|
||||
/**
|
||||
* @Description: 咨询信息
|
||||
* @Author: jeecg-boot
|
||||
* @Date: 2025-04-07
|
||||
* @Version: V1.0
|
||||
*/
|
||||
@Service
|
||||
public class NuBizAdvisoryInfoServiceImpl extends ServiceImpl<NuBizAdvisoryInfoMapper, NuBizAdvisoryInfo> implements INuBizAdvisoryInfoService {
|
||||
|
||||
@Autowired
|
||||
public ServerAdvisoryInfoService serverAdvisoryInfoService;
|
||||
|
||||
@Autowired
|
||||
private IBizEmployeesInfoService bizEmployeesInfoService;
|
||||
|
||||
@Autowired
|
||||
private INuBizCustomerInfoService nuBizCustomerInfoService;
|
||||
@Autowired
|
||||
private INuBaseInfoService nuBaseInfoService;
|
||||
@Autowired
|
||||
private RabbitMQUtil rabbitMQUtil;
|
||||
|
||||
public boolean save(NuBizAdvisoryInfo entity) {
|
||||
|
||||
baseMapper.insert(entity);//插入业务数据
|
||||
// serverAdvisoryInfoService.save(entity);//插入运维数据
|
||||
NuBizAdvisoryInfoDto nuBizAdvisoryInfoDto = new NuBizAdvisoryInfoDto();
|
||||
BeanUtils.copyProperties(entity,nuBizAdvisoryInfoDto);
|
||||
rabbitMQUtil.sendToExchange("hldy.register","register.addData",nuBizAdvisoryInfoDto);
|
||||
return true;
|
||||
}
|
||||
|
||||
public boolean updateById(NuBizAdvisoryInfo entity) {
|
||||
baseMapper.updateById(entity);//插入业务数据
|
||||
// serverAdvisoryInfoService.updateById(entity);//插入运维数据
|
||||
NuBizAdvisoryInfoDto nuBizAdvisoryInfoDto = new NuBizAdvisoryInfoDto();
|
||||
BeanUtils.copyProperties(entity,nuBizAdvisoryInfoDto);
|
||||
rabbitMQUtil.sendToExchange("hldy.register","register.editData",nuBizAdvisoryInfoDto);
|
||||
//审核通过并且是要成为员工的
|
||||
if(StringUtils.equals("2", entity.getStatus()) && StringUtils.equals("2", entity.getAdvisoryType())){
|
||||
//插入员工数据
|
||||
BizEmployeesInfo bizEmployeesInfo = bizEmployeesInfoService.getById(entity.getId());
|
||||
if(bizEmployeesInfo == null){
|
||||
bizEmployeesInfo = new BizEmployeesInfo();
|
||||
bizEmployeesInfo.setName(entity.getName());
|
||||
bizEmployeesInfo.setSex(entity.getSex());
|
||||
bizEmployeesInfo.setTel(entity.getTel());
|
||||
bizEmployeesInfo.setId(entity.getId());
|
||||
bizEmployeesInfoService.save(bizEmployeesInfo);
|
||||
}else{
|
||||
bizEmployeesInfo.setName(entity.getName());
|
||||
bizEmployeesInfo.setSex(entity.getSex());
|
||||
bizEmployeesInfo.setTel(entity.getTel());
|
||||
bizEmployeesInfoService.updateById(bizEmployeesInfo);
|
||||
}
|
||||
//审核通过并且是申请老人入住的
|
||||
}else if(StringUtils.equals("2", entity.getStatus()) && StringUtils.equals("1", entity.getAdvisoryType())){
|
||||
|
||||
//新增老人数据
|
||||
NuBizCustomerInfo nuBizCustomerInfo = new NuBizCustomerInfo();
|
||||
nuBizCustomerInfo.setCustomerName(entity.getName());
|
||||
nuBizCustomerInfo.setCustomerSex(entity.getOldManSex());
|
||||
nuBizCustomerInfo.setCustomerAge(entity.getOldManAge());
|
||||
nuBizCustomerInfo.setNuId(entity.getNuId());
|
||||
nuBizCustomerInfo.setContactNumber(entity.getTel());
|
||||
nuBizCustomerInfo.setMedicalType(entity.getMedicalInsuranceType());
|
||||
nuBizCustomerInfo.setReimbType(entity.getReimbType());
|
||||
nuBizCustomerInfo.setCurrentState("0");
|
||||
nuBizCustomerInfoService.save(nuBizCustomerInfo);
|
||||
|
||||
//修改护理单元对应的数据
|
||||
NuBaseInfo nuBaseInfo = nuBaseInfoService.getById(entity.getNuId());
|
||||
nuBaseInfo.setCustomerId(nuBizCustomerInfo.getId());
|
||||
nuBaseInfo.setStatus("1");
|
||||
nuBaseInfoService.updateById(nuBaseInfo);
|
||||
|
||||
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
@ -1,20 +0,0 @@
|
|||
package com.nu.modules.nuBizAdvisoryInfo.service.impl;
|
||||
|
||||
import com.baomidou.dynamic.datasource.annotation.DS;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.nu.modules.nuBizAdvisoryInfo.entity.NuBizAdvisoryInfo;
|
||||
import com.nu.modules.nuBizAdvisoryInfo.mapper.NuBizAdvisoryInfoMapper;
|
||||
import com.nu.modules.nuBizAdvisoryInfo.service.ServerAdvisoryInfoService;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
/**
|
||||
* @Description: 咨询信息
|
||||
* @Author: jeecg-boot
|
||||
* @Date: 2025-04-07
|
||||
* @Version: V1.0
|
||||
*/
|
||||
@Service
|
||||
@DS("ope")
|
||||
public class ServerAdvisoryInfoServiceImpl extends ServiceImpl<NuBizAdvisoryInfoMapper, NuBizAdvisoryInfo> implements ServerAdvisoryInfoService {
|
||||
|
||||
}
|
||||
|
|
@ -1,128 +0,0 @@
|
|||
package com.nu.modules.nuBizCustomerInfo.controller;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.nu.modules.nuBizCustomerInfo.entity.NuBizCustomerInfo;
|
||||
import com.nu.modules.nuBizCustomerInfo.service.INuBizCustomerInfoService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||
import org.jeecg.common.api.vo.Result;
|
||||
import org.jeecg.common.aspect.annotation.AutoLog;
|
||||
import org.jeecg.common.system.base.controller.JeecgController;
|
||||
import org.jeecg.common.system.query.QueryGenerator;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.web.servlet.ModelAndView;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.util.Arrays;
|
||||
|
||||
/**
|
||||
* @Description: 客户信息
|
||||
* @Author: jeecg-boot
|
||||
* @Date: 2025-04-11
|
||||
* @Version: V1.0
|
||||
*/
|
||||
@Api(tags="客户信息")
|
||||
@RestController
|
||||
@RequestMapping("/h5Api/nuBizCustomerInfo")
|
||||
@Slf4j
|
||||
public class H5ApiCustomerInfoController extends JeecgController<NuBizCustomerInfo, INuBizCustomerInfoService> {
|
||||
@Autowired
|
||||
private INuBizCustomerInfoService nuBizCustomerInfoService;
|
||||
|
||||
/**
|
||||
* 分页列表查询
|
||||
*
|
||||
* @param nuBizCustomerInfo
|
||||
* @param pageNo
|
||||
* @param pageSize
|
||||
* @param req
|
||||
* @return
|
||||
*/
|
||||
//@AutoLog(value = "客户信息-分页列表查询")
|
||||
@ApiOperation(value="客户信息-分页列表查询", notes="客户信息-分页列表查询")
|
||||
@GetMapping(value = "/list")
|
||||
public Result<IPage<NuBizCustomerInfo>> queryPageList(NuBizCustomerInfo nuBizCustomerInfo,
|
||||
@RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
|
||||
@RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
|
||||
HttpServletRequest req) {
|
||||
QueryWrapper<NuBizCustomerInfo> queryWrapper = QueryGenerator.initQueryWrapper(nuBizCustomerInfo, req.getParameterMap());
|
||||
Page<NuBizCustomerInfo> page = new Page<NuBizCustomerInfo>(pageNo, pageSize);
|
||||
IPage<NuBizCustomerInfo> pageList = nuBizCustomerInfoService.page(page, queryWrapper);
|
||||
return Result.OK(pageList);
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加
|
||||
*
|
||||
* @param nuBizCustomerInfo
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "客户信息-添加")
|
||||
@ApiOperation(value="客户信息-添加", notes="客户信息-添加")
|
||||
@PostMapping(value = "/add")
|
||||
public Result<String> add(@RequestBody NuBizCustomerInfo nuBizCustomerInfo) {
|
||||
nuBizCustomerInfoService.save(nuBizCustomerInfo);
|
||||
return Result.OK("添加成功!");
|
||||
}
|
||||
|
||||
/**
|
||||
* 编辑
|
||||
*
|
||||
* @param nuBizCustomerInfo
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "客户信息-编辑")
|
||||
@ApiOperation(value="客户信息-编辑", notes="客户信息-编辑")
|
||||
@RequestMapping(value = "/edit", method = {RequestMethod.PUT,RequestMethod.POST})
|
||||
public Result<String> edit(@RequestBody NuBizCustomerInfo nuBizCustomerInfo) {
|
||||
nuBizCustomerInfoService.updateById(nuBizCustomerInfo);
|
||||
return Result.OK("编辑成功!");
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过id删除
|
||||
*
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "客户信息-通过id删除")
|
||||
@ApiOperation(value="客户信息-通过id删除", notes="客户信息-通过id删除")
|
||||
@DeleteMapping(value = "/delete")
|
||||
public Result<String> delete(@RequestParam(name="id",required=true) String id) {
|
||||
nuBizCustomerInfoService.removeById(id);
|
||||
return Result.OK("删除成功!");
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 通过id查询
|
||||
*
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
//@AutoLog(value = "客户信息-通过id查询")
|
||||
@ApiOperation(value="客户信息-通过id查询", notes="客户信息-通过id查询")
|
||||
@GetMapping(value = "/queryById")
|
||||
public Result<NuBizCustomerInfo> queryById(@RequestParam(name="id",required=true) String id) {
|
||||
NuBizCustomerInfo nuBizCustomerInfo = nuBizCustomerInfoService.getById(id);
|
||||
if(nuBizCustomerInfo==null) {
|
||||
return Result.error("未找到对应数据");
|
||||
}
|
||||
return Result.OK(nuBizCustomerInfo);
|
||||
}
|
||||
|
||||
|
||||
@AutoLog(value = "客户信息-退住")
|
||||
@ApiOperation(value="客户信息-退住", notes="客户信息-退住")
|
||||
@RequestMapping(value = "/editTuizhu", method = {RequestMethod.PUT,RequestMethod.POST})
|
||||
public Result<String> editTuizhu(@RequestBody NuBizCustomerInfo nuBizCustomerInfo) {
|
||||
nuBizCustomerInfoService.editTuizhu(nuBizCustomerInfo);
|
||||
return Result.OK("编辑成功!");
|
||||
}
|
||||
}
|
||||
|
|
@ -1,188 +0,0 @@
|
|||
package com.nu.modules.nuBizCustomerInfo.entity;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.io.UnsupportedEncodingException;
|
||||
import java.util.Date;
|
||||
import java.math.BigDecimal;
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.baomidou.mybatisplus.annotation.TableLogic;
|
||||
import org.jeecg.common.constant.ProvinceCityArea;
|
||||
import org.jeecg.common.util.SpringContextUtils;
|
||||
import lombok.Data;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
import org.jeecgframework.poi.excel.annotation.Excel;
|
||||
import org.jeecg.common.aspect.annotation.Dict;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
/**
|
||||
* @Description: 客户信息
|
||||
* @Author: jeecg-boot
|
||||
* @Date: 2025-04-11
|
||||
* @Version: V1.0
|
||||
*/
|
||||
@Data
|
||||
@TableName("nu_biz_customer_info")
|
||||
@Accessors(chain = true)
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@ApiModel(value="nu_biz_customer_info对象", description="客户信息")
|
||||
public class NuBizCustomerInfo implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**id*/
|
||||
@TableId(type = IdType.ASSIGN_ID)
|
||||
@ApiModelProperty(value = "id")
|
||||
private java.lang.String id;
|
||||
/**护理单元*/
|
||||
@Excel(name = "护理单元", width = 15)
|
||||
@ApiModelProperty(value = "护理单元")
|
||||
@Dict(dicCode = "nu_id",dicText = "nu_name",dictTable = "nu_base_info")
|
||||
private java.lang.String nuId;
|
||||
/**姓名*/
|
||||
@Excel(name = "姓名", width = 15)
|
||||
@ApiModelProperty(value = "姓名")
|
||||
private java.lang.String customerName;
|
||||
/**性别*/
|
||||
@Excel(name = "性别", width = 15)
|
||||
@ApiModelProperty(value = "性别")
|
||||
@Dict(dicCode = "sex")
|
||||
private java.lang.String customerSex;
|
||||
/**年龄*/
|
||||
@Excel(name = "年龄", width = 15)
|
||||
@ApiModelProperty(value = "年龄")
|
||||
private java.lang.String customerAge;
|
||||
/**身份证号码*/
|
||||
@Excel(name = "身份证号码", width = 15)
|
||||
@ApiModelProperty(value = "身份证号码")
|
||||
private java.lang.String idCard;
|
||||
/**出生日期*/
|
||||
@Excel(name = "出生日期", width = 15)
|
||||
@ApiModelProperty(value = "出生日期")
|
||||
private java.lang.String dateOfBirth;
|
||||
/**民族*/
|
||||
@Excel(name = "民族", width = 15)
|
||||
@ApiModelProperty(value = "民族")
|
||||
private java.lang.String national;
|
||||
/**头像*/
|
||||
@Excel(name = "头像", width = 15)
|
||||
@ApiModelProperty(value = "头像")
|
||||
private java.lang.String avatarPath;
|
||||
/**医保类型*/
|
||||
@Excel(name = "医保类型", width = 15, dicCode = "medical_insurance_type")
|
||||
@Dict(dicCode = "medical_insurance_type")
|
||||
@ApiModelProperty(value = "医保类型")
|
||||
private java.lang.String medicalType;
|
||||
/**报销类型*/
|
||||
@Dict(dicCode = "reimb_type")
|
||||
private java.lang.String reimbType;
|
||||
/**医保卡号*/
|
||||
@Excel(name = "医保卡号", width = 15)
|
||||
@ApiModelProperty(value = "医保卡号")
|
||||
private java.lang.String medicalCard;
|
||||
/**文化程度*/
|
||||
@Excel(name = "文化程度", width = 15)
|
||||
@ApiModelProperty(value = "文化程度")
|
||||
private java.lang.String educationLevel;
|
||||
/**婚姻状况*/
|
||||
@Excel(name = "婚姻状况", width = 15)
|
||||
@ApiModelProperty(value = "婚姻状况")
|
||||
private java.lang.String maritalStatus;
|
||||
/**宗教信仰*/
|
||||
@Excel(name = "宗教信仰", width = 15)
|
||||
@ApiModelProperty(value = "宗教信仰")
|
||||
private java.lang.String religiousBeliefs;
|
||||
/**身份证正面*/
|
||||
@Excel(name = "身份证正面", width = 15)
|
||||
@ApiModelProperty(value = "身份证正面")
|
||||
private java.lang.String frontIdCard;
|
||||
/**身份证反面*/
|
||||
@Excel(name = "身份证反面", width = 15)
|
||||
@ApiModelProperty(value = "身份证反面")
|
||||
private java.lang.String negativeIdCard;
|
||||
/**户口本本人页*/
|
||||
@Excel(name = "户口本本人页", width = 15)
|
||||
@ApiModelProperty(value = "户口本本人页")
|
||||
private java.lang.String accountBookHimself;
|
||||
/**医保卡正面*/
|
||||
@Excel(name = "医保卡正面", width = 15)
|
||||
@ApiModelProperty(value = "医保卡正面")
|
||||
private java.lang.String frontMedical;
|
||||
/**医保卡反面*/
|
||||
@Excel(name = "医保卡反面", width = 15)
|
||||
@ApiModelProperty(value = "医保卡反面")
|
||||
private java.lang.String negaticeMedical;
|
||||
/**备注*/
|
||||
@Excel(name = "备注", width = 15)
|
||||
@ApiModelProperty(value = "备注")
|
||||
private java.lang.String content;
|
||||
/**当前状态 0咨询 1入住 2留床 3退住*/
|
||||
@Excel(name = "当前状态 0咨询 1入住 2留床 3退住", width = 15)
|
||||
@ApiModelProperty(value = "当前状态 0咨询 1入住 2留床 3退住")
|
||||
@Dict(dicCode = "current_state")
|
||||
private java.lang.String currentState;
|
||||
/**监护人*/
|
||||
@Excel(name = "监护人", width = 15)
|
||||
@ApiModelProperty(value = "监护人")
|
||||
private java.lang.String guardian;
|
||||
/**关系*/
|
||||
@Excel(name = "关系", width = 15)
|
||||
@ApiModelProperty(value = "关系")
|
||||
private java.lang.String relationship;
|
||||
/**联系电话*/
|
||||
@Excel(name = "联系电话", width = 15)
|
||||
@ApiModelProperty(value = "联系电话")
|
||||
private java.lang.String contactNumber;
|
||||
/**家庭住址*/
|
||||
@Excel(name = "家庭住址", width = 15)
|
||||
@ApiModelProperty(value = "家庭住址")
|
||||
private java.lang.String homeAddress;
|
||||
/**是否删除 0未删除 1删除*/
|
||||
@Excel(name = "是否删除 0未删除 1删除", width = 15)
|
||||
@ApiModelProperty(value = "是否删除 0未删除 1删除")
|
||||
@TableLogic
|
||||
private java.lang.String delFlag;
|
||||
/**创建人*/
|
||||
@ApiModelProperty(value = "创建人")
|
||||
private java.lang.String createBy;
|
||||
/**创建日期*/
|
||||
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
|
||||
@ApiModelProperty(value = "创建日期")
|
||||
private java.util.Date createTime;
|
||||
/**更新人*/
|
||||
@ApiModelProperty(value = "更新人")
|
||||
private java.lang.String updateBy;
|
||||
/**更新日期*/
|
||||
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
|
||||
@ApiModelProperty(value = "更新日期")
|
||||
private java.util.Date updateTime;
|
||||
/**所属部门*/
|
||||
@ApiModelProperty(value = "所属部门")
|
||||
private java.lang.String sysOrgCode;
|
||||
|
||||
/**签发机关*/
|
||||
private java.lang.String issuingAuthority;
|
||||
/**有效开始日期*/
|
||||
@DateTimeFormat(pattern="yyyy-MM-dd")
|
||||
private java.util.Date startTime;
|
||||
/**有效结束日期*/
|
||||
@DateTimeFormat(pattern="yyyy-MM-dd")
|
||||
private java.util.Date endTime;
|
||||
/**发卡日期*/
|
||||
@DateTimeFormat(pattern="yyyy-MM-dd")
|
||||
private java.util.Date cardIssuing;
|
||||
/**血型*/
|
||||
private java.lang.String bloodType;
|
||||
/**兵役状况*/
|
||||
private java.lang.String militaryType;
|
||||
/**监护人id*/
|
||||
private java.lang.String guardianId;
|
||||
|
||||
|
||||
}
|
||||
|
|
@ -1,17 +0,0 @@
|
|||
package com.nu.modules.nuBizCustomerInfo.mapper;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import com.nu.modules.nuBizCustomerInfo.entity.NuBizCustomerInfo;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
|
||||
/**
|
||||
* @Description: 客户信息
|
||||
* @Author: jeecg-boot
|
||||
* @Date: 2025-04-11
|
||||
* @Version: V1.0
|
||||
*/
|
||||
public interface NuBizCustomerInfoMapper extends BaseMapper<NuBizCustomerInfo> {
|
||||
|
||||
}
|
||||
|
|
@ -1,17 +0,0 @@
|
|||
package com.nu.modules.nuBizCustomerInfo.service;
|
||||
|
||||
import com.nu.modules.nuBizCustomerInfo.entity.NuBizCustomerInfo;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
|
||||
/**
|
||||
* @Description: 客户信息
|
||||
* @Author: jeecg-boot
|
||||
* @Date: 2025-04-11
|
||||
* @Version: V1.0
|
||||
*/
|
||||
public interface INuBizCustomerInfoService extends IService<NuBizCustomerInfo> {
|
||||
|
||||
void editNu(NuBizCustomerInfo nuBizCustomerInfo);
|
||||
|
||||
void editTuizhu(NuBizCustomerInfo nuBizCustomerInfo);
|
||||
}
|
||||
|
|
@ -1,74 +0,0 @@
|
|||
package com.nu.modules.nuBizCustomerInfo.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
|
||||
import com.nu.modules.nuBaseInfo.entity.NuBaseInfo;
|
||||
import com.nu.modules.nuBaseInfo.service.INuBaseInfoService;
|
||||
import com.nu.modules.nuBizCustomerInfo.entity.NuBizCustomerInfo;
|
||||
import com.nu.modules.nuBizCustomerInfo.mapper.NuBizCustomerInfoMapper;
|
||||
import com.nu.modules.nuBizCustomerInfo.service.INuBizCustomerInfoService;
|
||||
import org.apache.shiro.SecurityUtils;
|
||||
import org.jeecg.common.system.vo.LoginUser;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* @Description: 客户信息
|
||||
* @Author: jeecg-boot
|
||||
* @Date: 2025-04-11
|
||||
* @Version: V1.0
|
||||
*/
|
||||
@Service
|
||||
public class NuBizCustomerInfoServiceImpl extends ServiceImpl<NuBizCustomerInfoMapper, NuBizCustomerInfo> implements INuBizCustomerInfoService {
|
||||
@Autowired
|
||||
private INuBaseInfoService nuBaseInfoService;
|
||||
@Override
|
||||
public void editNu(NuBizCustomerInfo nuBizCustomerInfo) {
|
||||
NuBizCustomerInfo nuBizCustomerInfo1 = baseMapper.selectById(nuBizCustomerInfo.getId());
|
||||
//修改原来护理单元状态
|
||||
LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
|
||||
UpdateWrapper<NuBaseInfo> updateWrapper = new UpdateWrapper();
|
||||
updateWrapper.set("customer_id",null);//清空客户id
|
||||
updateWrapper.set("status","0");//重置成未使用状态
|
||||
updateWrapper.set("update_time",new Date());
|
||||
updateWrapper.set("update_by",sysUser.getUsername());
|
||||
updateWrapper.eq("id",nuBizCustomerInfo1.getNuId());
|
||||
nuBaseInfoService.update(updateWrapper);
|
||||
//修改新的护理单元状态
|
||||
UpdateWrapper<NuBaseInfo> updateWrapper1 = new UpdateWrapper();
|
||||
updateWrapper1.set("customer_id",nuBizCustomerInfo.getId());//赋值客户id
|
||||
updateWrapper1.set("status","1");//修改成使用状态
|
||||
updateWrapper1.set("update_time",new Date());
|
||||
updateWrapper1.set("update_by",sysUser.getUsername());
|
||||
updateWrapper1.eq("id",nuBizCustomerInfo.getNuId());
|
||||
nuBaseInfoService.update(updateWrapper1);
|
||||
//修改客户护理单元
|
||||
baseMapper.updateById(nuBizCustomerInfo);
|
||||
//添加调整护理单元日志 todo
|
||||
}
|
||||
|
||||
@Override
|
||||
public void editTuizhu(NuBizCustomerInfo nuBizCustomerInfo) {
|
||||
NuBizCustomerInfo nuBizCustomerInfo1 = baseMapper.selectById(nuBizCustomerInfo.getId());
|
||||
//修改原来护理单元状态
|
||||
LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
|
||||
UpdateWrapper<NuBaseInfo> updateWrapper = new UpdateWrapper();
|
||||
updateWrapper.set("customer_id",null);//清空客户id
|
||||
updateWrapper.set("status","0");//重置成未使用状态
|
||||
updateWrapper.set("update_time",new Date());
|
||||
updateWrapper.set("update_by",sysUser.getUsername());
|
||||
updateWrapper.eq("id",nuBizCustomerInfo1.getNuId());
|
||||
nuBaseInfoService.update(updateWrapper);
|
||||
//修改客户护理单元
|
||||
UpdateWrapper<NuBizCustomerInfo> updateTzWrapper = new UpdateWrapper();
|
||||
updateTzWrapper.set("nu_id",null);
|
||||
updateTzWrapper.set("current_state","3");
|
||||
updateTzWrapper.eq("id",nuBizCustomerInfo.getId());
|
||||
baseMapper.update(null, updateTzWrapper);
|
||||
//添加调整护理单元日志 todo
|
||||
|
||||
}
|
||||
}
|
||||
|
|
@ -1,126 +0,0 @@
|
|||
package com.nu.mq.employees.listener;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
|
||||
import com.nu.dto.EmployeesApplyMQDto;
|
||||
import com.nu.dto.SysConfigMQDto;
|
||||
import com.nu.modules.employeesInfo.entity.BizEmployeesInfo;
|
||||
import com.nu.modules.employeesInfo.service.IBizEmployeesInfoService;
|
||||
import com.nu.modules.employeesapply.entity.EmployeesApply;
|
||||
import com.nu.modules.employeesapply.service.IEmployeesApplyService;
|
||||
import com.nu.utils.RabbitMQUtil;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.checkerframework.checker.units.qual.A;
|
||||
import org.springframework.amqp.core.ExchangeTypes;
|
||||
import org.springframework.amqp.rabbit.annotation.Exchange;
|
||||
import org.springframework.amqp.rabbit.annotation.Queue;
|
||||
import org.springframework.amqp.rabbit.annotation.QueueBinding;
|
||||
import org.springframework.amqp.rabbit.annotation.RabbitListener;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
@Slf4j
|
||||
@Component
|
||||
public class EmployeesMQListener {
|
||||
@Autowired
|
||||
private RabbitMQUtil rabbitMQUtil;
|
||||
@Autowired
|
||||
private IEmployeesApplyService employeesApplyService;
|
||||
@Autowired
|
||||
private IBizEmployeesInfoService employeesInfoService;
|
||||
|
||||
/**
|
||||
* direct直连 只发给我的
|
||||
*
|
||||
* @param dto
|
||||
*/
|
||||
@RabbitListener(
|
||||
bindings = @QueueBinding(
|
||||
value = @Queue(name = "#{employeesAsyncDQNP.getQueueName()}"),
|
||||
exchange = @Exchange(name = "hldy.employees", type = ExchangeTypes.DIRECT),
|
||||
key = "#{employeesAsyncDQNP.getKeyName()}"
|
||||
),
|
||||
errorHandler = "employeesMQErrorHandler"
|
||||
)
|
||||
public void handleEmployeeApply(EmployeesApplyMQDto dto) {
|
||||
//将历史申请变更为历史状态
|
||||
EmployeesApply hisdto = new EmployeesApply();
|
||||
hisdto.setIzHistory("0");
|
||||
UpdateWrapper<EmployeesApply> uw = new UpdateWrapper<>();
|
||||
uw.eq("employee_id",dto.getEmployeeId());
|
||||
employeesApplyService.update(hisdto,uw);
|
||||
|
||||
EmployeesApply employeesApply = new EmployeesApply();
|
||||
BeanUtils.copyProperties(dto,employeesApply);
|
||||
employeesApply.setEmployeeId(dto.getEmployeeId());
|
||||
employeesApply.setId(dto.getId());
|
||||
employeesApply.setStatus("1");
|
||||
employeesApply.setDelFlag("0");
|
||||
employeesApply.setIzHistory("1");
|
||||
employeesApply.setIsInvited("1");
|
||||
employeesApplyService.save(employeesApply);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 邀请时发现此员工已申请 清理已保存的数据
|
||||
*
|
||||
* @param dto
|
||||
*/
|
||||
@RabbitListener(
|
||||
bindings = @QueueBinding(
|
||||
value = @Queue(name = "#{employeesAsyncDQNP.getCanNotInvidedQueueName()}"),
|
||||
exchange = @Exchange(name = "hldy.employees", type = ExchangeTypes.DIRECT),
|
||||
key = "#{employeesAsyncDQNP.getCanNotInvidedKeyName()}"
|
||||
),
|
||||
errorHandler = "employeesMQErrorHandler"
|
||||
)
|
||||
public void handleCanNotInvided(EmployeesApplyMQDto dto) {
|
||||
employeesApplyService.cleanErrorInvided(dto.getEmployeeId());
|
||||
}
|
||||
|
||||
/**
|
||||
* 被邀请确认
|
||||
* 1、将申请状态改为对应
|
||||
* 2、
|
||||
* @param dto
|
||||
*/
|
||||
@RabbitListener(
|
||||
bindings = @QueueBinding(
|
||||
value = @Queue(name = "#{employeesAsyncDQNP.getInvidedConfirmQueueName()}"),
|
||||
exchange = @Exchange(name = "hldy.employees", type = ExchangeTypes.DIRECT),
|
||||
key = "#{employeesAsyncDQNP.getInvidedConfirmKeyName()}"
|
||||
),
|
||||
errorHandler = "employeesMQErrorHandler"
|
||||
)
|
||||
public void handleInvidedConfirm(EmployeesApplyMQDto dto) {
|
||||
UpdateWrapper<EmployeesApply> uw = new UpdateWrapper<>();
|
||||
uw.eq("employee_id",dto.getEmployeeId());
|
||||
uw.eq("iz_history","1");//当前数据
|
||||
uw.eq("is_invited","0");//被邀请的
|
||||
EmployeesApply employeesApply = new EmployeesApply();
|
||||
employeesApply.setStatus(dto.getStatus());
|
||||
employeesApplyService.update(employeesApply,uw);
|
||||
|
||||
if("2".equals(dto.getStatus())){
|
||||
//将员工信息插入员工表中
|
||||
QueryWrapper<BizEmployeesInfo> qw = new QueryWrapper<>();
|
||||
qw.eq("id", dto.getEmployeeId());
|
||||
BizEmployeesInfo one = employeesInfoService.getOne(qw);
|
||||
if (one == null) {
|
||||
QueryWrapper<EmployeesApply> qw1 = new QueryWrapper<>();
|
||||
qw1.eq("employee_id",dto.getEmployeeId());
|
||||
qw1.eq("iz_history","1");//当前数据
|
||||
qw1.eq("is_invited","0");//被邀请的
|
||||
EmployeesApply one1 = employeesApplyService.getOne(qw1);
|
||||
BizEmployeesInfo employeesInfo = new BizEmployeesInfo();
|
||||
BeanUtils.copyProperties(one1, employeesInfo);
|
||||
employeesInfo.setId(employeesApply.getEmployeeId());
|
||||
employeesInfo.setSysOrgCode(dto.getOrgCode());
|
||||
employeesInfo.setEntryTime(dto.getOpeTime());
|
||||
employeesInfoService.save(employeesInfo);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -39,5 +39,17 @@
|
|||
<version>2.0.0</version>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.nursingunit.boot</groupId>
|
||||
<artifactId>nu-payment-local-api</artifactId>
|
||||
<version>2.0.0</version>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.nursingunit.boot</groupId>
|
||||
<artifactId>nu-nu-local-api</artifactId>
|
||||
<version>2.0.0</version>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</project>
|
||||
|
|
|
|||
|
|
@ -1,10 +1,8 @@
|
|||
package com.nu.modules.pad.baseinfo.api;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.nu.entity.NuBaseInfoEntity;
|
||||
import com.nu.modules.nubaseinfo.api.INuBaseInfoApi;
|
||||
import com.nu.modules.nubaseinfo.entity.NuBaseInfoApiDto;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.jeecg.common.api.vo.Result;
|
||||
|
|
@ -28,27 +26,22 @@ public class BaseInfoApi {
|
|||
|
||||
@ApiOperation(value = "护理单元-分页列表查询", notes = "护理单元-分页列表查询")
|
||||
@GetMapping(value = "/queryPadPageList")
|
||||
public Result<IPage<NuBaseInfoApiDto>> queryPadPageList(NuBaseInfoApiDto nuBaseInfoApiDto,
|
||||
@RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
|
||||
@RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
|
||||
HttpServletRequest req) {
|
||||
Map<String, QueryRuleEnum> customeRuleMap = new HashMap<>();
|
||||
QueryWrapper<NuBaseInfoApiDto> queryWrapper = QueryGenerator.initQueryWrapper(nuBaseInfoApiDto, req.getParameterMap(), customeRuleMap);
|
||||
Page<NuBaseInfoApiDto> page = new Page<NuBaseInfoApiDto>(pageNo, pageSize);
|
||||
IPage<NuBaseInfoApiDto> pageList = iNuBaseInfoApi.queryPadPageList(page, queryWrapper);
|
||||
public Result<IPage<NuBaseInfoEntity>> queryPadPageList(NuBaseInfoEntity nuBaseInfoApiDto,
|
||||
@RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
|
||||
@RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
|
||||
HttpServletRequest req) {
|
||||
IPage<NuBaseInfoEntity> pageList = iNuBaseInfoApi.queryPadPageList(pageNo, pageSize, nuBaseInfoApiDto,req);
|
||||
return Result.OK(pageList);
|
||||
}
|
||||
|
||||
@ApiOperation(value = "ipad-根据护理单元NUID查询数据", notes = "ipad-根据护理单元NUID查询数据")
|
||||
@GetMapping(value = "/queryinfoByBuId")
|
||||
public Result<NuBaseInfoApiDto> queryinfoByBuId(NuBaseInfoApiDto nuBaseInfoApiDto, HttpServletRequest req) {
|
||||
if(StringUtils.isBlank(nuBaseInfoApiDto.getNuId())){
|
||||
public Result<NuBaseInfoEntity> queryinfoByBuId(NuBaseInfoEntity nuBaseInfoApiDto, HttpServletRequest req) {
|
||||
if (StringUtils.isBlank(nuBaseInfoApiDto.getNuId())) {
|
||||
return Result.error("请填写NUID");
|
||||
}
|
||||
Map<String, QueryRuleEnum> customeRuleMap = new HashMap<>();
|
||||
QueryWrapper<NuBaseInfoApiDto> queryWrapper = QueryGenerator.initQueryWrapper(nuBaseInfoApiDto, req.getParameterMap(), customeRuleMap);
|
||||
NuBaseInfoApiDto dto = iNuBaseInfoApi.queryinfoByBuId( queryWrapper);
|
||||
if(dto == null ){
|
||||
NuBaseInfoEntity dto = iNuBaseInfoApi.queryinfoByBuId(nuBaseInfoApiDto, req);
|
||||
if (dto == null) {
|
||||
return Result.error("未查询到数据");
|
||||
}
|
||||
return Result.OK(dto);
|
||||
|
|
@ -58,11 +51,11 @@ public class BaseInfoApi {
|
|||
@AutoLog(value = "ipad-护理单元-编辑")
|
||||
@ApiOperation(value = "ipad-护理单元-编辑", notes = "ipad-护理单元-编辑")
|
||||
@PostMapping(value = "/updateBaseInfo")
|
||||
public Result<String> updateBaseInfo(@RequestBody NuBaseInfoApiDto nuBaseInfoApiDto) {
|
||||
public Result<String> updateBaseInfo(@RequestBody NuBaseInfoEntity nuBaseInfoApiDto) {
|
||||
int dto = iNuBaseInfoApi.updateBaseInfo(nuBaseInfoApiDto);
|
||||
if(dto>0){
|
||||
if (dto > 0) {
|
||||
return Result.OK("操作成功");
|
||||
}else{
|
||||
} else {
|
||||
return Result.OK("操作失败");
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,27 +1,22 @@
|
|||
package com.nu.modules.wechart.controller;
|
||||
package com.nu.modules.wechat.pay.api;
|
||||
|
||||
import cn.hutool.core.util.IdUtil;
|
||||
import cn.hutool.json.JSONObject;
|
||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||
import com.google.gson.JsonObject;
|
||||
import com.google.gson.JsonParser;
|
||||
import com.nu.entity.NuBillEntity;
|
||||
import com.nu.entity.PayParamEntity;
|
||||
import com.nu.entity.WechatpayConfigEntity;
|
||||
import com.nu.modules.advisoryinfo.api.IAdvisoryInfoApi;
|
||||
import com.nu.modules.nubaseinfo.api.INuBaseInfoApi;
|
||||
import com.nu.modules.nubill.api.INuBillApi;
|
||||
import com.nu.modules.sysconfig.ISysConfigApi;
|
||||
import com.nu.modules.systemorder.api.SystemOrderApi;
|
||||
import com.nu.modules.systemorder.entity.SystemOrderApiEntity;
|
||||
import com.nu.modules.wechart.entity.PayParam;
|
||||
import com.nu.modules.wechart.entity.WechatpayConfig;
|
||||
import com.wechat.pay.java.core.Config;
|
||||
import com.wechat.pay.java.core.RSAAutoCertificateConfig;
|
||||
import com.wechat.pay.java.core.exception.ServiceException;
|
||||
import com.wechat.pay.java.core.notification.NotificationConfig;
|
||||
import com.wechat.pay.java.core.notification.NotificationParser;
|
||||
import com.wechat.pay.java.core.notification.RequestParam;
|
||||
import com.wechat.pay.java.service.payments.jsapi.JsapiService;
|
||||
import com.wechat.pay.java.service.payments.jsapi.JsapiServiceExtension;
|
||||
import com.wechat.pay.java.service.payments.jsapi.model.*;
|
||||
import com.nu.utils.WeChatPayUtils;
|
||||
import com.wechat.pay.java.service.payments.jsapi.model.Amount;
|
||||
import com.wechat.pay.java.service.payments.model.Transaction;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.apache.http.HttpEntity;
|
||||
import org.apache.http.HttpResponse;
|
||||
import org.apache.http.HttpStatus;
|
||||
|
|
@ -33,209 +28,167 @@ import org.apache.http.impl.client.DefaultHttpClient;
|
|||
import org.apache.http.impl.client.HttpClients;
|
||||
import org.apache.http.util.EntityUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import javax.servlet.ServletInputStream;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import javax.validation.Valid;
|
||||
import java.io.BufferedReader;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStreamReader;
|
||||
import java.math.BigDecimal;
|
||||
import java.security.MessageDigest;
|
||||
import java.time.LocalDateTime;
|
||||
import java.time.format.DateTimeFormatter;
|
||||
import java.util.Date;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
import java.util.UUID;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.*;
|
||||
|
||||
/**
|
||||
* 微信支付
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/weiXinPay")
|
||||
@Slf4j
|
||||
public class WechatPayController {
|
||||
public class WeChatPayApi {
|
||||
|
||||
@Autowired
|
||||
public WechatpayConfig wechatpayConfig;
|
||||
private ISysConfigApi sysConfigApi;
|
||||
@Autowired
|
||||
private SystemOrderApi systemOrderApi;
|
||||
@Autowired
|
||||
private ISysConfigApi sysConfigApi;
|
||||
private WeChatPayUtils weChatPayUtils;
|
||||
@Autowired
|
||||
private WechatpayConfigEntity wechatpayConfig;
|
||||
@Autowired
|
||||
private INuBaseInfoApi nuBaseInfoApi;
|
||||
@Autowired
|
||||
private INuBillApi nuBillApi;
|
||||
|
||||
/**
|
||||
* Native下单
|
||||
* 调用统一下单API,生成支付二维码
|
||||
* 绑定护理单元支付
|
||||
*/
|
||||
@PostMapping("/native")
|
||||
public Map<String, String> nativePay(@Valid @RequestBody PayParam params) throws Exception {
|
||||
@PostMapping("/nuBindPay")
|
||||
public Map<String, String> nativePay(@Valid @RequestBody PayParamEntity params) throws Exception {
|
||||
|
||||
//准备各种数据
|
||||
//系统订单号+商户订单号(使用同一个,便于管理)
|
||||
//年月日时分秒+毫秒值后六位+2位随机数
|
||||
String outTradeNo = new SimpleDateFormat("yyyyMMddHHmmss").format(new Date()) + String.valueOf(System.currentTimeMillis() % 1000000) + String.format("%02d", new Random().nextInt(100));
|
||||
String openId = params.getOpenId();//用户openId
|
||||
String nuId = params.getNursingUnit();//护理单元
|
||||
String title = params.getTitle();//订单名称
|
||||
BigDecimal amountPrice = params.getAmountPrice();//总价(支付金额)
|
||||
BigDecimal price = params.getPrice();//单价
|
||||
Integer count = params.getCount();//数量
|
||||
String unit = params.getUnit();//单位
|
||||
String customerId = params.getCustomerId();//客户ID
|
||||
String orderType = params.getOrderType();//订单类型
|
||||
String orderDesc = params.getOrderDesc();//订单描述
|
||||
String orgCode = params.getOrgCode();//机构编码
|
||||
Amount amount = new Amount();
|
||||
Integer totalFee = amountPrice.multiply(BigDecimal.valueOf(100)).intValue();
|
||||
amount.setTotal(totalFee);
|
||||
|
||||
//存储订单数据
|
||||
SystemOrderApiEntity systemOrderApiEntity = new SystemOrderApiEntity();
|
||||
{
|
||||
systemOrderApiEntity.setOrderNo(outTradeNo);//系统订单号
|
||||
systemOrderApiEntity.setOutTradeNo(outTradeNo);//商户订单号
|
||||
systemOrderApiEntity.setTransactionId(null);//订单支付后腾讯返回的订单号(订单支付后才有) 用于退款流程
|
||||
systemOrderApiEntity.setNuId(nuId);//护理单元(必传)
|
||||
systemOrderApiEntity.setOpenId(openId);//支付人open_id(必传)
|
||||
systemOrderApiEntity.setSeniorId(null);//此时还没有绑定长者
|
||||
systemOrderApiEntity.setAmount(amountPrice);//总价(支付金额)(必传)
|
||||
systemOrderApiEntity.setPrice(price);//单价(必传)
|
||||
systemOrderApiEntity.setCount(count);//数量(必传)
|
||||
systemOrderApiEntity.setUnit(unit);//单位(必传)
|
||||
systemOrderApiEntity.setOrderStatus("CREATED");//订单状态
|
||||
systemOrderApiEntity.setOrderName(title);//订单名称(必传)
|
||||
systemOrderApiEntity.setOrderDescription(orderDesc);//订单描述(非必传)
|
||||
systemOrderApiEntity.setOrderTime(new Date());//下单时间
|
||||
systemOrderApiEntity.setPaySuccessTime(null);//支付成功时间
|
||||
systemOrderApiEntity.setExpireTime(null);//订单过期时间
|
||||
systemOrderApiEntity.setNotifyCount(0);//回调次数
|
||||
systemOrderApiEntity.setRefundStatus(0);//退款状态 0=未退款,1=退款中,2=已退款,3=退款失败
|
||||
systemOrderApiEntity.setRefundTime(null);//退款时间
|
||||
systemOrderApiEntity.setUpdatedTime(null);//更新时间 每次回调/更新都要记录
|
||||
systemOrderApiEntity.setCustomerId(customerId);//客户ID(必传)
|
||||
systemOrderApiEntity.setOrderType(orderType);//订单类型(必传)
|
||||
systemOrderApiEntity.setReceiptTime(null);//回执时间
|
||||
systemOrderApiEntity.setReceiptDescription(null);//回执描述
|
||||
systemOrderApiEntity.setReceiptMessage(null);//回执报文
|
||||
systemOrderApiEntity.setOrgCode(orgCode);//机构编码(必传)
|
||||
systemOrderApiEntity.setDelFlag(0);//未删除
|
||||
String id = systemOrderApi.save(systemOrderApiEntity);
|
||||
systemOrderApiEntity.setId(id);
|
||||
}
|
||||
|
||||
//验证支付是否可用
|
||||
{
|
||||
com.alibaba.fastjson.JSONObject sysParams = sysConfigApi.getByKey("wechat_pay_enabled");
|
||||
Boolean wechatPayEnabled = sysParams.getBoolean("configValue");
|
||||
if (!wechatPayEnabled) {
|
||||
SystemOrderApiEntity upDto = new SystemOrderApiEntity();
|
||||
upDto.setId(systemOrderApiEntity.getId());
|
||||
upDto.setOrderStatus("ORG_PAYMENT_DISABLED");//商家未启用微信支付功能
|
||||
upDto.setReceiptDescription("由于商家已关闭微信支付功能,无法完成微信支付。");//回执描述
|
||||
throw new RuntimeException("微信支付已关闭");
|
||||
}
|
||||
}
|
||||
|
||||
Config config = new RSAAutoCertificateConfig.Builder().merchantId(wechatpayConfig.getMchId()).privateKeyFromPath(wechatpayConfig.getPrivateKeyPath()).merchantSerialNumber(wechatpayConfig.getMchSerialNo()).apiV3Key(wechatpayConfig.getApiV3Key()).build();
|
||||
// 构建service
|
||||
JsapiService service = new JsapiService.Builder().config(config).build();
|
||||
PrepayRequest request = new PrepayRequest();
|
||||
String title = params.getTitle();//订单名称
|
||||
String openId = params.getOpenId();//客户openId
|
||||
BigDecimal amountPrice = params.getAmountPrice();//总价(支付金额)
|
||||
String orgCode = params.getOrgCode();//机构编码
|
||||
String nursingUnit = params.getNursingUnit();//护理单元
|
||||
String customerId = params.getCustomerId();//客户ID
|
||||
String orderType = params.getOrderType();//订单类型
|
||||
BigDecimal price = params.getPrice();//单价
|
||||
Integer count = params.getCount();//数量
|
||||
String unit = params.getUnit();//单位
|
||||
String seniorId = params.getSeniorId();//长者ID
|
||||
String orderDesc = params.getOrderDesc();//订单描述
|
||||
|
||||
String outTradeNo = IdUtil.simpleUUID();//商户订单号
|
||||
Amount amount = new Amount();
|
||||
amount.setTotal(Integer.parseInt(amountPrice.toString()));
|
||||
request.setAmount(amount);
|
||||
request.setAppid(wechatpayConfig.getAppid());
|
||||
request.setMchid(wechatpayConfig.getMchId());
|
||||
request.setDescription(title);
|
||||
request.setNotifyUrl(wechatpayConfig.getNotifyDomain());
|
||||
request.setOutTradeNo(outTradeNo);
|
||||
Payer payer = new Payer();
|
||||
payer.setOpenid(openId);
|
||||
request.setPayer(payer);
|
||||
// 调用下单方法,得到应答
|
||||
PrepayResponse response = service.prepay(request);
|
||||
log.info("prepayId:" + response.getPrepayId());
|
||||
//存储订单数据
|
||||
{
|
||||
SystemOrderApiEntity systemOrderApiEntity = new SystemOrderApiEntity();
|
||||
systemOrderApiEntity.setOrgCode(orgCode);//机构编码(必传)
|
||||
systemOrderApiEntity.setNursingUnit(nursingUnit);//护理单元(必传)
|
||||
systemOrderApiEntity.setCustomerId(customerId);//客户ID(必传)
|
||||
systemOrderApiEntity.setOrderType(orderType);//订单类型(必传)
|
||||
systemOrderApiEntity.setPrice(price);//单价(必传)
|
||||
systemOrderApiEntity.setCount(count);//数量(必传)
|
||||
systemOrderApiEntity.setUnit(unit);//单位(必传)
|
||||
systemOrderApiEntity.setAmount(amountPrice);//总价(支付金额)(必传)
|
||||
systemOrderApiEntity.setSeniorId(seniorId);//长者ID(非必传)
|
||||
systemOrderApiEntity.setOpenId(openId);//客户openId(必传)
|
||||
systemOrderApiEntity.setOrderName(title);//订单名称(必传)
|
||||
systemOrderApiEntity.setOrderDescription(orderDesc);//订单描述(非必传)
|
||||
systemOrderApiEntity.setOutTradeNo(outTradeNo);//商户订单号
|
||||
systemOrderApiEntity.setOrderTime(new Date());//下单时间
|
||||
systemOrderApiEntity.setOrderStatus("created");//订单状态
|
||||
systemOrderApi.save(systemOrderApiEntity);
|
||||
}
|
||||
Map map = prepayWithRequestPayment(request, config);
|
||||
return map;
|
||||
return weChatPayUtils.pay(title, openId, outTradeNo, amount);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 返回调起支付的参数
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
private Map<String, String> prepayWithRequestPayment(PrepayRequest request, Config config) {
|
||||
Map<String, String> map = new HashMap<>();
|
||||
JsapiServiceExtension jse = new JsapiServiceExtension.Builder().config(config).build();
|
||||
PrepayWithRequestPaymentResponse response = jse.prepayWithRequestPayment(request);
|
||||
map.put("appId", response.getAppId());
|
||||
map.put("timeStamp", response.getTimeStamp());
|
||||
map.put("nonceStr", response.getNonceStr());
|
||||
map.put("package", response.getPackageVal());
|
||||
map.put("signType", response.getSignType());
|
||||
map.put("paySign", response.getPaySign());
|
||||
return map;
|
||||
}
|
||||
|
||||
@PostMapping("/callback")
|
||||
public String courseNative(HttpServletRequest request, HttpServletResponse response) {
|
||||
Transaction decryptObject = weChatPayUtils.callback(request);
|
||||
//查询订单
|
||||
SystemOrderApiEntity orderData = systemOrderApi.selectByOutTradeNo(decryptObject.getOutTradeNo());
|
||||
|
||||
System.out.println("11111111111111");
|
||||
NotificationConfig config = new RSAAutoCertificateConfig.Builder().merchantId(wechatpayConfig.getMchId()).apiV3Key(wechatpayConfig.getApiV3Key()).merchantSerialNumber(wechatpayConfig.getMchSerialNo()).privateKeyFromPath(wechatpayConfig.getPrivateKeyPath()).build();
|
||||
System.out.println("222222222222222" + config);
|
||||
// 从请求头中获取信息
|
||||
String timestamp = request.getHeader("Wechatpay-Timestamp");
|
||||
String nonce = request.getHeader("Wechatpay-Nonce");
|
||||
String signature = request.getHeader("Wechatpay-Signature");
|
||||
String singType = request.getHeader("Wechatpay-Signature-Type");
|
||||
String wechatPayCertificateSerialNumber = request.getHeader("Wechatpay-Serial");
|
||||
|
||||
System.out.println("333333333333333");
|
||||
String requestBody = getRequestBody(request);
|
||||
|
||||
System.out.println("333333333333333" + requestBody);
|
||||
// 初始化解析器 NotificationParser
|
||||
NotificationParser parser = new NotificationParser(config);
|
||||
System.out.println("444444444444444444444" + parser);
|
||||
RequestParam requestParam = new RequestParam.Builder().serialNumber(wechatPayCertificateSerialNumber).nonce(nonce).signature(signature).timestamp(timestamp).signType(singType).body(requestBody).build();
|
||||
System.out.println("555555555555555555555" + requestParam);
|
||||
//系统订单表状态更新
|
||||
SystemOrderApiEntity systemOrderApiEntity = new SystemOrderApiEntity();
|
||||
if ("binding_nu".equals(orderData.getOrderType())) {
|
||||
//可以在这里针对“护理单元绑定”进行特殊处理
|
||||
if ("SUCCESS".equals(decryptObject.getTradeState().name())) {
|
||||
//绑定护理单元
|
||||
nuBaseInfoApi.bindNu(orderData.getNuId());
|
||||
//增加余额
|
||||
BigDecimal sum = nuBaseInfoApi.addBalance(orderData.getNuId(), orderData.getAmount());
|
||||
//修改护理单元费用明细
|
||||
NuBillEntity nuBillEntity = new NuBillEntity();
|
||||
nuBillEntity.setNuId(orderData.getNuId());
|
||||
nuBillEntity.setOpenId(orderData.getOpenId());
|
||||
nuBillEntity.setElderId(null);
|
||||
nuBillEntity.setAmount(orderData.getAmount());//本次变动金额
|
||||
nuBillEntity.setBalanceAfter(sum);//操作后的余额
|
||||
nuBillEntity.setType("bind_nu");
|
||||
nuBillEntity.setRemark("绑定护理单元充值:"+orderData.getAmount().toString()+"元");
|
||||
nuBillEntity.setCreateTime(new Date());
|
||||
nuBillApi.addData(nuBillEntity);
|
||||
}
|
||||
}
|
||||
Date now = new Date();
|
||||
systemOrderApiEntity.setNotifyCount(orderData.getNotifyCount() + 1);//回执次数
|
||||
systemOrderApiEntity.setOutTradeNo(decryptObject.getOutTradeNo());//商户订单号
|
||||
systemOrderApiEntity.setTransactionId(decryptObject.getTransactionId());//微信支付订单号
|
||||
systemOrderApiEntity.setReceiptTime(now);//回执时间
|
||||
systemOrderApiEntity.setOrderStatus(decryptObject.getTradeState().name());//支付状态
|
||||
systemOrderApiEntity.setReceiptDescription(decryptObject.getTradeStateDesc());//回执描述
|
||||
systemOrderApiEntity.setUpdatedTime(now);//最后更新时间
|
||||
try {
|
||||
// 这个Transaction是微信包里面的
|
||||
Transaction decryptObject = parser.parse(requestParam, Transaction.class);
|
||||
|
||||
System.out.println("666666666666666666:" + decryptObject);
|
||||
|
||||
// 获取各项信息
|
||||
String openId = decryptObject.getPayer().getOpenid(); // 用户openId
|
||||
Integer amount = decryptObject.getAmount().getTotal(); // 订单金额(分)
|
||||
String successTime = decryptObject.getSuccessTime(); // 支付成功时间
|
||||
String tradeState = decryptObject.getTradeState().toString(); // 订单状态
|
||||
String tradeStateDesc = decryptObject.getTradeStateDesc(); // 交易状态描述
|
||||
String rawData = requestBody; // 回执报文(原始请求体)
|
||||
|
||||
// 打印获取的信息
|
||||
System.out.println("OpenID: " + openId);
|
||||
System.out.println("金额(分): " + amount);
|
||||
System.out.println("支付成功时间: " + successTime);
|
||||
System.out.println("订单状态: " + tradeState);
|
||||
System.out.println("状态描述: " + tradeStateDesc);
|
||||
System.out.println("原始报文: " + rawData);
|
||||
//系统订单表状态更新
|
||||
{
|
||||
SystemOrderApiEntity systemOrderApiEntity = new SystemOrderApiEntity();
|
||||
systemOrderApiEntity.setOutTradeNo(decryptObject.getOutTradeNo());//商户订单号
|
||||
systemOrderApiEntity.setTransactionId(decryptObject.getTransactionId());//微信支付订单号
|
||||
systemOrderApiEntity.setOrderStatus(decryptObject.getTradeState().name());//支付状态
|
||||
systemOrderApiEntity.setReceiptDescription(decryptObject.getTradeStateDesc());//回执描述
|
||||
systemOrderApiEntity.setReceiptMessage(new ObjectMapper().writeValueAsString(decryptObject));//回执报文
|
||||
systemOrderApiEntity.setReceiptTime(new Date());
|
||||
systemOrderApi.updateByOutTradeNo(systemOrderApiEntity);
|
||||
|
||||
//如果订单支付成功则向表中插入定时任务
|
||||
if ("SUCCESS".equals(decryptObject.getTradeState().name())) {
|
||||
SystemOrderApiEntity systemOrder = systemOrderApi.selectByOutTradeNo(decryptObject.getOutTradeNo());
|
||||
|
||||
}
|
||||
}
|
||||
return decryptObject.getTradeState().toString();
|
||||
systemOrderApiEntity.setReceiptMessage(new ObjectMapper().writeValueAsString(decryptObject));//回执报文
|
||||
} catch (Exception e) {
|
||||
systemOrderApiEntity.setReceiptMessage("报文解析错误:" + e.getMessage());//回执报文
|
||||
e.printStackTrace();
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
//如果订单支付成功
|
||||
if ("SUCCESS".equals(decryptObject.getTradeState().name())) {
|
||||
systemOrderApiEntity.setPaySuccessTime(now);//订单支付成功时间
|
||||
//余额请在不同的orderType判断处进行个性化处理(方法中binding_nu就是针对护理单元绑定的~),这里再加余额就加重复了o(╥﹏╥)o
|
||||
}
|
||||
|
||||
}
|
||||
systemOrderApi.updateByOutTradeNo(systemOrderApiEntity);
|
||||
|
||||
// 获取请求头里的数据
|
||||
private String getRequestBody(HttpServletRequest request) {
|
||||
StringBuffer sb = new StringBuffer();
|
||||
try (ServletInputStream inputStream = request.getInputStream(); BufferedReader reader = new BufferedReader(new InputStreamReader(inputStream));) {
|
||||
String line;
|
||||
while ((line = reader.readLine()) != null) {
|
||||
sb.append(line);
|
||||
}
|
||||
} catch (IOException e) {
|
||||
System.out.println("读取数据流异常:" + e);
|
||||
}
|
||||
return sb.toString();
|
||||
return decryptObject.getTradeState().toString();
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -246,33 +199,7 @@ public class WechatPayController {
|
|||
*/
|
||||
@PostMapping("/queryOrderById")
|
||||
public Map<String, Object> queryOrderById(@RequestBody Map<String, String> params) throws Exception {
|
||||
|
||||
|
||||
Config config = new RSAAutoCertificateConfig.Builder().merchantId(wechatpayConfig.getMchId()).privateKeyFromPath(wechatpayConfig.getPrivateKeyPath()).merchantSerialNumber(wechatpayConfig.getMchSerialNo()).apiV3Key(wechatpayConfig.getApiV3Key()).build();
|
||||
String prepay_id = params.get("prepay_id");
|
||||
Map<String, Object> map = new HashMap<>();
|
||||
if (StringUtils.isEmpty(prepay_id)) {
|
||||
map.put("code", "400");
|
||||
map.put("msg", "参数错误,prepay_id为空!");
|
||||
return map;
|
||||
}
|
||||
// 构建service
|
||||
JsapiService service = new JsapiService.Builder().config(config).build();
|
||||
QueryOrderByIdRequest queryRequest = new QueryOrderByIdRequest();
|
||||
queryRequest.setMchid(wechatpayConfig.getMchId());
|
||||
queryRequest.setTransactionId(prepay_id);
|
||||
|
||||
try {
|
||||
Transaction result = service.queryOrderById(queryRequest);
|
||||
System.out.println(result.getTradeState());
|
||||
map.put("code", "200");
|
||||
map.put("msg", result);
|
||||
} catch (ServiceException e) {
|
||||
// API返回失败, 例如ORDER_NOT_EXISTS
|
||||
System.out.printf("code=[%s], message=[%s]\n", e.getErrorCode(), e.getErrorMessage());
|
||||
System.out.printf("reponse body=[%s]\n", e.getResponseBody());
|
||||
}
|
||||
return map;
|
||||
return weChatPayUtils.getOrderInfo(params);
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -340,10 +267,10 @@ public class WechatPayController {
|
|||
|
||||
|
||||
@PostMapping("/getJsApiInfo")
|
||||
public Map<String,String> getJsApiInfo(@RequestBody Map<String,String> params) throws Exception {
|
||||
public Map<String, String> getJsApiInfo(@RequestBody Map<String, String> params) throws Exception {
|
||||
String accessToken = getToken(GET_TOKEN_URL, wechatpayConfig.getAppid(), wechatpayConfig.getAppsecret());// 获取token
|
||||
String firstUrl = params.get("url");
|
||||
System.out.println("---------firstUrl-------"+firstUrl);
|
||||
System.out.println("---------firstUrl-------" + firstUrl);
|
||||
System.out.println("---------token-------" + accessToken);
|
||||
// 构造请求URL
|
||||
String requestUrl = "https://api.weixin.qq.com/cgi-bin/ticket/getticket?access_token=" + accessToken + "&type=jsapi";
|
||||
|
|
@ -364,7 +291,7 @@ public class WechatPayController {
|
|||
String ticket = String.valueOf(jsonObject.get("ticket"));
|
||||
String nonceStr = UUID.randomUUID().toString();
|
||||
String timestamp = Long.toString(System.currentTimeMillis() / 1000);
|
||||
String string1 = new StringBuilder("jsapi_ticket=").append(ticket)
|
||||
String string1 = new StringBuilder("jsapi_ticket=").append(ticket)
|
||||
.append("&noncestr=")
|
||||
.append(nonceStr)
|
||||
.append("×tamp=")
|
||||
|
|
@ -406,6 +333,4 @@ public class WechatPayController {
|
|||
}
|
||||
return hexValue.toString();
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
@ -120,7 +120,6 @@ public class ShiroConfig {
|
|||
filterChainDefinitionMap.put("/sys/getLoginQrcode/**", "anon"); //登录二维码
|
||||
filterChainDefinitionMap.put("/sys/getQrcodeToken/**", "anon"); //监听扫码
|
||||
filterChainDefinitionMap.put("/sys/checkAuth", "anon"); //授权接口排除
|
||||
filterChainDefinitionMap.put("/h5Api/nuBizAdvisoryInfo/**", "anon"); //授权接口排除
|
||||
filterChainDefinitionMap.put("/h5Api/nuBaseInfo/**", "anon"); //授权接口排除
|
||||
filterChainDefinitionMap.put("/weiXinPay/**", "anon"); //微信支付接口
|
||||
filterChainDefinitionMap.put("/weiXinPay2/**", "anon"); //微信支付接口
|
||||
|
|
|
|||
|
|
@ -23,6 +23,25 @@
|
|||
<artifactId>alibabacloud-ocr_api20210707</artifactId>
|
||||
<version>3.0.4</version>
|
||||
</dependency>
|
||||
|
||||
<!-- 微信支付 SDK -->
|
||||
<dependency>
|
||||
<groupId>com.github.wechatpay-apiv3</groupId>
|
||||
<artifactId>wechatpay-apache-httpclient</artifactId>
|
||||
<version>0.4.9</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.github.wechatpay-apiv3</groupId>
|
||||
<artifactId>wechatpay-java</artifactId>
|
||||
<version>0.2.17</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.github.wxpay</groupId>
|
||||
<artifactId>wxpay-sdk</artifactId>
|
||||
<version>0.0.3</version>
|
||||
</dependency>
|
||||
|
||||
|
||||
</dependencies>
|
||||
|
||||
</project>
|
||||
|
|
|
|||
|
|
@ -15,6 +15,8 @@ import java.util.Date;
|
|||
public class EmployeesStatusMQDto implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**id*/
|
||||
private String id;
|
||||
/**员工id*/
|
||||
private String employeeId;
|
||||
/**申请状态 1申请中 2通过 3驳回*/
|
||||
|
|
@ -30,5 +32,5 @@ public class EmployeesStatusMQDto implements Serializable {
|
|||
/**入职时间*/
|
||||
private Date entryTime;
|
||||
/**openId*/
|
||||
private Date openId;
|
||||
private String openId;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -56,25 +56,10 @@ public class NuBizAdvisoryInfoDto implements Serializable {
|
|||
private java.util.Date updateTime;
|
||||
/**所属部门*/
|
||||
private String sysOrgCode;
|
||||
/**老人姓名*/
|
||||
private String oldManName;
|
||||
/**老人年龄*/
|
||||
private String oldManAge;
|
||||
/**医保类型*/
|
||||
private String medicalInsuranceType;
|
||||
/**老人性别*/
|
||||
private String oldManSex;
|
||||
/**报销类型*/
|
||||
private String reimbType;
|
||||
/**护理单元*/
|
||||
private String nuId;
|
||||
private String advisoryTypeName;
|
||||
private String sexName;
|
||||
private String sysOrgCodeName;
|
||||
private String statusName;
|
||||
private String oldManSexName;
|
||||
private String medicalInsuranceTypeName;
|
||||
private String reimbTypeName;
|
||||
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,36 @@
|
|||
package com.nu.dto;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* @Description: 小程序消息通知
|
||||
* @Author: jeecg-boot
|
||||
* @Date: 2025-09-11
|
||||
* @Version: V1.0
|
||||
*/
|
||||
@Data
|
||||
public class WxNoticeMQDto implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**id*/
|
||||
private String id;
|
||||
/**open_id微信openid*/
|
||||
private String openId;
|
||||
/**机构编码*/
|
||||
private String orgCode;
|
||||
/**通知类型 对应数据字典notice_type 在管理端能看到*/
|
||||
private String type;
|
||||
/**标题*/
|
||||
private String title;
|
||||
/**日期*/
|
||||
private Date createTime;
|
||||
/**内容*/
|
||||
private String content;
|
||||
/**是否已读 0已读 1未读*/
|
||||
private String izRead;
|
||||
/**1机构端 2员工端 3家属端*/
|
||||
private String clientType;
|
||||
}
|
||||
|
|
@ -0,0 +1,84 @@
|
|||
package com.nu.entity;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* @Description: 咨询信息
|
||||
* @Author: 张明远
|
||||
* @Date: 2025-04-07
|
||||
* @Version: V1.0
|
||||
*/
|
||||
@Data
|
||||
public class AdvisoryInfoEntity implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**id*/
|
||||
private String id;
|
||||
/**平台id*/
|
||||
private Long platId;
|
||||
/**微信id*/
|
||||
private String openId;
|
||||
/**微信名称*/
|
||||
private String wechatName;
|
||||
/**咨询人姓名*/
|
||||
private String name;
|
||||
/**昵称*/
|
||||
private String nickName;
|
||||
/**头像*/
|
||||
private String avatar;
|
||||
/**性别*/
|
||||
private String sex;
|
||||
/**联系电话*/
|
||||
private String tel;
|
||||
/**咨询类型 1入住nu 2入驻机构 3我要加盟*/
|
||||
private String advisoryType;
|
||||
/**状态 1审核中 2审核完成 3驳回*/
|
||||
private String status;
|
||||
/**审核备注*/
|
||||
private String content;
|
||||
/**机构访问地址*/
|
||||
private String serverUrl;
|
||||
/**创建人*/
|
||||
private String createBy;
|
||||
/**创建日期*/
|
||||
private Date createTime;
|
||||
/**更新人*/
|
||||
private String updateBy;
|
||||
/**更新日期*/
|
||||
private Date updateTime;
|
||||
/**所属部门*/
|
||||
private String sysOrgCode;
|
||||
|
||||
/**老人姓名*/
|
||||
private String oldManName;
|
||||
/**老人年龄*/
|
||||
private String oldManAge;
|
||||
/**医保类型*/
|
||||
private String medicalInsuranceType;
|
||||
/**老人性别*/
|
||||
private String oldManSex;
|
||||
/**报销类型*/
|
||||
private String reimbType;
|
||||
/**护理单元*/
|
||||
private String nuId;
|
||||
/**是否入住0否 1是(是否入住过)*/
|
||||
private String izCheckIn;
|
||||
|
||||
private String izYg;//是否是员工 0否 1是
|
||||
private String izJs;//是否是家属 0否 1是
|
||||
private String izJg;//是否是机构 0否 1是
|
||||
|
||||
private String advisoryTypeName;
|
||||
private String sexName;
|
||||
private String sysOrgCodeName;
|
||||
private String statusName;
|
||||
|
||||
private String oldManSexName;
|
||||
private String medicalInsuranceTypeName;
|
||||
private String reimbTypeName;
|
||||
private String token;
|
||||
|
||||
}
|
||||
|
|
@ -1,11 +1,11 @@
|
|||
package com.nu.modules.camerainfo.entity;
|
||||
package com.nu.entity;
|
||||
|
||||
import cn.hutool.json.JSONObject;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class CameraInfoDto {
|
||||
public class CameraInfoEntity {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**ID*/
|
||||
|
|
@ -1,15 +1,8 @@
|
|||
package com.nu.modules.nubaseinfo.entity;
|
||||
package com.nu.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.experimental.Accessors;
|
||||
import org.jeecgframework.poi.excel.annotation.Excel;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
|
@ -25,7 +18,7 @@ import java.util.Date;
|
|||
@Data
|
||||
@Accessors(chain = true)
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
public class CustomerDirectiveDto implements Serializable {
|
||||
public class CustomerDirectiveEntity implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**id*/
|
||||
|
|
@ -1,17 +1,9 @@
|
|||
package com.nu.modules.nubaseinfo.entity;
|
||||
package com.nu.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableLogic;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.experimental.Accessors;
|
||||
import org.jeecg.common.aspect.annotation.Dict;
|
||||
import org.jeecgframework.poi.excel.annotation.Excel;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
|
@ -26,7 +18,7 @@ import java.util.Date;
|
|||
@Data
|
||||
@Accessors(chain = true)
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
public class CustomerInfoDto implements Serializable {
|
||||
public class CustomerInfoEntity implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**id*/
|
||||
|
|
@ -0,0 +1,191 @@
|
|||
package com.nu.entity;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* @Description: 客户信息
|
||||
* @Author: jeecg-boot
|
||||
* @Date: 2025-04-11
|
||||
* @Version: V1.0
|
||||
*/
|
||||
@Data
|
||||
public class ElderInfoEntity implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* id
|
||||
*/
|
||||
private String id;
|
||||
/**
|
||||
* 护理单元
|
||||
*/
|
||||
private String nuId;
|
||||
/**
|
||||
* 姓名
|
||||
*/
|
||||
private String name;
|
||||
/**
|
||||
* 性别
|
||||
*/
|
||||
private String sex;
|
||||
/**
|
||||
* 年龄
|
||||
*/
|
||||
private String age;
|
||||
/**
|
||||
* 身份证号码
|
||||
*/
|
||||
private String idCard;
|
||||
/**
|
||||
* 出生日期
|
||||
*/
|
||||
private java.util.Date dateOfBirth;
|
||||
/**
|
||||
* 民族
|
||||
*/
|
||||
private String national;
|
||||
/**
|
||||
* 头像
|
||||
*/
|
||||
private String avatarPath;
|
||||
/**
|
||||
* 医保类型
|
||||
*/
|
||||
private String medicalType;
|
||||
/**
|
||||
* 报销类型
|
||||
*/
|
||||
private String reimbType;
|
||||
/**
|
||||
* 医保卡号
|
||||
*/
|
||||
private String medicalCard;
|
||||
/**
|
||||
* 文化程度
|
||||
*/
|
||||
private String educationLevel;
|
||||
/**
|
||||
* 婚姻状况
|
||||
*/
|
||||
private String maritalStatus;
|
||||
/**
|
||||
* 宗教信仰
|
||||
*/
|
||||
private String religiousBeliefs;
|
||||
/**
|
||||
* 身份证正面
|
||||
*/
|
||||
private String idCardPositive;
|
||||
/**
|
||||
* 身份证反面
|
||||
*/
|
||||
private String idCardNegative;
|
||||
/**
|
||||
* 户口本本人页
|
||||
*/
|
||||
private String accountBookHimself;
|
||||
/**
|
||||
* 医保卡正面
|
||||
*/
|
||||
private String frontMedical;
|
||||
/**
|
||||
* 医保卡反面
|
||||
*/
|
||||
private String negaticeMedical;
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
private String content;
|
||||
/**
|
||||
* 当前状态 0咨询 1入住 2留床 3退住
|
||||
*/
|
||||
private String currentState;
|
||||
/**
|
||||
* 监护人openId
|
||||
*/
|
||||
private String guardianOpenId;
|
||||
/**
|
||||
* 监护人姓名
|
||||
*/
|
||||
private String guardianName;
|
||||
/**
|
||||
* 监护人与老人关系
|
||||
*/
|
||||
private String relationship;
|
||||
/**
|
||||
* 监护人身份证号
|
||||
*/
|
||||
private String guardianIdCard;
|
||||
/**
|
||||
* 监护人联系电话
|
||||
*/
|
||||
private String guardianPhone;
|
||||
/**
|
||||
* 监护人出生日期
|
||||
*/
|
||||
private java.util.Date guardianDateOfBirth;
|
||||
/**
|
||||
* 监护人家庭住址
|
||||
*/
|
||||
private String guardianHomeAddress;
|
||||
/**
|
||||
* 监护人工作单位
|
||||
*/
|
||||
private String guardianWorkUnit;
|
||||
/**
|
||||
* 家庭住址
|
||||
*/
|
||||
private String homeAddress;
|
||||
/**
|
||||
* 是否删除 0未删除 1删除
|
||||
*/
|
||||
private String delFlag;
|
||||
/**
|
||||
* 创建人
|
||||
*/
|
||||
private String createBy;
|
||||
/**
|
||||
* 创建日期
|
||||
*/
|
||||
private java.util.Date createTime;
|
||||
/**
|
||||
* 更新人
|
||||
*/
|
||||
private String updateBy;
|
||||
/**
|
||||
* 更新日期
|
||||
*/
|
||||
private java.util.Date updateTime;
|
||||
/**
|
||||
* 所属部门
|
||||
*/
|
||||
private String sysOrgCode;
|
||||
|
||||
/**
|
||||
* 签发机关
|
||||
*/
|
||||
private String issuingAuthority;
|
||||
/**
|
||||
* 有效开始日期
|
||||
*/
|
||||
private java.util.Date startTime;
|
||||
/**
|
||||
* 有效结束日期
|
||||
*/
|
||||
private java.util.Date endTime;
|
||||
/**
|
||||
* 发卡日期
|
||||
*/
|
||||
private java.util.Date cardIssuing;
|
||||
/**
|
||||
* 血型
|
||||
*/
|
||||
private String bloodType;
|
||||
/**
|
||||
* 兵役状况
|
||||
*/
|
||||
private String militaryType;
|
||||
|
||||
}
|
||||
|
|
@ -1,9 +1,9 @@
|
|||
package com.nu.modules.nubaseinfo.entity;
|
||||
package com.nu.entity;
|
||||
|
||||
import com.nu.modules.camerainfo.entity.CameraInfoDto;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
|
|
@ -13,7 +13,7 @@ import java.util.List;
|
|||
* @Version: V1.0
|
||||
*/
|
||||
@Data
|
||||
public class NuBaseInfoApiDto implements Serializable {
|
||||
public class NuBaseInfoEntity implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**ID*/
|
||||
|
|
@ -42,8 +42,10 @@ public class NuBaseInfoApiDto implements Serializable {
|
|||
private String sysOrgCode;
|
||||
private String orgCode;
|
||||
private String asyncId;
|
||||
/**余额*/
|
||||
private BigDecimal balance;
|
||||
//摄像头信息
|
||||
private List<CameraInfoDto> cameraInfo;
|
||||
private CustomerInfoDto customerInfo;
|
||||
private List<CustomerDirectiveDto> customerDirectiveDtoList;
|
||||
private List<CameraInfoEntity> cameraInfo;
|
||||
private CustomerInfoEntity customerInfo;
|
||||
private List<CustomerDirectiveEntity> customerDirectiveDtoList;
|
||||
}
|
||||
|
|
@ -0,0 +1,37 @@
|
|||
package com.nu.entity;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* @Description: 护理单元费用明细
|
||||
* @Author: jeecg-boot
|
||||
* @Date: 2025-09-17
|
||||
* @Version: V1.0
|
||||
*/
|
||||
@Data
|
||||
public class NuBillEntity implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**id*/
|
||||
private Integer id;
|
||||
/**护理单元编号*/
|
||||
private String nuId;
|
||||
/**长者ID*/
|
||||
private Integer elderId;
|
||||
/**家属open_id*/
|
||||
private String openId;
|
||||
/**变动金额:正为充值/退款,负为消费*/
|
||||
private BigDecimal amount;
|
||||
/**本次操作后余额(防计算误差)*/
|
||||
private BigDecimal balanceAfter;
|
||||
/**费用类型bill_type:电费,水费,充值,退款等 */
|
||||
private String type;
|
||||
/**备注*/
|
||||
private String remark;
|
||||
/**createdTime*/
|
||||
private Date createTime;
|
||||
}
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
package com.nu.modules.wechart.entity;
|
||||
package com.nu.entity;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
|
|
@ -10,7 +10,7 @@ import java.math.BigDecimal;
|
|||
* 支付参数实体类(系统需要用到的)
|
||||
*/
|
||||
@Data
|
||||
public class PayParam {
|
||||
public class PayParamEntity {
|
||||
|
||||
// 机构编码
|
||||
@NotBlank(message = "机构编码不能为空")
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
package com.nu.modules.wechart.entity;
|
||||
package com.nu.entity;
|
||||
|
||||
import com.github.wxpay.sdk.WXPayConfig;
|
||||
import lombok.Data;
|
||||
|
|
@ -11,7 +11,7 @@ import java.io.InputStream;
|
|||
* @date 2020/2/26
|
||||
*/
|
||||
@Data
|
||||
public class WXConfig implements WXPayConfig {
|
||||
public class WXConfigEntity implements WXPayConfig {
|
||||
private byte[] certData;
|
||||
|
||||
public String appId;
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
package com.nu.modules.wechart.entity;
|
||||
package com.nu.entity;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
|
@ -8,7 +8,7 @@ import org.springframework.context.annotation.Configuration;
|
|||
@Configuration
|
||||
@Slf4j
|
||||
@Data
|
||||
public class WechatpayConfig {
|
||||
public class WechatpayConfigEntity {
|
||||
// 商户ID
|
||||
@Value("${wxpay.mch-id}")
|
||||
private String mchId;
|
||||
|
|
@ -0,0 +1,60 @@
|
|||
package com.nu.enums;
|
||||
|
||||
/**
|
||||
* 小程序客户端类型枚举
|
||||
* 用于标识请求来源:机构端、员工端、家属端
|
||||
*/
|
||||
public enum WxClientType {
|
||||
|
||||
INSTITUTION(1, "机构端"),
|
||||
EMPLOYEE(2, "员工端"),
|
||||
FAMILY(3, "家属端");
|
||||
|
||||
private final int code;
|
||||
private final String description;
|
||||
|
||||
WxClientType(int code, String description) {
|
||||
this.code = code;
|
||||
this.description = description;
|
||||
}
|
||||
|
||||
public int getCode() {
|
||||
return code;
|
||||
}
|
||||
|
||||
public String getDescription() {
|
||||
return description;
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据 code 获取对应的枚举值
|
||||
*/
|
||||
public static WxClientType fromCode(int code) {
|
||||
for (WxClientType type : WxClientType.values()) {
|
||||
if (type.code == code) {
|
||||
return type;
|
||||
}
|
||||
}
|
||||
throw new IllegalArgumentException("未知的客户端类型 code: " + code);
|
||||
}
|
||||
|
||||
/**
|
||||
* 检查 code 是否有效
|
||||
*/
|
||||
public static boolean isValid(int code) {
|
||||
try {
|
||||
fromCode(code);
|
||||
return true;
|
||||
} catch (IllegalArgumentException e) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "ClientType{" +
|
||||
"code=" + code +
|
||||
", description='" + description + '\'' +
|
||||
'}';
|
||||
}
|
||||
}
|
||||
|
|
@ -1,19 +1,10 @@
|
|||
package com.nu.modules.mediaasyncerrorlog.controller;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.stream.Collectors;
|
||||
import java.io.IOException;
|
||||
import java.io.UnsupportedEncodingException;
|
||||
import java.net.URLDecoder;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import org.jeecg.common.api.vo.Result;
|
||||
import org.jeecg.common.system.query.QueryGenerator;
|
||||
import org.jeecg.common.system.query.QueryRuleEnum;
|
||||
import org.jeecg.common.util.oConvertUtils;
|
||||
import com.nu.modules.mediaasyncerrorlog.entity.MediaAsyncErrorLog;
|
||||
import com.nu.modules.mediaasyncerrorlog.service.IMediaAsyncErrorLogService;
|
||||
|
||||
|
|
@ -22,18 +13,10 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
|
|||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
import org.jeecgframework.poi.excel.ExcelImportUtil;
|
||||
import org.jeecgframework.poi.excel.def.NormalExcelConstants;
|
||||
import org.jeecgframework.poi.excel.entity.ExportParams;
|
||||
import org.jeecgframework.poi.excel.entity.ImportParams;
|
||||
import org.jeecgframework.poi.excel.view.JeecgEntityExcelView;
|
||||
import org.jeecg.common.system.base.controller.JeecgController;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
import org.springframework.web.multipart.MultipartHttpServletRequest;
|
||||
import org.springframework.web.servlet.ModelAndView;
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.jeecg.common.aspect.annotation.AutoLog;
|
||||
|
|
@ -52,7 +35,7 @@ import org.apache.shiro.authz.annotation.RequiresPermissions;
|
|||
public class MediaAsyncErrorLogController extends JeecgController<MediaAsyncErrorLog, IMediaAsyncErrorLogService> {
|
||||
@Autowired
|
||||
private IMediaAsyncErrorLogService mediaAsyncErrorLogService;
|
||||
|
||||
|
||||
/**
|
||||
* 分页列表查询
|
||||
*
|
||||
|
|
@ -74,7 +57,7 @@ public class MediaAsyncErrorLogController extends JeecgController<MediaAsyncErro
|
|||
IPage<MediaAsyncErrorLog> pageList = mediaAsyncErrorLogService.page(page, queryWrapper);
|
||||
return Result.OK(pageList);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 添加
|
||||
*
|
||||
|
|
@ -89,7 +72,7 @@ public class MediaAsyncErrorLogController extends JeecgController<MediaAsyncErro
|
|||
mediaAsyncErrorLogService.save(mediaAsyncErrorLog);
|
||||
return Result.OK("添加成功!");
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 编辑
|
||||
*
|
||||
|
|
@ -104,7 +87,7 @@ public class MediaAsyncErrorLogController extends JeecgController<MediaAsyncErro
|
|||
mediaAsyncErrorLogService.updateById(mediaAsyncErrorLog);
|
||||
return Result.OK("编辑成功!");
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 通过id删除
|
||||
*
|
||||
|
|
@ -119,7 +102,7 @@ public class MediaAsyncErrorLogController extends JeecgController<MediaAsyncErro
|
|||
mediaAsyncErrorLogService.removeById(id);
|
||||
return Result.OK("删除成功!");
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 批量删除
|
||||
*
|
||||
|
|
@ -134,7 +117,7 @@ public class MediaAsyncErrorLogController extends JeecgController<MediaAsyncErro
|
|||
this.mediaAsyncErrorLogService.removeByIds(Arrays.asList(ids.split(",")));
|
||||
return Result.OK("批量删除成功!");
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 通过id查询
|
||||
*
|
||||
|
|
@ -1,8 +1,5 @@
|
|||
package com.nu.modules.mediaasyncerrorlog.mapper;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import com.nu.modules.mediaasyncerrorlog.entity.MediaAsyncErrorLog;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
|
||||
|
|
@ -0,0 +1,180 @@
|
|||
package com.nu.utils;
|
||||
|
||||
import com.nu.entity.WechatpayConfigEntity;
|
||||
import com.wechat.pay.java.core.Config;
|
||||
import com.wechat.pay.java.core.RSAAutoCertificateConfig;
|
||||
import com.wechat.pay.java.core.exception.ServiceException;
|
||||
import com.wechat.pay.java.core.notification.NotificationConfig;
|
||||
import com.wechat.pay.java.core.notification.NotificationParser;
|
||||
import com.wechat.pay.java.core.notification.RequestParam;
|
||||
import com.wechat.pay.java.service.payments.jsapi.JsapiService;
|
||||
import com.wechat.pay.java.service.payments.jsapi.JsapiServiceExtension;
|
||||
import com.wechat.pay.java.service.payments.jsapi.model.*;
|
||||
import com.wechat.pay.java.service.payments.model.Transaction;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import javax.servlet.ServletInputStream;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import java.io.BufferedReader;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStreamReader;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 微信支付工具类
|
||||
*/
|
||||
@Component
|
||||
@Slf4j
|
||||
public class WeChatPayUtils {
|
||||
|
||||
@Autowired
|
||||
private WechatpayConfigEntity wechatpayConfig;
|
||||
|
||||
/**
|
||||
* 发起微信 JSAPI 支付(统一下单并生成前端调起支付所需参数)
|
||||
*
|
||||
* @param title 商品标题/描述
|
||||
* @param openId 用户在商户公众号下的唯一标识
|
||||
* @param outTradeNo 商户系统内部订单号,要求32个字符内,只能是数字、大小写字母_-|*且在同一个商户号下唯一
|
||||
* @param amount 支付金额对象,包含总金额等信息
|
||||
* @return Map<String, String> 包含前端调起支付所需的所有参数,如 appId, timeStamp, nonceStr, package, signType, paySign
|
||||
*/
|
||||
public Map<String, String> pay(String title, String openId, String outTradeNo, Amount amount) {
|
||||
// 1. 构建微信支付 SDK 所需的配置对象(含商户号、私钥路径、证书序列号、APIv3密钥)
|
||||
Config config = new RSAAutoCertificateConfig.Builder()
|
||||
.merchantId(wechatpayConfig.getMchId())
|
||||
.privateKeyFromPath(wechatpayConfig.getPrivateKeyPath())
|
||||
.merchantSerialNumber(wechatpayConfig.getMchSerialNo())
|
||||
.apiV3Key(wechatpayConfig.getApiV3Key())
|
||||
.build();
|
||||
|
||||
// 2. 构造统一下单 API 的请求参数
|
||||
PrepayRequest request = new PrepayRequest();
|
||||
request.setAmount(amount);
|
||||
request.setAppid(wechatpayConfig.getAppid());
|
||||
request.setMchid(wechatpayConfig.getMchId());
|
||||
request.setDescription(title);
|
||||
request.setNotifyUrl(wechatpayConfig.getNotifyDomain());
|
||||
request.setOutTradeNo(outTradeNo);
|
||||
Payer payer = new Payer();
|
||||
payer.setOpenid(openId);
|
||||
request.setPayer(payer);
|
||||
|
||||
// 3. 调用统一下单接口,获取预支付交易会话标识(prepay_id)
|
||||
JsapiService service = new JsapiService.Builder().config(config).build();
|
||||
PrepayResponse response = service.prepay(request);
|
||||
log.info("微信支付 prepayId:" + response.getPrepayId());
|
||||
|
||||
// 4. 根据 prepay_id 生成前端调起支付所需的所有签名参数
|
||||
Map<String, String> map = new HashMap<>();
|
||||
{
|
||||
JsapiServiceExtension jse = new JsapiServiceExtension.Builder().config(config).build();
|
||||
PrepayWithRequestPaymentResponse response_ = jse.prepayWithRequestPayment(request);
|
||||
map.put("appId", response_.getAppId());
|
||||
map.put("timeStamp", response_.getTimeStamp());
|
||||
map.put("nonceStr", response_.getNonceStr());
|
||||
map.put("package", response_.getPackageVal());
|
||||
map.put("signType", response_.getSignType());
|
||||
map.put("paySign", response_.getPaySign());
|
||||
}
|
||||
return map;
|
||||
}
|
||||
|
||||
/**
|
||||
* 微信回调处理
|
||||
*
|
||||
* @param request
|
||||
* @return
|
||||
*/
|
||||
public Transaction callback(HttpServletRequest request) {
|
||||
System.out.println("11111111111111");
|
||||
NotificationConfig config = new RSAAutoCertificateConfig.Builder().merchantId(wechatpayConfig.getMchId()).apiV3Key(wechatpayConfig.getApiV3Key()).merchantSerialNumber(wechatpayConfig.getMchSerialNo()).privateKeyFromPath(wechatpayConfig.getPrivateKeyPath()).build();
|
||||
System.out.println("222222222222222" + config);
|
||||
// 从请求头中获取信息
|
||||
String timestamp = request.getHeader("Wechatpay-Timestamp");
|
||||
String nonce = request.getHeader("Wechatpay-Nonce");
|
||||
String signature = request.getHeader("Wechatpay-Signature");
|
||||
String singType = request.getHeader("Wechatpay-Signature-Type");
|
||||
String wechatPayCertificateSerialNumber = request.getHeader("Wechatpay-Serial");
|
||||
|
||||
System.out.println("333333333333333");
|
||||
String requestBody = getRequestBody(request);
|
||||
|
||||
System.out.println("333333333333333" + requestBody);
|
||||
// 初始化解析器 NotificationParser
|
||||
NotificationParser parser = new NotificationParser(config);
|
||||
System.out.println("444444444444444444444" + parser);
|
||||
RequestParam requestParam = new RequestParam.Builder().serialNumber(wechatPayCertificateSerialNumber).nonce(nonce).signature(signature).timestamp(timestamp).signType(singType).body(requestBody).build();
|
||||
System.out.println("555555555555555555555" + requestParam);
|
||||
// 这个Transaction是微信包里面的
|
||||
Transaction decryptObject = parser.parse(requestParam, Transaction.class);
|
||||
|
||||
System.out.println("666666666666666666:" + decryptObject);
|
||||
|
||||
// 获取各项信息
|
||||
String openId = decryptObject.getPayer().getOpenid(); // 用户openId
|
||||
Integer amount = decryptObject.getAmount().getTotal(); // 订单金额(分)
|
||||
String successTime = decryptObject.getSuccessTime(); // 支付成功时间
|
||||
String tradeState = decryptObject.getTradeState().toString(); // 订单状态
|
||||
String tradeStateDesc = decryptObject.getTradeStateDesc(); // 交易状态描述
|
||||
String rawData = requestBody; // 回执报文(原始请求体)
|
||||
|
||||
// 打印获取的信息
|
||||
System.out.println("OpenID: " + openId);
|
||||
System.out.println("金额(分): " + amount);
|
||||
System.out.println("支付成功时间: " + successTime);
|
||||
System.out.println("订单状态: " + tradeState);
|
||||
System.out.println("状态描述: " + tradeStateDesc);
|
||||
System.out.println("原始报文: " + rawData);
|
||||
|
||||
return decryptObject;
|
||||
}
|
||||
|
||||
|
||||
// 获取请求头里的数据
|
||||
private String getRequestBody(HttpServletRequest request) {
|
||||
StringBuffer sb = new StringBuffer();
|
||||
try (ServletInputStream inputStream = request.getInputStream(); BufferedReader reader = new BufferedReader(new InputStreamReader(inputStream));) {
|
||||
String line;
|
||||
while ((line = reader.readLine()) != null) {
|
||||
sb.append(line);
|
||||
}
|
||||
} catch (IOException e) {
|
||||
System.out.println("读取数据流异常:" + e);
|
||||
}
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
|
||||
public Map<String, Object> getOrderInfo(Map<String, String> params) {
|
||||
Config config = new RSAAutoCertificateConfig.Builder().merchantId(wechatpayConfig.getMchId()).privateKeyFromPath(wechatpayConfig.getPrivateKeyPath()).merchantSerialNumber(wechatpayConfig.getMchSerialNo()).apiV3Key(wechatpayConfig.getApiV3Key()).build();
|
||||
String prepay_id = params.get("prepay_id");
|
||||
Map<String, Object> map = new HashMap<>();
|
||||
if (StringUtils.isEmpty(prepay_id)) {
|
||||
map.put("code", "400");
|
||||
map.put("msg", "参数错误,prepay_id为空!");
|
||||
return map;
|
||||
}
|
||||
// 构建service
|
||||
JsapiService service = new JsapiService.Builder().config(config).build();
|
||||
QueryOrderByIdRequest queryRequest = new QueryOrderByIdRequest();
|
||||
queryRequest.setMchid(wechatpayConfig.getMchId());
|
||||
queryRequest.setTransactionId(prepay_id);
|
||||
|
||||
try {
|
||||
Transaction result = service.queryOrderById(queryRequest);
|
||||
System.out.println(result.getTradeState());
|
||||
map.put("code", "200");
|
||||
map.put("msg", result);
|
||||
} catch (ServiceException e) {
|
||||
// API返回失败, 例如ORDER_NOT_EXISTS
|
||||
System.out.printf("code=[%s], message=[%s]\n", e.getErrorCode(), e.getErrorMessage());
|
||||
System.out.printf("reponse body=[%s]\n", e.getResponseBody());
|
||||
}
|
||||
return map;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,10 @@
|
|||
package com.nu.modules.elder.api;
|
||||
|
||||
import com.nu.entity.ElderInfoEntity;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public interface IElderInfoApi {
|
||||
|
||||
List<ElderInfoEntity> selectCurrentState3();
|
||||
}
|
||||
|
|
@ -41,7 +41,13 @@
|
|||
<version>2.0.0</version>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.nursingunit.boot</groupId>
|
||||
<artifactId>nu-nu-local-api</artifactId>
|
||||
<version>2.0.0</version>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
|
||||
</dependencies>
|
||||
</dependencies>
|
||||
|
||||
</project>
|
||||
|
|
|
|||
|
|
@ -1,58 +1,41 @@
|
|||
package com.nu.modules.nuBizCustomerInfo.controller;
|
||||
package com.nu.modules.elderinfo.controller;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.stream.Collectors;
|
||||
import java.io.IOException;
|
||||
import java.io.UnsupportedEncodingException;
|
||||
import java.net.URLDecoder;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import org.jeecg.common.api.vo.Result;
|
||||
import org.jeecg.common.system.query.QueryGenerator;
|
||||
import org.jeecg.common.system.query.QueryRuleEnum;
|
||||
import org.jeecg.common.util.oConvertUtils;
|
||||
import com.nu.modules.nuBizCustomerInfo.entity.NuBizCustomerInfo;
|
||||
import com.nu.modules.nuBizCustomerInfo.service.INuBizCustomerInfoService;
|
||||
import com.nu.modules.elderinfo.entity.ElderInfo;
|
||||
import com.nu.modules.elderinfo.service.IElderInfoService;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
import org.jeecgframework.poi.excel.ExcelImportUtil;
|
||||
import org.jeecgframework.poi.excel.def.NormalExcelConstants;
|
||||
import org.jeecgframework.poi.excel.entity.ExportParams;
|
||||
import org.jeecgframework.poi.excel.entity.ImportParams;
|
||||
import org.jeecgframework.poi.excel.view.JeecgEntityExcelView;
|
||||
import org.jeecg.common.system.base.controller.JeecgController;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
import org.springframework.web.multipart.MultipartHttpServletRequest;
|
||||
import org.springframework.web.servlet.ModelAndView;
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.jeecg.common.aspect.annotation.AutoLog;
|
||||
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||
|
||||
/**
|
||||
* @Description: 客户信息
|
||||
* @Description: 长者信息
|
||||
* @Author: jeecg-boot
|
||||
* @Date: 2025-04-11
|
||||
* @Version: V1.0
|
||||
*/
|
||||
@Api(tags="客户信息")
|
||||
@Api(tags="长者信息")
|
||||
@RestController
|
||||
@RequestMapping("/nuBizCustomerInfo/nuBizCustomerInfo")
|
||||
@RequestMapping("/admin/elderInfo")
|
||||
@Slf4j
|
||||
public class NuBizCustomerInfoController extends JeecgController<NuBizCustomerInfo, INuBizCustomerInfoService> {
|
||||
public class ElderInfoController extends JeecgController<ElderInfo, IElderInfoService> {
|
||||
@Autowired
|
||||
private INuBizCustomerInfoService nuBizCustomerInfoService;
|
||||
|
||||
private IElderInfoService nuBizCustomerInfoService;
|
||||
|
||||
/**
|
||||
* 分页列表查询
|
||||
*
|
||||
|
|
@ -62,90 +45,90 @@ public class NuBizCustomerInfoController extends JeecgController<NuBizCustomerIn
|
|||
* @param req
|
||||
* @return
|
||||
*/
|
||||
//@AutoLog(value = "客户信息-分页列表查询")
|
||||
@ApiOperation(value="客户信息-分页列表查询", notes="客户信息-分页列表查询")
|
||||
//@AutoLog(value = "长者信息-分页列表查询")
|
||||
@ApiOperation(value="长者信息-分页列表查询", notes="长者信息-分页列表查询")
|
||||
@GetMapping(value = "/list")
|
||||
public Result<IPage<NuBizCustomerInfo>> queryPageList(NuBizCustomerInfo nuBizCustomerInfo,
|
||||
@RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
|
||||
@RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
|
||||
HttpServletRequest req) {
|
||||
QueryWrapper<NuBizCustomerInfo> queryWrapper = QueryGenerator.initQueryWrapper(nuBizCustomerInfo, req.getParameterMap());
|
||||
Page<NuBizCustomerInfo> page = new Page<NuBizCustomerInfo>(pageNo, pageSize);
|
||||
IPage<NuBizCustomerInfo> pageList = nuBizCustomerInfoService.page(page, queryWrapper);
|
||||
public Result<IPage<ElderInfo>> queryPageList(ElderInfo nuBizCustomerInfo,
|
||||
@RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
|
||||
@RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
|
||||
HttpServletRequest req) {
|
||||
QueryWrapper<ElderInfo> queryWrapper = QueryGenerator.initQueryWrapper(nuBizCustomerInfo, req.getParameterMap());
|
||||
Page<ElderInfo> page = new Page<ElderInfo>(pageNo, pageSize);
|
||||
IPage<ElderInfo> pageList = nuBizCustomerInfoService.page(page, queryWrapper);
|
||||
return Result.OK(pageList);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 添加
|
||||
*
|
||||
* @param nuBizCustomerInfo
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "客户信息-添加")
|
||||
@ApiOperation(value="客户信息-添加", notes="客户信息-添加")
|
||||
@AutoLog(value = "长者信息-添加")
|
||||
@ApiOperation(value="长者信息-添加", notes="长者信息-添加")
|
||||
@RequiresPermissions("nuBizCustomerInfo:nu_biz_customer_info:add")
|
||||
@PostMapping(value = "/add")
|
||||
public Result<String> add(@RequestBody NuBizCustomerInfo nuBizCustomerInfo) {
|
||||
public Result<String> add(@RequestBody ElderInfo nuBizCustomerInfo) {
|
||||
nuBizCustomerInfoService.save(nuBizCustomerInfo);
|
||||
return Result.OK("添加成功!");
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 编辑
|
||||
*
|
||||
* @param nuBizCustomerInfo
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "客户信息-编辑")
|
||||
@ApiOperation(value="客户信息-编辑", notes="客户信息-编辑")
|
||||
@AutoLog(value = "长者信息-编辑")
|
||||
@ApiOperation(value="长者信息-编辑", notes="长者信息-编辑")
|
||||
@RequiresPermissions("nuBizCustomerInfo:nu_biz_customer_info:edit")
|
||||
@RequestMapping(value = "/edit", method = {RequestMethod.PUT,RequestMethod.POST})
|
||||
public Result<String> edit(@RequestBody NuBizCustomerInfo nuBizCustomerInfo) {
|
||||
public Result<String> edit(@RequestBody ElderInfo nuBizCustomerInfo) {
|
||||
nuBizCustomerInfoService.updateById(nuBizCustomerInfo);
|
||||
return Result.OK("操作成功!");
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 通过id删除
|
||||
*
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "客户信息-通过id删除")
|
||||
@ApiOperation(value="客户信息-通过id删除", notes="客户信息-通过id删除")
|
||||
@AutoLog(value = "长者信息-通过id删除")
|
||||
@ApiOperation(value="长者信息-通过id删除", notes="长者信息-通过id删除")
|
||||
@RequiresPermissions("nuBizCustomerInfo:nu_biz_customer_info:delete")
|
||||
@DeleteMapping(value = "/delete")
|
||||
public Result<String> delete(@RequestParam(name="id",required=true) String id) {
|
||||
nuBizCustomerInfoService.removeById(id);
|
||||
return Result.OK("删除成功!");
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 批量删除
|
||||
*
|
||||
* @param ids
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "客户信息-批量删除")
|
||||
@ApiOperation(value="客户信息-批量删除", notes="客户信息-批量删除")
|
||||
@AutoLog(value = "长者信息-批量删除")
|
||||
@ApiOperation(value="长者信息-批量删除", notes="长者信息-批量删除")
|
||||
@RequiresPermissions("nuBizCustomerInfo:nu_biz_customer_info:deleteBatch")
|
||||
@DeleteMapping(value = "/deleteBatch")
|
||||
public Result<String> deleteBatch(@RequestParam(name="ids",required=true) String ids) {
|
||||
this.nuBizCustomerInfoService.removeByIds(Arrays.asList(ids.split(",")));
|
||||
return Result.OK("批量删除成功!");
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 通过id查询
|
||||
*
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
//@AutoLog(value = "客户信息-通过id查询")
|
||||
@ApiOperation(value="客户信息-通过id查询", notes="客户信息-通过id查询")
|
||||
//@AutoLog(value = "长者信息-通过id查询")
|
||||
@ApiOperation(value="长者信息-通过id查询", notes="长者信息-通过id查询")
|
||||
@GetMapping(value = "/queryById")
|
||||
public Result<NuBizCustomerInfo> queryById(@RequestParam(name="id",required=true) String id) {
|
||||
NuBizCustomerInfo nuBizCustomerInfo = nuBizCustomerInfoService.getById(id);
|
||||
public Result<ElderInfo> queryById(@RequestParam(name="id",required=true) String id) {
|
||||
ElderInfo nuBizCustomerInfo = nuBizCustomerInfoService.getById(id);
|
||||
if(nuBizCustomerInfo==null) {
|
||||
return Result.error("未找到对应数据");
|
||||
}
|
||||
|
|
@ -160,8 +143,8 @@ public class NuBizCustomerInfoController extends JeecgController<NuBizCustomerIn
|
|||
*/
|
||||
@RequiresPermissions("nuBizCustomerInfo:nu_biz_customer_info:exportXls")
|
||||
@RequestMapping(value = "/exportXls")
|
||||
public ModelAndView exportXls(HttpServletRequest request, NuBizCustomerInfo nuBizCustomerInfo) {
|
||||
return super.exportXls(request, nuBizCustomerInfo, NuBizCustomerInfo.class, "客户信息");
|
||||
public ModelAndView exportXls(HttpServletRequest request, ElderInfo nuBizCustomerInfo) {
|
||||
return super.exportXls(request, nuBizCustomerInfo, ElderInfo.class, "长者信息");
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -174,25 +157,25 @@ public class NuBizCustomerInfoController extends JeecgController<NuBizCustomerIn
|
|||
@RequiresPermissions("nuBizCustomerInfo:nu_biz_customer_info:importExcel")
|
||||
@RequestMapping(value = "/importExcel", method = RequestMethod.POST)
|
||||
public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) {
|
||||
return super.importExcel(request, response, NuBizCustomerInfo.class);
|
||||
return super.importExcel(request, response, ElderInfo.class);
|
||||
}
|
||||
|
||||
|
||||
@AutoLog(value = "客户信息-更换护理单元")
|
||||
@ApiOperation(value="客户信息-更换护理单元", notes="客户信息-更换护理单元")
|
||||
@AutoLog(value = "长者信息-更换护理单元")
|
||||
@ApiOperation(value="长者信息-更换护理单元", notes="长者信息-更换护理单元")
|
||||
@RequiresPermissions("nuBizCustomerInfo:nu_biz_customer_info:edit")
|
||||
@RequestMapping(value = "/editNu", method = {RequestMethod.PUT,RequestMethod.POST})
|
||||
public Result<String> editNu(@RequestBody NuBizCustomerInfo nuBizCustomerInfo) {
|
||||
public Result<String> editNu(@RequestBody ElderInfo nuBizCustomerInfo) {
|
||||
nuBizCustomerInfoService.editNu(nuBizCustomerInfo);
|
||||
return Result.OK("编辑成功!");
|
||||
}
|
||||
|
||||
|
||||
@AutoLog(value = "客户信息-退住")
|
||||
@ApiOperation(value="客户信息-退住", notes="客户信息-退住")
|
||||
@AutoLog(value = "长者信息-退住")
|
||||
@ApiOperation(value="长者信息-退住", notes="长者信息-退住")
|
||||
@RequiresPermissions("nuBizCustomerInfo:nu_biz_customer_info:edit")
|
||||
@RequestMapping(value = "/editTuizhu", method = {RequestMethod.PUT,RequestMethod.POST})
|
||||
public Result<String> editTuizhu(@RequestBody NuBizCustomerInfo nuBizCustomerInfo) {
|
||||
public Result<String> editTuizhu(@RequestBody ElderInfo nuBizCustomerInfo) {
|
||||
nuBizCustomerInfoService.editTuizhu(nuBizCustomerInfo);
|
||||
return Result.OK("编辑成功!");
|
||||
}
|
||||
|
|
@ -0,0 +1,290 @@
|
|||
package com.nu.modules.elderinfo.entity;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.baomidou.mybatisplus.annotation.TableLogic;
|
||||
import lombok.Data;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
import org.jeecgframework.poi.excel.annotation.Excel;
|
||||
import org.jeecg.common.aspect.annotation.Dict;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
/**
|
||||
* @Description: 客户信息
|
||||
* @Author: jeecg-boot
|
||||
* @Date: 2025-04-11
|
||||
* @Version: V1.0
|
||||
*/
|
||||
@Data
|
||||
@TableName("nu_biz_elder_info")
|
||||
@Accessors(chain = true)
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@ApiModel(value = "nu_biz_elder_info对象", description = "客户信息")
|
||||
public class ElderInfo implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* id
|
||||
*/
|
||||
@TableId(type = IdType.ASSIGN_ID)
|
||||
@ApiModelProperty(value = "id")
|
||||
private java.lang.String id;
|
||||
/**
|
||||
* 护理单元
|
||||
*/
|
||||
@Excel(name = "护理单元", width = 15)
|
||||
@ApiModelProperty(value = "护理单元")
|
||||
@Dict(dicCode = "nu_id", dicText = "nu_name", dictTable = "nu_base_info")
|
||||
private java.lang.String nuId;
|
||||
/**
|
||||
* 姓名
|
||||
*/
|
||||
@Excel(name = "姓名", width = 15)
|
||||
@ApiModelProperty(value = "姓名")
|
||||
private java.lang.String name;
|
||||
/**
|
||||
* 性别
|
||||
*/
|
||||
@Excel(name = "性别", width = 15)
|
||||
@ApiModelProperty(value = "性别")
|
||||
@Dict(dicCode = "sex")
|
||||
private java.lang.String sex;
|
||||
/**
|
||||
* 年龄
|
||||
*/
|
||||
@Excel(name = "年龄", width = 15)
|
||||
@ApiModelProperty(value = "年龄")
|
||||
private java.lang.String age;
|
||||
/**
|
||||
* 身份证号码
|
||||
*/
|
||||
@Excel(name = "身份证号码", width = 15)
|
||||
@ApiModelProperty(value = "身份证号码")
|
||||
private java.lang.String idCard;
|
||||
/**
|
||||
* 出生日期
|
||||
*/
|
||||
@Excel(name = "出生日期", width = 20, format = "yyyy-MM-dd HH:mm:ss")
|
||||
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd")
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd")
|
||||
@ApiModelProperty(value = "出生日期")
|
||||
private java.util.Date dateOfBirth;
|
||||
/**
|
||||
* 民族
|
||||
*/
|
||||
@Excel(name = "民族", width = 15)
|
||||
@ApiModelProperty(value = "民族")
|
||||
private java.lang.String national;
|
||||
/**
|
||||
* 头像
|
||||
*/
|
||||
@Excel(name = "头像", width = 15)
|
||||
@ApiModelProperty(value = "头像")
|
||||
private java.lang.String avatarPath;
|
||||
/**
|
||||
* 医保类型
|
||||
*/
|
||||
@Excel(name = "医保类型", width = 15, dicCode = "medical_insurance_type")
|
||||
@Dict(dicCode = "medical_insurance_type")
|
||||
@ApiModelProperty(value = "医保类型")
|
||||
private java.lang.String medicalType;
|
||||
/**
|
||||
* 报销类型
|
||||
*/
|
||||
@Dict(dicCode = "reimb_type")
|
||||
private java.lang.String reimbType;
|
||||
/**
|
||||
* 医保卡号
|
||||
*/
|
||||
@Excel(name = "医保卡号", width = 15)
|
||||
@ApiModelProperty(value = "医保卡号")
|
||||
private java.lang.String medicalCard;
|
||||
/**
|
||||
* 文化程度
|
||||
*/
|
||||
@Excel(name = "文化程度", width = 15)
|
||||
@ApiModelProperty(value = "文化程度")
|
||||
private java.lang.String educationLevel;
|
||||
/**
|
||||
* 婚姻状况
|
||||
*/
|
||||
@Excel(name = "婚姻状况", width = 15)
|
||||
@ApiModelProperty(value = "婚姻状况")
|
||||
private java.lang.String maritalStatus;
|
||||
/**
|
||||
* 宗教信仰
|
||||
*/
|
||||
@Excel(name = "宗教信仰", width = 15)
|
||||
@ApiModelProperty(value = "宗教信仰")
|
||||
private java.lang.String religiousBeliefs;
|
||||
/**
|
||||
* 身份证正面
|
||||
*/
|
||||
@Excel(name = "身份证正面", width = 15)
|
||||
@ApiModelProperty(value = "身份证正面")
|
||||
private java.lang.String idCardPositive;
|
||||
/**
|
||||
* 身份证反面
|
||||
*/
|
||||
@Excel(name = "身份证反面", width = 15)
|
||||
@ApiModelProperty(value = "身份证反面")
|
||||
private java.lang.String idCardNegative;
|
||||
/**
|
||||
* 户口本本人页
|
||||
*/
|
||||
@Excel(name = "户口本本人页", width = 15)
|
||||
@ApiModelProperty(value = "户口本本人页")
|
||||
private java.lang.String accountBookHimself;
|
||||
/**
|
||||
* 医保卡正面
|
||||
*/
|
||||
@Excel(name = "医保卡正面", width = 15)
|
||||
@ApiModelProperty(value = "医保卡正面")
|
||||
private java.lang.String frontMedical;
|
||||
/**
|
||||
* 医保卡反面
|
||||
*/
|
||||
@Excel(name = "医保卡反面", width = 15)
|
||||
@ApiModelProperty(value = "医保卡反面")
|
||||
private java.lang.String negaticeMedical;
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
@Excel(name = "备注", width = 15)
|
||||
@ApiModelProperty(value = "备注")
|
||||
private java.lang.String content;
|
||||
/**
|
||||
* 当前状态 0咨询 1入住 2留床 3退住
|
||||
*/
|
||||
@Excel(name = "当前状态 0咨询 1入住 2留床 3退住", width = 15)
|
||||
@ApiModelProperty(value = "当前状态 0咨询 1入住 2留床 3退住")
|
||||
@Dict(dicCode = "current_state")
|
||||
private java.lang.String currentState;
|
||||
/**
|
||||
* 监护人openId
|
||||
*/
|
||||
@ApiModelProperty(value = "监护人openId")
|
||||
private java.lang.String guardianOpenId;
|
||||
/**
|
||||
* 监护人姓名
|
||||
*/
|
||||
@Excel(name = "监护人姓名", width = 15)
|
||||
@ApiModelProperty(value = "监护人姓名")
|
||||
private java.lang.String guardianName;
|
||||
/**
|
||||
* 监护人与老人关系
|
||||
*/
|
||||
@Excel(name = "监护人与老人关系", width = 15)
|
||||
@ApiModelProperty(value = "监护人与老人关系")
|
||||
private java.lang.String relationship;
|
||||
/**
|
||||
* 监护人身份证号
|
||||
*/
|
||||
@Excel(name = "监护人身份证号", width = 15)
|
||||
@ApiModelProperty(value = "监护人身份证号")
|
||||
private java.lang.String guardianIdCard;
|
||||
/**
|
||||
* 监护人联系电话
|
||||
*/
|
||||
@Excel(name = "监护人联系电话", width = 15)
|
||||
@ApiModelProperty(value = "监护人联系电话")
|
||||
private java.lang.String guardianPhone;
|
||||
/**
|
||||
* 监护人出生日期
|
||||
*/
|
||||
@Excel(name = "监护人出生日期", width = 20, format = "yyyy-MM-dd HH:mm:ss")
|
||||
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd")
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd")
|
||||
@ApiModelProperty(value = "出生日期")
|
||||
private java.util.Date guardianDateOfBirth;
|
||||
/**
|
||||
* 监护人家庭住址
|
||||
*/
|
||||
@Excel(name = "监护人家庭住址", width = 15)
|
||||
@ApiModelProperty(value = "监护人家庭住址")
|
||||
private java.lang.String guardianHomeAddress;
|
||||
/**
|
||||
* 监护人工作单位
|
||||
*/
|
||||
@Excel(name = "监护人工作单位", width = 15)
|
||||
@ApiModelProperty(value = "监护人工作单位")
|
||||
private java.lang.String guardianWorkUnit;
|
||||
/**
|
||||
* 家庭住址
|
||||
*/
|
||||
@Excel(name = "家庭住址", width = 15)
|
||||
@ApiModelProperty(value = "家庭住址")
|
||||
private java.lang.String homeAddress;
|
||||
/**
|
||||
* 是否删除 0未删除 1删除
|
||||
*/
|
||||
@Excel(name = "是否删除 0未删除 1删除", width = 15)
|
||||
@ApiModelProperty(value = "是否删除 0未删除 1删除")
|
||||
@TableLogic
|
||||
private java.lang.String delFlag;
|
||||
/**
|
||||
* 创建人
|
||||
*/
|
||||
@ApiModelProperty(value = "创建人")
|
||||
private java.lang.String createBy;
|
||||
/**
|
||||
* 创建日期
|
||||
*/
|
||||
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@ApiModelProperty(value = "创建日期")
|
||||
private java.util.Date createTime;
|
||||
/**
|
||||
* 更新人
|
||||
*/
|
||||
@ApiModelProperty(value = "更新人")
|
||||
private java.lang.String updateBy;
|
||||
/**
|
||||
* 更新日期
|
||||
*/
|
||||
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@ApiModelProperty(value = "更新日期")
|
||||
private java.util.Date updateTime;
|
||||
/**
|
||||
* 所属部门
|
||||
*/
|
||||
@ApiModelProperty(value = "所属部门")
|
||||
private java.lang.String sysOrgCode;
|
||||
|
||||
/**
|
||||
* 签发机关
|
||||
*/
|
||||
private java.lang.String issuingAuthority;
|
||||
/**
|
||||
* 有效开始日期
|
||||
*/
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd")
|
||||
private java.util.Date startTime;
|
||||
/**
|
||||
* 有效结束日期
|
||||
*/
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd")
|
||||
private java.util.Date endTime;
|
||||
/**
|
||||
* 发卡日期
|
||||
*/
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd")
|
||||
private java.util.Date cardIssuing;
|
||||
/**
|
||||
* 血型
|
||||
*/
|
||||
private java.lang.String bloodType;
|
||||
/**
|
||||
* 兵役状况
|
||||
*/
|
||||
private java.lang.String militaryType;
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,14 @@
|
|||
package com.nu.modules.elderinfo.mapper;
|
||||
|
||||
import com.nu.modules.elderinfo.entity.ElderInfo;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
|
||||
/**
|
||||
* @Description: 长者信息
|
||||
* @Author: jeecg-boot
|
||||
* @Date: 2025-04-11
|
||||
* @Version: V1.0
|
||||
*/
|
||||
public interface ElderInfoMapper extends BaseMapper<ElderInfo> {
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,5 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.nu.modules.elderinfo.mapper.ElderInfoMapper">
|
||||
|
||||
</mapper>
|
||||
|
|
@ -0,0 +1,17 @@
|
|||
package com.nu.modules.elderinfo.service;
|
||||
|
||||
import com.nu.modules.elderinfo.entity.ElderInfo;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
|
||||
/**
|
||||
* @Description: 长者信息
|
||||
* @Author: jeecg-boot
|
||||
* @Date: 2025-04-11
|
||||
* @Version: V1.0
|
||||
*/
|
||||
public interface IElderInfoService extends IService<ElderInfo> {
|
||||
|
||||
void editNu(ElderInfo nuBizCustomerInfo);
|
||||
|
||||
void editTuizhu(ElderInfo nuBizCustomerInfo);
|
||||
}
|
||||
|
|
@ -0,0 +1,67 @@
|
|||
package com.nu.modules.elderinfo.service.impl;
|
||||
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
|
||||
import com.nu.entity.ElderInfoEntity;
|
||||
import com.nu.modules.elder.api.IElderInfoApi;
|
||||
import com.nu.modules.elderinfo.entity.ElderInfo;
|
||||
import com.nu.modules.elderinfo.mapper.ElderInfoMapper;
|
||||
import com.nu.modules.elderinfo.service.IElderInfoService;
|
||||
import com.nu.modules.nubaseinfo.api.INuBaseInfoApi;
|
||||
import org.apache.shiro.SecurityUtils;
|
||||
import org.jeecg.common.system.vo.LoginUser;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Description: 长者信息
|
||||
* @Author: jeecg-boot
|
||||
* @Date: 2025-04-11
|
||||
* @Version: V1.0
|
||||
*/
|
||||
@Service
|
||||
public class ElderInfoServiceImpl extends ServiceImpl<ElderInfoMapper, ElderInfo> implements IElderInfoService, IElderInfoApi {
|
||||
@Autowired
|
||||
private INuBaseInfoApi nuBaseInfoApi;
|
||||
|
||||
@Override
|
||||
public void editNu(ElderInfo nuBizCustomerInfo) {
|
||||
ElderInfo nuBizCustomerInfo1 = baseMapper.selectById(nuBizCustomerInfo.getId());
|
||||
//修改原来护理单元状态
|
||||
LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
|
||||
nuBaseInfoApi.updateData(null, "0", sysUser, nuBizCustomerInfo1.getNuId());
|
||||
//修改新的护理单元状态
|
||||
nuBaseInfoApi.updateData(nuBizCustomerInfo.getId(), "1", sysUser, nuBizCustomerInfo.getNuId());
|
||||
//修改长者护理单元
|
||||
baseMapper.updateById(nuBizCustomerInfo);
|
||||
//添加调整护理单元日志 todo
|
||||
}
|
||||
|
||||
@Override
|
||||
public void editTuizhu(ElderInfo nuBizCustomerInfo) {
|
||||
ElderInfo nuBizCustomerInfo1 = baseMapper.selectById(nuBizCustomerInfo.getId());
|
||||
//修改原来护理单元状态
|
||||
LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
|
||||
nuBaseInfoApi.updateData(null, "0", sysUser, nuBizCustomerInfo1.getNuId());
|
||||
//修改长者护理单元
|
||||
UpdateWrapper<ElderInfo> updateTzWrapper = new UpdateWrapper();
|
||||
updateTzWrapper.set("nu_id", null);
|
||||
updateTzWrapper.set("current_state", "3");
|
||||
updateTzWrapper.eq("id", nuBizCustomerInfo.getId());
|
||||
baseMapper.update(null, updateTzWrapper);
|
||||
//添加调整护理单元日志 todo
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<ElderInfoEntity> selectCurrentState3() {
|
||||
List<ElderInfo> elderInfos = baseMapper.selectList(new QueryWrapper<ElderInfo>().lambda().ne(ElderInfo::getCurrentState, "3"));
|
||||
return BeanUtil.copyToList(elderInfos, ElderInfoEntity.class);
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,13 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<parent>
|
||||
<groupId>com.nursingunit.boot</groupId>
|
||||
<artifactId>nu-employee-api</artifactId>
|
||||
<version>2.0.0</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<artifactId>nu-employee-local-api</artifactId>
|
||||
|
||||
</project>
|
||||
|
|
@ -0,0 +1,24 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<parent>
|
||||
<groupId>com.nursingunit.boot</groupId>
|
||||
<artifactId>nursing-unit-employee</artifactId>
|
||||
<version>2.0.0</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<artifactId>nu-employee-api</artifactId>
|
||||
<packaging>pom</packaging>
|
||||
|
||||
<modules>
|
||||
<module>nu-employee-local-api</module>
|
||||
</modules>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>com.nursingunit.boot</groupId>
|
||||
<artifactId>nursing-unit-base-core</artifactId>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</project>
|
||||
|
|
@ -0,0 +1,51 @@
|
|||
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<parent>
|
||||
<groupId>com.nursingunit.boot</groupId>
|
||||
<artifactId>nursing-unit-employee</artifactId>
|
||||
<version>2.0.0</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<artifactId>nu-employee-biz</artifactId>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>com.nursingunit.boot</groupId>
|
||||
<artifactId>nu-employee-local-api</artifactId>
|
||||
<version>${nursingunit.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.hibernate</groupId>
|
||||
<artifactId>hibernate-core</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.jeecgframework.boot</groupId>
|
||||
<artifactId>hibernate-re</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- 企业微信/钉钉 api -->
|
||||
<dependency>
|
||||
<groupId>org.jeecgframework</groupId>
|
||||
<artifactId>weixin4j</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.nursingunit.boot</groupId>
|
||||
<artifactId>nursing-unit-common</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.nursingunit.boot</groupId>
|
||||
<artifactId>nu-system-local-api</artifactId>
|
||||
<version>2.0.0</version>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.nursingunit.boot</groupId>
|
||||
<artifactId>nu-admin-local-api</artifactId>
|
||||
<version>2.0.0</version>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
|
||||
</dependencies>
|
||||
|
||||
</project>
|
||||
|
|
@ -1,13 +1,9 @@
|
|||
package com.nu.modules.employeesInfo.controller;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.stream.Collectors;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import com.google.common.collect.Maps;
|
||||
import org.jeecg.common.api.vo.Result;
|
||||
import org.jeecg.common.system.query.QueryGenerator;
|
||||
import com.nu.modules.employeesInfo.entity.BizEmployeesInfo;
|
||||
|
|
@ -33,6 +33,8 @@ public class BizEmployeesInfo implements Serializable {
|
|||
@TableId(type = IdType.ASSIGN_ID)
|
||||
@ApiModelProperty(value = "id")
|
||||
private java.lang.String id;
|
||||
/**openId*/
|
||||
private java.lang.String openId;
|
||||
/**姓名*/
|
||||
@Excel(name = "姓名", width = 15)
|
||||
@ApiModelProperty(value = "姓名")
|
||||
|
|
@ -1,8 +1,8 @@
|
|||
package com.nu.modules.employeesapply.controller;
|
||||
|
||||
import cn.hutool.core.util.IdUtil;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.nu.dto.EmployeesApplyMQDto;
|
||||
|
|
@ -115,27 +115,18 @@ public class EmployeesApplyController extends JeecgController<EmployeesApply, IE
|
|||
}
|
||||
employeesApplyService.updateById(employeesApply);
|
||||
if (StringUtils.isNotBlank(employeesApply.getStatusVal())) {
|
||||
Date entryTime = new Date();//入职时间
|
||||
|
||||
//通知管理平台修改此人申请结果
|
||||
JSONObject deptInfo = sysBaseAPI.getDeptInfo();
|
||||
EmployeesStatusMQDto mqdto = new EmployeesStatusMQDto();
|
||||
mqdto.setEmployeeId(employeesApply.getEmployeeId());//员工id
|
||||
mqdto.setOrgCode(deptInfo.getString("code"));//机构编码
|
||||
mqdto.setAuditStatus(employeesApply.getStatus());//审批状态
|
||||
mqdto.setAuditContent(employeesApply.getAuditContent());//审批备注
|
||||
if ("auditPass".equals(employeesApply.getStatusVal())) {
|
||||
mqdto.setEntryTime(entryTime);//入驻时间
|
||||
}
|
||||
rabbitMQUtil.sendToExchange("hldy.employees", "hldy.employeesorg.auditstatus.sync", mqdto);
|
||||
//入职时间
|
||||
Date entryTime = new Date();
|
||||
|
||||
//审批通过后将员工信息插入到员工表中
|
||||
BizEmployeesInfo employeesInfo = new BizEmployeesInfo();
|
||||
if ("auditPass".equals(employeesApply.getStatusVal())) {
|
||||
QueryWrapper<BizEmployeesInfo> qw = new QueryWrapper<>();
|
||||
qw.eq("id", employeesApply.getEmployeeId());
|
||||
BizEmployeesInfo one = employeesInfoService.getOne(qw);
|
||||
if (one == null) {
|
||||
BizEmployeesInfo employeesInfo = new BizEmployeesInfo();
|
||||
BeanUtils.copyProperties(employeesApply, employeesInfo);
|
||||
employeesInfo.setId(employeesApply.getEmployeeId());
|
||||
employeesInfo.setSysOrgCode(deptInfo.getString("code"));
|
||||
|
|
@ -143,6 +134,19 @@ public class EmployeesApplyController extends JeecgController<EmployeesApply, IE
|
|||
employeesInfoService.save(employeesInfo);
|
||||
}
|
||||
}
|
||||
|
||||
//通知管理平台修改此人申请结果
|
||||
EmployeesStatusMQDto mqdto = new EmployeesStatusMQDto();
|
||||
mqdto.setEmployeeId(employeesApply.getEmployeeId());//员工id
|
||||
mqdto.setOrgCode(deptInfo.getString("code"));//机构编码
|
||||
mqdto.setAuditStatus(employeesApply.getStatus());//审批状态
|
||||
mqdto.setAuditContent(employeesApply.getAuditContent());//审批备注
|
||||
mqdto.setOpenId(employeesApply.getOpenId());//openId
|
||||
if ("auditPass".equals(employeesApply.getStatusVal())) {
|
||||
mqdto.setEntryTime(entryTime);//入驻时间
|
||||
}
|
||||
rabbitMQUtil.sendToExchange("hldy.employees", "hldy.employeesorg.auditstatus.sync", mqdto);
|
||||
|
||||
}
|
||||
|
||||
return Result.OK("编辑成功!");
|
||||
|
|
@ -232,17 +236,26 @@ public class EmployeesApplyController extends JeecgController<EmployeesApply, IE
|
|||
public Result<String> invide(@RequestBody EmployeesApply employeesApply) {
|
||||
//先查下员工在机构负责人停留界面期间是否进行了申请
|
||||
QueryWrapper<EmployeesApply> qw = new QueryWrapper<>();
|
||||
qw.eq("employee_id",employeesApply.getEmployeeId());
|
||||
qw.eq("iz_history","1");
|
||||
qw.eq("status","1");
|
||||
qw.eq("employee_id", employeesApply.getEmployeeId());
|
||||
qw.eq("iz_history", "1");
|
||||
qw.eq("status", "1");
|
||||
qw.eq("is_invited", "1");
|
||||
EmployeesApply one = employeesApplyService.getOne(qw);
|
||||
if(one !=null){
|
||||
if (one != null) {
|
||||
return Result.error("员工已申请加入机构,请在审核管理中进行审批");
|
||||
}
|
||||
|
||||
JSONObject deptInfo = sysBaseAPI.getDeptInfo();
|
||||
String orgCode = deptInfo.getString("code");
|
||||
|
||||
//将旧的申请信息都置为历史状态
|
||||
EmployeesApply updto = new EmployeesApply();
|
||||
updto.setIzHistory("0");
|
||||
UpdateWrapper<EmployeesApply> uw = new UpdateWrapper<>();
|
||||
uw.eq("employee_id", employeesApply.getEmployeeId());
|
||||
employeesApplyService.update(updto, uw);
|
||||
|
||||
//新增数据
|
||||
employeesApply.setId(null);
|
||||
employeesApply.setEmployeeId(employeesApply.getEmployeeId());
|
||||
employeesApply.setStatus("1");
|
||||
|
|
@ -256,6 +269,7 @@ public class EmployeesApplyController extends JeecgController<EmployeesApply, IE
|
|||
BeanUtils.copyProperties(employeesApply, mqdto);
|
||||
mqdto.setOrgCode(orgCode);
|
||||
rabbitMQUtil.sendToExchange("hldy.employees", "hldy.employees.invide", mqdto);
|
||||
|
||||
return Result.OK("邀请成功!");
|
||||
}
|
||||
}
|
||||
|
|
@ -36,6 +36,9 @@ public class EmployeesApply implements Serializable {
|
|||
@TableId(type = IdType.ASSIGN_ID)
|
||||
@ApiModelProperty(value = "id")
|
||||
private java.lang.String id;
|
||||
/**openId*/
|
||||
@ApiModelProperty(value = "openId")
|
||||
private String openId;
|
||||
/**员工id*/
|
||||
@ApiModelProperty(value = "员工id")
|
||||
private java.lang.String employeeId;
|
||||
|
|
@ -198,7 +201,5 @@ public class EmployeesApply implements Serializable {
|
|||
*/
|
||||
@TableField(exist = false)
|
||||
private String statusVal;
|
||||
/**openId*/
|
||||
@TableField(exist = false)
|
||||
private String openId;
|
||||
|
||||
}
|
||||
|
|
@ -1,7 +1,5 @@
|
|||
package com.nu.modules.employeesapply.mapper;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import com.nu.modules.employeesapply.entity.EmployeesApply;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
|
|
@ -0,0 +1,163 @@
|
|||
package com.nu.modules.employeesmedia.controller;
|
||||
|
||||
import java.util.Arrays;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import org.jeecg.common.api.vo.Result;
|
||||
import org.jeecg.common.system.query.QueryGenerator;
|
||||
import com.nu.modules.employeesmedia.entity.BizEmployeesMedia;
|
||||
import com.nu.modules.employeesmedia.service.IBizEmployeesMediaService;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
import org.jeecg.common.system.base.controller.JeecgController;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.web.servlet.ModelAndView;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.jeecg.common.aspect.annotation.AutoLog;
|
||||
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||
|
||||
/**
|
||||
* @Description: 记录获取过哪些员工的证件
|
||||
* @Author: jeecg-boot
|
||||
* @Date: 2025-09-12
|
||||
* @Version: V1.0
|
||||
*/
|
||||
@Api(tags="记录获取过哪些员工的证件")
|
||||
@RestController
|
||||
@RequestMapping("/employeesmedia/bizEmployeesMedia")
|
||||
@Slf4j
|
||||
public class BizEmployeesMediaController extends JeecgController<BizEmployeesMedia, IBizEmployeesMediaService> {
|
||||
@Autowired
|
||||
private IBizEmployeesMediaService bizEmployeesMediaService;
|
||||
|
||||
/**
|
||||
* 分页列表查询
|
||||
*
|
||||
* @param bizEmployeesMedia
|
||||
* @param pageNo
|
||||
* @param pageSize
|
||||
* @param req
|
||||
* @return
|
||||
*/
|
||||
//@AutoLog(value = "记录获取过哪些员工的证件-分页列表查询")
|
||||
@ApiOperation(value="记录获取过哪些员工的证件-分页列表查询", notes="记录获取过哪些员工的证件-分页列表查询")
|
||||
@GetMapping(value = "/list")
|
||||
public Result<IPage<BizEmployeesMedia>> queryPageList(BizEmployeesMedia bizEmployeesMedia,
|
||||
@RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
|
||||
@RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
|
||||
HttpServletRequest req) {
|
||||
QueryWrapper<BizEmployeesMedia> queryWrapper = QueryGenerator.initQueryWrapper(bizEmployeesMedia, req.getParameterMap());
|
||||
Page<BizEmployeesMedia> page = new Page<BizEmployeesMedia>(pageNo, pageSize);
|
||||
IPage<BizEmployeesMedia> pageList = bizEmployeesMediaService.page(page, queryWrapper);
|
||||
return Result.OK(pageList);
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加
|
||||
*
|
||||
* @param bizEmployeesMedia
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "记录获取过哪些员工的证件-添加")
|
||||
@ApiOperation(value="记录获取过哪些员工的证件-添加", notes="记录获取过哪些员工的证件-添加")
|
||||
@RequiresPermissions("employeesmedia:nu_biz_employees_media:add")
|
||||
@PostMapping(value = "/add")
|
||||
public Result<String> add(@RequestBody BizEmployeesMedia bizEmployeesMedia) {
|
||||
bizEmployeesMediaService.save(bizEmployeesMedia);
|
||||
return Result.OK("添加成功!");
|
||||
}
|
||||
|
||||
/**
|
||||
* 编辑
|
||||
*
|
||||
* @param bizEmployeesMedia
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "记录获取过哪些员工的证件-编辑")
|
||||
@ApiOperation(value="记录获取过哪些员工的证件-编辑", notes="记录获取过哪些员工的证件-编辑")
|
||||
@RequiresPermissions("employeesmedia:nu_biz_employees_media:edit")
|
||||
@RequestMapping(value = "/edit", method = {RequestMethod.PUT,RequestMethod.POST})
|
||||
public Result<String> edit(@RequestBody BizEmployeesMedia bizEmployeesMedia) {
|
||||
bizEmployeesMediaService.updateById(bizEmployeesMedia);
|
||||
return Result.OK("编辑成功!");
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过id删除
|
||||
*
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "记录获取过哪些员工的证件-通过id删除")
|
||||
@ApiOperation(value="记录获取过哪些员工的证件-通过id删除", notes="记录获取过哪些员工的证件-通过id删除")
|
||||
@RequiresPermissions("employeesmedia:nu_biz_employees_media:delete")
|
||||
@DeleteMapping(value = "/delete")
|
||||
public Result<String> delete(@RequestParam(name="id",required=true) String id) {
|
||||
bizEmployeesMediaService.removeById(id);
|
||||
return Result.OK("删除成功!");
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除
|
||||
*
|
||||
* @param ids
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "记录获取过哪些员工的证件-批量删除")
|
||||
@ApiOperation(value="记录获取过哪些员工的证件-批量删除", notes="记录获取过哪些员工的证件-批量删除")
|
||||
@RequiresPermissions("employeesmedia:nu_biz_employees_media:deleteBatch")
|
||||
@DeleteMapping(value = "/deleteBatch")
|
||||
public Result<String> deleteBatch(@RequestParam(name="ids",required=true) String ids) {
|
||||
this.bizEmployeesMediaService.removeByIds(Arrays.asList(ids.split(",")));
|
||||
return Result.OK("批量删除成功!");
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过id查询
|
||||
*
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
//@AutoLog(value = "记录获取过哪些员工的证件-通过id查询")
|
||||
@ApiOperation(value="记录获取过哪些员工的证件-通过id查询", notes="记录获取过哪些员工的证件-通过id查询")
|
||||
@GetMapping(value = "/queryById")
|
||||
public Result<BizEmployeesMedia> queryById(@RequestParam(name="id",required=true) String id) {
|
||||
BizEmployeesMedia bizEmployeesMedia = bizEmployeesMediaService.getById(id);
|
||||
if(bizEmployeesMedia==null) {
|
||||
return Result.error("未找到对应数据");
|
||||
}
|
||||
return Result.OK(bizEmployeesMedia);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出excel
|
||||
*
|
||||
* @param request
|
||||
* @param bizEmployeesMedia
|
||||
*/
|
||||
@RequiresPermissions("employeesmedia:nu_biz_employees_media:exportXls")
|
||||
@RequestMapping(value = "/exportXls")
|
||||
public ModelAndView exportXls(HttpServletRequest request, BizEmployeesMedia bizEmployeesMedia) {
|
||||
return super.exportXls(request, bizEmployeesMedia, BizEmployeesMedia.class, "记录获取过哪些员工的证件");
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过excel导入数据
|
||||
*
|
||||
* @param request
|
||||
* @param response
|
||||
* @return
|
||||
*/
|
||||
@RequiresPermissions("employeesmedia:nu_biz_employees_media:importExcel")
|
||||
@RequestMapping(value = "/importExcel", method = RequestMethod.POST)
|
||||
public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) {
|
||||
return super.importExcel(request, response, BizEmployeesMedia.class);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,53 @@
|
|||
package com.nu.modules.employeesmedia.entity;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.io.UnsupportedEncodingException;
|
||||
import java.util.Date;
|
||||
import java.math.BigDecimal;
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.baomidou.mybatisplus.annotation.TableLogic;
|
||||
import org.jeecg.common.constant.ProvinceCityArea;
|
||||
import org.jeecg.common.util.SpringContextUtils;
|
||||
import lombok.Data;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
import org.jeecgframework.poi.excel.annotation.Excel;
|
||||
import org.jeecg.common.aspect.annotation.Dict;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
/**
|
||||
* @Description: 记录获取过哪些员工的证件
|
||||
* @Author: jeecg-boot
|
||||
* @Date: 2025-09-12
|
||||
* @Version: V1.0
|
||||
*/
|
||||
@Data
|
||||
@TableName("nu_biz_employees_media")
|
||||
@Accessors(chain = true)
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@ApiModel(value="nu_biz_employees_media对象", description="记录获取过哪些员工的证件")
|
||||
public class BizEmployeesMedia implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**id*/
|
||||
@TableId(type = IdType.ASSIGN_ID)
|
||||
@ApiModelProperty(value = "id")
|
||||
private java.lang.String id;
|
||||
/**employeesId*/
|
||||
@Excel(name = "employeesId", width = 15)
|
||||
@ApiModelProperty(value = "employeesId")
|
||||
private java.lang.String employeesId;
|
||||
/**身份证正面 0未获取 1已获取*/
|
||||
@Excel(name = "身份证正面 0未获取 1已获取", width = 15)
|
||||
@ApiModelProperty(value = "身份证正面 0未获取 1已获取")
|
||||
private java.lang.String cardZmPath;
|
||||
/**身份证反面 0未获取 1已获取*/
|
||||
@Excel(name = "身份证反面 0未获取 1已获取", width = 15)
|
||||
@ApiModelProperty(value = "身份证反面 0未获取 1已获取")
|
||||
private java.lang.String cardFmPath;
|
||||
}
|
||||
|
|
@ -0,0 +1,18 @@
|
|||
package com.nu.modules.employeesmedia.mapper;
|
||||
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import com.nu.modules.employeesmedia.entity.BizEmployeesMedia;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
|
||||
/**
|
||||
* @Description: 记录获取过哪些员工的证件
|
||||
* @Author: jeecg-boot
|
||||
* @Date: 2025-09-12
|
||||
* @Version: V1.0
|
||||
*/
|
||||
public interface BizEmployeesMediaMapper extends BaseMapper<BizEmployeesMedia> {
|
||||
|
||||
void updateCardZmPath(@Param("dto") BizEmployeesMedia dto);
|
||||
|
||||
void updateCardFmPath(@Param("dto") BizEmployeesMedia dto);
|
||||
}
|
||||
|
|
@ -0,0 +1,12 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.nu.modules.employeesmedia.mapper.BizEmployeesMediaMapper">
|
||||
|
||||
<update id="updateCardZmPath">
|
||||
update nu_biz_employees_media set card_zm_path = null where id = #{dto.id}
|
||||
</update>
|
||||
|
||||
<update id="updateCardFmPath">
|
||||
update nu_biz_employees_media set card_fm_path = null where id = #{dto.id}
|
||||
</update>
|
||||
</mapper>
|
||||
|
|
@ -0,0 +1,15 @@
|
|||
package com.nu.modules.employeesmedia.service;
|
||||
|
||||
import com.nu.modules.employeesmedia.entity.BizEmployeesMedia;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
|
||||
/**
|
||||
* @Description: 记录获取过哪些员工的证件
|
||||
* @Author: jeecg-boot
|
||||
* @Date: 2025-09-12
|
||||
* @Version: V1.0
|
||||
*/
|
||||
public interface IBizEmployeesMediaService extends IService<BizEmployeesMedia> {
|
||||
|
||||
void updateMedia(BizEmployeesMedia data);
|
||||
}
|
||||
|
|
@ -0,0 +1,30 @@
|
|||
package com.nu.modules.employeesmedia.service.impl;
|
||||
|
||||
import com.nu.modules.employeesmedia.entity.BizEmployeesMedia;
|
||||
import com.nu.modules.employeesmedia.mapper.BizEmployeesMediaMapper;
|
||||
import com.nu.modules.employeesmedia.service.IBizEmployeesMediaService;
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
|
||||
/**
|
||||
* @Description: 记录获取过哪些员工的证件
|
||||
* @Author: jeecg-boot
|
||||
* @Date: 2025-09-12
|
||||
* @Version: V1.0
|
||||
*/
|
||||
@Service
|
||||
public class BizEmployeesMediaServiceImpl extends ServiceImpl<BizEmployeesMediaMapper, BizEmployeesMedia> implements IBizEmployeesMediaService {
|
||||
|
||||
@Override
|
||||
public void updateMedia(BizEmployeesMedia data) {
|
||||
if(StringUtils.isBlank(data.getCardZmPath())){
|
||||
baseMapper.updateCardZmPath(data);
|
||||
}
|
||||
if(StringUtils.isBlank(data.getCardFmPath())){
|
||||
baseMapper.updateCardFmPath(data);
|
||||
}
|
||||
baseMapper.updateById(data);
|
||||
}
|
||||
}
|
||||
|
|
@ -1,17 +1,17 @@
|
|||
package com.nu.modules.employessadvisiory.controller;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import com.baomidou.dynamic.datasource.annotation.DS;
|
||||
import com.baomidou.dynamic.datasource.toolkit.DynamicDataSourceContextHolder;
|
||||
import com.nu.modules.employeesInfo.entity.BizEmployeesInfo;
|
||||
import com.nu.modules.employeesInfo.service.IBizEmployeesInfoService;
|
||||
import com.nu.modules.employeesapply.entity.EmployeesApply;
|
||||
import com.nu.modules.employeesapply.service.IEmployeesApplyService;
|
||||
import com.nu.modules.employeesmedia.entity.BizEmployeesMedia;
|
||||
import com.nu.modules.employeesmedia.service.IBizEmployeesMediaService;
|
||||
import org.jeecg.common.api.vo.Result;
|
||||
import org.jeecg.common.system.query.QueryGenerator;
|
||||
import com.nu.modules.employessadvisiory.entity.NuEmployeesAdvisoryInfo;
|
||||
|
|
@ -48,6 +48,8 @@ public class NuEmployeesAdvisoryInfoController extends JeecgController<NuEmploye
|
|||
private IBizEmployeesInfoService bizEmployeesInfoService;
|
||||
@Autowired
|
||||
private IEmployeesApplyService employeesApplyService;
|
||||
@Autowired
|
||||
private IBizEmployeesMediaService employeesMediaService;
|
||||
|
||||
/**
|
||||
* 分页列表查询
|
||||
|
|
@ -75,6 +77,8 @@ public class NuEmployeesAdvisoryInfoController extends JeecgController<NuEmploye
|
|||
.collect(Collectors.toList());
|
||||
|
||||
QueryWrapper<EmployeesApply> qw2 = new QueryWrapper<EmployeesApply>();
|
||||
qw2.eq("iz_history", "1");
|
||||
qw2.eq("status", "1");
|
||||
List<EmployeesApply> list2 = employeesApplyService.list(qw2);
|
||||
List<String> ids2 = list2.stream()
|
||||
.map(EmployeesApply::getEmployeeId)
|
||||
|
|
@ -95,6 +99,36 @@ public class NuEmployeesAdvisoryInfoController extends JeecgController<NuEmploye
|
|||
}
|
||||
IPage<NuEmployeesAdvisoryInfo> pageList = nuEmployeesAdvisoryInfoService.page(page, queryWrapper);
|
||||
DynamicDataSourceContextHolder.clear();
|
||||
|
||||
List<NuEmployeesAdvisoryInfo> records = pageList.getRecords();
|
||||
if (records != null && records.size() > 0) {
|
||||
Map<String, Integer> idToIndexMap = new HashMap<>();
|
||||
List<String> employeesIds = new ArrayList<>();
|
||||
|
||||
for (int i = 0; i < records.size(); i++) {
|
||||
NuEmployeesAdvisoryInfo record = records.get(i);
|
||||
String id = record.getId();
|
||||
|
||||
// 添加到 Map: id -> 索引
|
||||
idToIndexMap.put(id, i);
|
||||
|
||||
// 添加到 List: id 转为 String
|
||||
employeesIds.add(id);
|
||||
}
|
||||
|
||||
//获取员工身份证是否下载标识
|
||||
QueryWrapper<BizEmployeesMedia> qw = new QueryWrapper<>();
|
||||
qw.in("employees_id", employeesIds);
|
||||
List<BizEmployeesMedia> list = employeesMediaService.list(qw);
|
||||
for (int i = 0; i < list.size(); i++) {
|
||||
Integer index = idToIndexMap.get(list.get(i).getEmployeesId());
|
||||
if(index!=null){
|
||||
records.get(index).setHasCardZmPath(list.get(i).getCardZmPath());//是否有身份证正面
|
||||
records.get(index).setHasCardFmPath(list.get(i).getCardFmPath());//是否有身份证反面
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
return Result.OK(pageList);
|
||||
}
|
||||
|
||||
|
|
@ -198,4 +232,12 @@ public class NuEmployeesAdvisoryInfoController extends JeecgController<NuEmploye
|
|||
return super.importExcel(request, response, NuEmployeesAdvisoryInfo.class);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取身份证资源
|
||||
*/
|
||||
@PostMapping(value = "/acquireIdenCard")
|
||||
public Result<?> acquireIdenCard(@RequestBody NuEmployeesAdvisoryInfo nuEmployeesAdvisoryInfo) {
|
||||
nuEmployeesAdvisoryInfoService.acquireIdenCard(nuEmployeesAdvisoryInfo);
|
||||
return Result.OK("已开始获取!");
|
||||
}
|
||||
}
|
||||
|
|
@ -3,6 +3,7 @@ package com.nu.modules.employessadvisiory.entity;
|
|||
import java.io.Serializable;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import lombok.Data;
|
||||
|
|
@ -192,4 +193,12 @@ public class NuEmployeesAdvisoryInfo implements Serializable {
|
|||
@Excel(name = "无犯罪正面", width = 15)
|
||||
@ApiModelProperty(value = "无犯罪正面")
|
||||
private java.lang.String noCrimeCertificate;
|
||||
|
||||
//是否有身份证正面
|
||||
@TableField(exist = false)
|
||||
private String hasCardZmPath;
|
||||
//是否有身份证反面
|
||||
@TableField(exist = false)
|
||||
private String hasCardFmPath;
|
||||
|
||||
}
|
||||
|
|
@ -11,4 +11,5 @@ import com.baomidou.mybatisplus.extension.service.IService;
|
|||
*/
|
||||
public interface INuEmployeesAdvisoryInfoService extends IService<NuEmployeesAdvisoryInfo> {
|
||||
|
||||
void acquireIdenCard(NuEmployeesAdvisoryInfo nuEmployeesAdvisoryInfo);
|
||||
}
|
||||
|
|
@ -0,0 +1,122 @@
|
|||
package com.nu.modules.employessadvisiory.service.impl;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.nu.modules.employeesmedia.entity.BizEmployeesMedia;
|
||||
import com.nu.modules.employeesmedia.service.IBizEmployeesMediaService;
|
||||
import com.nu.modules.employessadvisiory.entity.NuEmployeesAdvisoryInfo;
|
||||
import com.nu.modules.employessadvisiory.mapper.NuEmployeesAdvisoryInfoMapper;
|
||||
import com.nu.modules.employessadvisiory.service.INuEmployeesAdvisoryInfoService;
|
||||
import com.nu.modules.mediaasyncerrorlog.entity.MediaAsyncErrorLog;
|
||||
import com.nu.modules.mediaasyncerrorlog.service.IMediaAsyncErrorLogService;
|
||||
import com.nu.modules.sysconfig.ISysConfigApi;
|
||||
import com.nu.utils.FileDownloader;
|
||||
import com.nu.utils.SafetyUtil;
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.io.File;
|
||||
import java.net.URLEncoder;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
|
||||
/**
|
||||
* @Description: 员工咨询信息
|
||||
* @Author: jeecg-boot
|
||||
* @Date: 2025-06-09
|
||||
* @Version: V1.0
|
||||
*/
|
||||
@Service
|
||||
public class NuEmployeesAdvisoryInfoServiceImpl extends ServiceImpl<NuEmployeesAdvisoryInfoMapper, NuEmployeesAdvisoryInfo> implements INuEmployeesAdvisoryInfoService {
|
||||
|
||||
@Autowired
|
||||
private ISysConfigApi sysConfigApi;
|
||||
@Value("${jeecg.path.upload}")
|
||||
private String upLoadPath;
|
||||
@Autowired
|
||||
private IMediaAsyncErrorLogService mediaAsyncErrorLogService;
|
||||
@Autowired
|
||||
private IBizEmployeesMediaService employeesMediaService;
|
||||
|
||||
@Override
|
||||
public void acquireIdenCard(NuEmployeesAdvisoryInfo nuEmployeesAdvisoryInfo) {
|
||||
String idCardPositive = nuEmployeesAdvisoryInfo.getCardZmPath();
|
||||
String idCardNegative = nuEmployeesAdvisoryInfo.getCardFmPath();
|
||||
|
||||
BizEmployeesMedia data = new BizEmployeesMedia();
|
||||
data.setEmployeesId(nuEmployeesAdvisoryInfo.getId());
|
||||
data.setCardZmPath(StringUtils.isBlank(idCardPositive) ? "0" : "2");
|
||||
data.setCardFmPath(StringUtils.isBlank(idCardNegative) ? "0" : "2");
|
||||
employeesMediaService.save(data);
|
||||
new Thread(() -> {
|
||||
|
||||
try {
|
||||
JSONObject opeOpenUrl = sysConfigApi.getByKeyByDS("master", "ope_open_url");
|
||||
String baseUrl = opeOpenUrl.getString("configValue");
|
||||
if (baseUrl.endsWith("/")) {
|
||||
baseUrl = baseUrl.substring(0, baseUrl.length() - 1);
|
||||
}
|
||||
//身份证正面
|
||||
{
|
||||
if (StringUtils.isNotBlank(idCardPositive)) {
|
||||
if (StringUtils.isNotBlank(idCardPositive)) {
|
||||
String url = baseUrl + "/sys/common/open/static/" + URLEncoder.encode(idCardPositive, StandardCharsets.UTF_8).replace("%2F", "/") + "?name=" + SafetyUtil.getSecureKey();
|
||||
if (upLoadPath.endsWith("/") || upLoadPath.endsWith("\\")) {
|
||||
upLoadPath = upLoadPath.substring(0, upLoadPath.length() - 1);
|
||||
}
|
||||
String filePath = idCardPositive.substring(0, idCardPositive.lastIndexOf("/"));
|
||||
String fileName = idCardPositive.substring(idCardPositive.lastIndexOf("/") + 1);
|
||||
if (filePath.startsWith("/") || filePath.startsWith("\\")) {
|
||||
filePath = filePath.substring(1);
|
||||
}
|
||||
try {
|
||||
FileDownloader.downloadFile(url, upLoadPath + File.separator + filePath, fileName);
|
||||
data.setCardZmPath("1");
|
||||
} catch (Exception e) {
|
||||
data.setCardZmPath(null);
|
||||
e.printStackTrace();
|
||||
MediaAsyncErrorLog mediaAsyncErrorLog = new MediaAsyncErrorLog();
|
||||
mediaAsyncErrorLog.setMediaid(idCardPositive);
|
||||
mediaAsyncErrorLogService.save(mediaAsyncErrorLog);
|
||||
throw new RuntimeException("员工申请加入机构-身份证正面文件拉取错误,员工id" + nuEmployeesAdvisoryInfo.getIdCard());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
//身份证反面
|
||||
{
|
||||
if (StringUtils.isNotBlank(idCardNegative)) {
|
||||
if (StringUtils.isNotBlank(idCardNegative)) {
|
||||
String url = baseUrl + "/sys/common/open/static/" + URLEncoder.encode(idCardNegative, StandardCharsets.UTF_8).replace("%2F", "/") + "?name=" + SafetyUtil.getSecureKey();
|
||||
if (upLoadPath.endsWith("/") || upLoadPath.endsWith("\\")) {
|
||||
upLoadPath = upLoadPath.substring(0, upLoadPath.length() - 1);
|
||||
}
|
||||
String filePath = idCardNegative.substring(0, idCardNegative.lastIndexOf("/"));
|
||||
String fileName = idCardNegative.substring(idCardNegative.lastIndexOf("/") + 1);
|
||||
if (filePath.startsWith("/") || filePath.startsWith("\\")) {
|
||||
filePath = filePath.substring(1);
|
||||
}
|
||||
try {
|
||||
FileDownloader.downloadFile(url, upLoadPath + File.separator + filePath, fileName);
|
||||
data.setCardFmPath("1");
|
||||
} catch (Exception e) {
|
||||
data.setCardFmPath(null);
|
||||
e.printStackTrace();
|
||||
MediaAsyncErrorLog mediaAsyncErrorLog = new MediaAsyncErrorLog();
|
||||
mediaAsyncErrorLog.setMediaid(idCardNegative);
|
||||
mediaAsyncErrorLogService.save(mediaAsyncErrorLog);
|
||||
throw new RuntimeException("员工申请加入机构-身份证反面文件拉取错误,员工id" + nuEmployeesAdvisoryInfo.getIdCard());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
} catch (RuntimeException e) {
|
||||
e.printStackTrace();
|
||||
} finally {
|
||||
employeesMediaService.updateMedia(data);
|
||||
}
|
||||
|
||||
}).start();
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,637 @@
|
|||
package com.nu.mq.employees.listener;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
|
||||
import com.nu.dto.EmployeesApplyMQDto;
|
||||
import com.nu.modules.employeesInfo.entity.BizEmployeesInfo;
|
||||
import com.nu.modules.employeesInfo.service.IBizEmployeesInfoService;
|
||||
import com.nu.modules.employeesapply.entity.EmployeesApply;
|
||||
import com.nu.modules.employeesapply.service.IEmployeesApplyService;
|
||||
import com.nu.modules.mediaasyncerrorlog.entity.MediaAsyncErrorLog;
|
||||
import com.nu.modules.mediaasyncerrorlog.service.IMediaAsyncErrorLogService;
|
||||
import com.nu.modules.sysconfig.ISysConfigApi;
|
||||
import com.nu.utils.FileDownloader;
|
||||
import com.nu.utils.RabbitMQUtil;
|
||||
import com.nu.utils.SafetyUtil;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.springframework.amqp.core.ExchangeTypes;
|
||||
import org.springframework.amqp.rabbit.annotation.Exchange;
|
||||
import org.springframework.amqp.rabbit.annotation.Queue;
|
||||
import org.springframework.amqp.rabbit.annotation.QueueBinding;
|
||||
import org.springframework.amqp.rabbit.annotation.RabbitListener;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import java.io.File;
|
||||
import java.net.URLEncoder;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
@Slf4j
|
||||
@Component
|
||||
public class EmployeesMQListener {
|
||||
@Autowired
|
||||
private RabbitMQUtil rabbitMQUtil;
|
||||
@Autowired
|
||||
private IEmployeesApplyService employeesApplyService;
|
||||
@Autowired
|
||||
private IBizEmployeesInfoService employeesInfoService;
|
||||
@Autowired
|
||||
private ISysConfigApi sysConfigApi;
|
||||
@Value("${jeecg.path.upload}")
|
||||
private String upLoadPath;
|
||||
@Autowired
|
||||
private IMediaAsyncErrorLogService mediaAsyncErrorLogService;
|
||||
|
||||
/**
|
||||
* direct直连 只发给我的
|
||||
*
|
||||
* @param dto
|
||||
*/
|
||||
@RabbitListener(
|
||||
bindings = @QueueBinding(
|
||||
value = @Queue(name = "#{employeesAsyncDQNP.getQueueName()}"),
|
||||
exchange = @Exchange(name = "hldy.employees", type = ExchangeTypes.DIRECT),
|
||||
key = "#{employeesAsyncDQNP.getKeyName()}"
|
||||
),
|
||||
errorHandler = "employeesMQErrorHandler"
|
||||
)
|
||||
public void handleEmployeeApply(EmployeesApplyMQDto dto) {
|
||||
//将历史申请变更为历史状态
|
||||
EmployeesApply hisdto = new EmployeesApply();
|
||||
hisdto.setIzHistory("0");
|
||||
UpdateWrapper<EmployeesApply> uw = new UpdateWrapper<>();
|
||||
uw.eq("employee_id", dto.getEmployeeId());
|
||||
employeesApplyService.update(hisdto, uw);
|
||||
|
||||
EmployeesApply employeesApply = new EmployeesApply();
|
||||
BeanUtils.copyProperties(dto, employeesApply);
|
||||
employeesApply.setEmployeeId(dto.getEmployeeId());
|
||||
employeesApply.setId(dto.getId());
|
||||
employeesApply.setOpenId(dto.getOpenId());
|
||||
employeesApply.setStatus("1");
|
||||
employeesApply.setDelFlag("0");
|
||||
employeesApply.setIzHistory("1");
|
||||
employeesApply.setIsInvited("1");
|
||||
|
||||
//资源文件拉完图片统一存储,不然页面有路径没资源可显示
|
||||
String idCardPositive = employeesApply.getIdCardPositive();
|
||||
String idCardNegative = employeesApply.getIdCardNegative();
|
||||
String healthCertificatePositive = employeesApply.getHealthCertificatePositive();
|
||||
String healthCertificateNegative = employeesApply.getHealthCertificateNegative();
|
||||
String bankPositive = employeesApply.getBankPositive();
|
||||
String bankNegative = employeesApply.getBankNegative();
|
||||
String qualification = employeesApply.getQualification();
|
||||
String noCrimeCertificate = employeesApply.getNoCrimeCertificate();
|
||||
{
|
||||
employeesApply.setIdCardPositive(null);//身份证正面
|
||||
employeesApply.setIdCardNegative(null);//身份证反面
|
||||
employeesApply.setHealthCertificatePositive(null);//健康证正面
|
||||
employeesApply.setHealthCertificateNegative(null);//健康证反面
|
||||
employeesApply.setBankPositive(null);//银行卡正面
|
||||
employeesApply.setBankNegative(null);//银行卡反面
|
||||
employeesApply.setQualification(null);//资质证
|
||||
employeesApply.setNoCrimeCertificate(null);//无犯罪证明
|
||||
}
|
||||
employeesApplyService.save(employeesApply);
|
||||
|
||||
//去管理平台拉取资源
|
||||
{
|
||||
EmployeesApply mediaData = new EmployeesApply();
|
||||
mediaData.setId(employeesApply.getId());
|
||||
|
||||
JSONObject opeOpenUrl = sysConfigApi.getByKeyByDS("master", "ope_open_url");
|
||||
String baseUrl = opeOpenUrl.getString("configValue");
|
||||
if (baseUrl.endsWith("/")) {
|
||||
baseUrl = baseUrl.substring(0, baseUrl.length() - 1);
|
||||
}
|
||||
//身份证正面
|
||||
{
|
||||
if (StringUtils.isNotBlank(idCardPositive)) {
|
||||
if (StringUtils.isNotBlank(idCardPositive)) {
|
||||
String url = baseUrl + "/sys/common/open/static/" + URLEncoder.encode(idCardPositive, StandardCharsets.UTF_8).replace("%2F", "/") + "?name=" + SafetyUtil.getSecureKey();
|
||||
if (upLoadPath.endsWith("/") || upLoadPath.endsWith("\\")) {
|
||||
upLoadPath = upLoadPath.substring(0, upLoadPath.length() - 1);
|
||||
}
|
||||
String filePath = idCardPositive.substring(0, idCardPositive.lastIndexOf("/"));
|
||||
String fileName = idCardPositive.substring(idCardPositive.lastIndexOf("/") + 1);
|
||||
if (filePath.startsWith("/") || filePath.startsWith("\\")) {
|
||||
filePath = filePath.substring(1);
|
||||
}
|
||||
try {
|
||||
FileDownloader.downloadFile(url, upLoadPath + File.separator + filePath, fileName);
|
||||
mediaData.setIdCardPositive(idCardPositive);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
MediaAsyncErrorLog mediaAsyncErrorLog = new MediaAsyncErrorLog();
|
||||
mediaAsyncErrorLog.setMediaid(idCardPositive);
|
||||
mediaAsyncErrorLogService.save(mediaAsyncErrorLog);
|
||||
throw new RuntimeException("员工申请加入机构-身份证正面文件拉取错误,员工id" + dto.getEmployeeId());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
//身份证反面
|
||||
{
|
||||
if (StringUtils.isNotBlank(idCardNegative)) {
|
||||
if (StringUtils.isNotBlank(idCardNegative)) {
|
||||
String url = baseUrl + "/sys/common/open/static/" + URLEncoder.encode(idCardNegative, StandardCharsets.UTF_8).replace("%2F", "/") + "?name=" + SafetyUtil.getSecureKey();
|
||||
if (upLoadPath.endsWith("/") || upLoadPath.endsWith("\\")) {
|
||||
upLoadPath = upLoadPath.substring(0, upLoadPath.length() - 1);
|
||||
}
|
||||
String filePath = idCardNegative.substring(0, idCardNegative.lastIndexOf("/"));
|
||||
String fileName = idCardNegative.substring(idCardNegative.lastIndexOf("/") + 1);
|
||||
if (filePath.startsWith("/") || filePath.startsWith("\\")) {
|
||||
filePath = filePath.substring(1);
|
||||
}
|
||||
try {
|
||||
FileDownloader.downloadFile(url, upLoadPath + File.separator + filePath, fileName);
|
||||
mediaData.setIdCardNegative(idCardNegative);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
MediaAsyncErrorLog mediaAsyncErrorLog = new MediaAsyncErrorLog();
|
||||
mediaAsyncErrorLog.setMediaid(idCardNegative);
|
||||
mediaAsyncErrorLogService.save(mediaAsyncErrorLog);
|
||||
throw new RuntimeException("员工申请加入机构-身份证反面文件拉取错误,员工id" + dto.getEmployeeId());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
//健康证正面
|
||||
{
|
||||
if (StringUtils.isNotBlank(healthCertificatePositive)) {
|
||||
if (StringUtils.isNotBlank(healthCertificatePositive)) {
|
||||
String url = baseUrl + "/sys/common/open/static/" + URLEncoder.encode(healthCertificatePositive, StandardCharsets.UTF_8).replace("%2F", "/") + "?name=" + SafetyUtil.getSecureKey();
|
||||
if (upLoadPath.endsWith("/") || upLoadPath.endsWith("\\")) {
|
||||
upLoadPath = upLoadPath.substring(0, upLoadPath.length() - 1);
|
||||
}
|
||||
String filePath = healthCertificatePositive.substring(0, healthCertificatePositive.lastIndexOf("/"));
|
||||
String fileName = healthCertificatePositive.substring(healthCertificatePositive.lastIndexOf("/") + 1);
|
||||
if (filePath.startsWith("/") || filePath.startsWith("\\")) {
|
||||
filePath = filePath.substring(1);
|
||||
}
|
||||
try {
|
||||
FileDownloader.downloadFile(url, upLoadPath + File.separator + filePath, fileName);
|
||||
mediaData.setHealthCertificatePositive(healthCertificatePositive);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
MediaAsyncErrorLog mediaAsyncErrorLog = new MediaAsyncErrorLog();
|
||||
mediaAsyncErrorLog.setMediaid(healthCertificatePositive);
|
||||
mediaAsyncErrorLogService.save(mediaAsyncErrorLog);
|
||||
throw new RuntimeException("员工申请加入机构-健康证正面文件拉取错误,员工id" + dto.getEmployeeId());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
//健康证反面
|
||||
{
|
||||
if (StringUtils.isNotBlank(healthCertificateNegative)) {
|
||||
if (StringUtils.isNotBlank(healthCertificateNegative)) {
|
||||
String url = baseUrl + "/sys/common/open/static/" + URLEncoder.encode(healthCertificateNegative, StandardCharsets.UTF_8).replace("%2F", "/") + "?name=" + SafetyUtil.getSecureKey();
|
||||
if (upLoadPath.endsWith("/") || upLoadPath.endsWith("\\")) {
|
||||
upLoadPath = upLoadPath.substring(0, upLoadPath.length() - 1);
|
||||
}
|
||||
String filePath = healthCertificateNegative.substring(0, healthCertificateNegative.lastIndexOf("/"));
|
||||
String fileName = healthCertificateNegative.substring(healthCertificateNegative.lastIndexOf("/") + 1);
|
||||
if (filePath.startsWith("/") || filePath.startsWith("\\")) {
|
||||
filePath = filePath.substring(1);
|
||||
}
|
||||
try {
|
||||
FileDownloader.downloadFile(url, upLoadPath + File.separator + filePath, fileName);
|
||||
mediaData.setHealthCertificateNegative(healthCertificateNegative);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
MediaAsyncErrorLog mediaAsyncErrorLog = new MediaAsyncErrorLog();
|
||||
mediaAsyncErrorLog.setMediaid(healthCertificateNegative);
|
||||
mediaAsyncErrorLogService.save(mediaAsyncErrorLog);
|
||||
throw new RuntimeException("员工申请加入机构-健康证反面文件拉取错误,员工id" + dto.getEmployeeId());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
//银行卡正面
|
||||
{
|
||||
if (StringUtils.isNotBlank(bankPositive)) {
|
||||
if (StringUtils.isNotBlank(bankPositive)) {
|
||||
String url = baseUrl + "/sys/common/open/static/" + URLEncoder.encode(bankPositive, StandardCharsets.UTF_8).replace("%2F", "/") + "?name=" + SafetyUtil.getSecureKey();
|
||||
if (upLoadPath.endsWith("/") || upLoadPath.endsWith("\\")) {
|
||||
upLoadPath = upLoadPath.substring(0, upLoadPath.length() - 1);
|
||||
}
|
||||
String filePath = bankPositive.substring(0, bankPositive.lastIndexOf("/"));
|
||||
String fileName = bankPositive.substring(bankPositive.lastIndexOf("/") + 1);
|
||||
if (filePath.startsWith("/") || filePath.startsWith("\\")) {
|
||||
filePath = filePath.substring(1);
|
||||
}
|
||||
try {
|
||||
FileDownloader.downloadFile(url, upLoadPath + File.separator + filePath, fileName);
|
||||
mediaData.setBankPositive(bankPositive);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
MediaAsyncErrorLog mediaAsyncErrorLog = new MediaAsyncErrorLog();
|
||||
mediaAsyncErrorLog.setMediaid(bankPositive);
|
||||
mediaAsyncErrorLogService.save(mediaAsyncErrorLog);
|
||||
throw new RuntimeException("员工申请加入机构-银行卡正面文件拉取错误,员工id" + dto.getEmployeeId());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
//银行卡反面
|
||||
{
|
||||
if (StringUtils.isNotBlank(bankNegative)) {
|
||||
if (StringUtils.isNotBlank(bankNegative)) {
|
||||
String url = baseUrl + "/sys/common/open/static/" + URLEncoder.encode(bankNegative, StandardCharsets.UTF_8).replace("%2F", "/") + "?name=" + SafetyUtil.getSecureKey();
|
||||
if (upLoadPath.endsWith("/") || upLoadPath.endsWith("\\")) {
|
||||
upLoadPath = upLoadPath.substring(0, upLoadPath.length() - 1);
|
||||
}
|
||||
String filePath = bankNegative.substring(0, bankNegative.lastIndexOf("/"));
|
||||
String fileName = bankNegative.substring(bankNegative.lastIndexOf("/") + 1);
|
||||
if (filePath.startsWith("/") || filePath.startsWith("\\")) {
|
||||
filePath = filePath.substring(1);
|
||||
}
|
||||
try {
|
||||
FileDownloader.downloadFile(url, upLoadPath + File.separator + filePath, fileName);
|
||||
mediaData.setBankNegative(bankNegative);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
MediaAsyncErrorLog mediaAsyncErrorLog = new MediaAsyncErrorLog();
|
||||
mediaAsyncErrorLog.setMediaid(bankNegative);
|
||||
mediaAsyncErrorLogService.save(mediaAsyncErrorLog);
|
||||
throw new RuntimeException("员工申请加入机构-银行卡反面文件拉取错误,员工id" + dto.getEmployeeId());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
//资质证(多张使用逗号分隔)
|
||||
{
|
||||
if (StringUtils.isNotBlank(qualification)) {
|
||||
List<String> list = Arrays.asList(qualification.split(","));
|
||||
for (int i = 0; i < list.size(); i++) {
|
||||
String qua = list.get(i);
|
||||
if (StringUtils.isNotBlank(qua)) {
|
||||
String url = baseUrl + "/sys/common/open/static/" + URLEncoder.encode(qua, StandardCharsets.UTF_8).replace("%2F", "/") + "?name=" + SafetyUtil.getSecureKey();
|
||||
if (upLoadPath.endsWith("/") || upLoadPath.endsWith("\\")) {
|
||||
upLoadPath = upLoadPath.substring(0, upLoadPath.length() - 1);
|
||||
}
|
||||
String filePath = qua.substring(0, qua.lastIndexOf("/"));
|
||||
String fileName = qua.substring(qua.lastIndexOf("/") + 1);
|
||||
if (filePath.startsWith("/") || filePath.startsWith("\\")) {
|
||||
filePath = filePath.substring(1);
|
||||
}
|
||||
try {
|
||||
FileDownloader.downloadFile(url, upLoadPath + File.separator + filePath, fileName);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
MediaAsyncErrorLog mediaAsyncErrorLog = new MediaAsyncErrorLog();
|
||||
mediaAsyncErrorLog.setMediaid(qualification);
|
||||
mediaAsyncErrorLogService.save(mediaAsyncErrorLog);
|
||||
throw new RuntimeException("员工申请加入机构-资质证文件拉取错误,员工id" + dto.getEmployeeId() + ";文件:" + qua);
|
||||
}
|
||||
}
|
||||
}
|
||||
mediaData.setQualification(qualification);
|
||||
}
|
||||
}
|
||||
//无犯罪证明
|
||||
{
|
||||
if (StringUtils.isNotBlank(noCrimeCertificate)) {
|
||||
if (StringUtils.isNotBlank(noCrimeCertificate)) {
|
||||
String url = baseUrl + "/sys/common/open/static/" + URLEncoder.encode(noCrimeCertificate, StandardCharsets.UTF_8).replace("%2F", "/") + "?name=" + SafetyUtil.getSecureKey();
|
||||
if (upLoadPath.endsWith("/") || upLoadPath.endsWith("\\")) {
|
||||
upLoadPath = upLoadPath.substring(0, upLoadPath.length() - 1);
|
||||
}
|
||||
String filePath = noCrimeCertificate.substring(0, noCrimeCertificate.lastIndexOf("/"));
|
||||
String fileName = noCrimeCertificate.substring(noCrimeCertificate.lastIndexOf("/") + 1);
|
||||
if (filePath.startsWith("/") || filePath.startsWith("\\")) {
|
||||
filePath = filePath.substring(1);
|
||||
}
|
||||
try {
|
||||
FileDownloader.downloadFile(url, upLoadPath + File.separator + filePath, fileName);
|
||||
mediaData.setNoCrimeCertificate(noCrimeCertificate);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
MediaAsyncErrorLog mediaAsyncErrorLog = new MediaAsyncErrorLog();
|
||||
mediaAsyncErrorLog.setMediaid(noCrimeCertificate);
|
||||
mediaAsyncErrorLogService.save(mediaAsyncErrorLog);
|
||||
throw new RuntimeException("员工申请加入机构-无犯罪证明文件拉取错误,员工id" + dto.getEmployeeId());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
employeesApplyService.updateById(mediaData);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 邀请时发现此员工已申请 清理已保存的数据
|
||||
*
|
||||
* @param dto
|
||||
*/
|
||||
@RabbitListener(
|
||||
bindings = @QueueBinding(
|
||||
value = @Queue(name = "#{employeesAsyncDQNP.getCanNotInvidedQueueName()}"),
|
||||
exchange = @Exchange(name = "hldy.employees", type = ExchangeTypes.DIRECT),
|
||||
key = "#{employeesAsyncDQNP.getCanNotInvidedKeyName()}"
|
||||
),
|
||||
errorHandler = "employeesMQErrorHandler"
|
||||
)
|
||||
public void handleCanNotInvided(EmployeesApplyMQDto dto) {
|
||||
employeesApplyService.cleanErrorInvided(dto.getEmployeeId());
|
||||
}
|
||||
|
||||
/**
|
||||
* 被邀请确认
|
||||
* 1、将申请状态改为对应
|
||||
* 2、
|
||||
*
|
||||
* @param dto
|
||||
*/
|
||||
@RabbitListener(
|
||||
bindings = @QueueBinding(
|
||||
value = @Queue(name = "#{employeesAsyncDQNP.getInvidedConfirmQueueName()}"),
|
||||
exchange = @Exchange(name = "hldy.employees", type = ExchangeTypes.DIRECT),
|
||||
key = "#{employeesAsyncDQNP.getInvidedConfirmKeyName()}"
|
||||
),
|
||||
errorHandler = "employeesMQErrorHandler"
|
||||
)
|
||||
public void handleInvidedConfirm(EmployeesApplyMQDto dto) {
|
||||
UpdateWrapper<EmployeesApply> uw = new UpdateWrapper<>();
|
||||
uw.eq("employee_id", dto.getEmployeeId());
|
||||
uw.eq("iz_history", "1");//当前数据
|
||||
uw.eq("is_invited", "0");//被邀请的
|
||||
EmployeesApply employeesApply = new EmployeesApply();
|
||||
employeesApply.setStatus(dto.getStatus());
|
||||
employeesApplyService.update(employeesApply, uw);
|
||||
|
||||
if ("2".equals(dto.getStatus())) {
|
||||
//将员工信息插入员工表中
|
||||
QueryWrapper<BizEmployeesInfo> qw = new QueryWrapper<>();
|
||||
qw.eq("id", dto.getEmployeeId());
|
||||
BizEmployeesInfo one = employeesInfoService.getOne(qw);
|
||||
if (one == null) {
|
||||
QueryWrapper<EmployeesApply> qw1 = new QueryWrapper<>();
|
||||
qw1.eq("employee_id", dto.getEmployeeId());
|
||||
qw1.eq("iz_history", "1");//当前数据
|
||||
qw1.eq("is_invited", "0");//被邀请的
|
||||
EmployeesApply one1 = employeesApplyService.getOne(qw1);
|
||||
BizEmployeesInfo employeesInfo = new BizEmployeesInfo();
|
||||
BeanUtils.copyProperties(one1, employeesInfo);
|
||||
employeesInfo.setId(dto.getEmployeeId());
|
||||
employeesInfo.setSysOrgCode(dto.getOrgCode());
|
||||
employeesInfo.setEntryTime(dto.getOpeTime());
|
||||
|
||||
//资源文件拉完图片统一存储,不然页面有路径没资源可显示
|
||||
String idCardPositive = employeesInfo.getIdCardPositive();
|
||||
String idCardNegative = employeesInfo.getIdCardNegative();
|
||||
String healthCertificatePositive = employeesInfo.getHealthCertificatePositive();
|
||||
String healthCertificateNegative = employeesInfo.getHealthCertificateNegative();
|
||||
String bankPositive = employeesInfo.getBankPositive();
|
||||
String bankNegative = employeesInfo.getBankNegative();
|
||||
String qualification = employeesInfo.getQualification();
|
||||
String noCrimeCertificate = employeesInfo.getNoCrimeCertificate();
|
||||
{
|
||||
employeesInfo.setIdCardPositive(null);//身份证正面
|
||||
employeesInfo.setIdCardNegative(null);//身份证反面
|
||||
employeesInfo.setHealthCertificatePositive(null);//健康证正面
|
||||
employeesInfo.setHealthCertificateNegative(null);//健康证反面
|
||||
employeesInfo.setBankPositive(null);//银行卡正面
|
||||
employeesInfo.setBankNegative(null);//银行卡反面
|
||||
employeesInfo.setQualification(null);//资质证
|
||||
employeesInfo.setNoCrimeCertificate(null);//无犯罪证明
|
||||
}
|
||||
|
||||
employeesInfoService.save(employeesInfo);
|
||||
|
||||
//去管理平台拉取资源
|
||||
{
|
||||
BizEmployeesInfo mediaData = new BizEmployeesInfo();
|
||||
mediaData.setId(employeesApply.getId());
|
||||
|
||||
JSONObject opeOpenUrl = sysConfigApi.getByKeyByDS("master", "ope_open_url");
|
||||
String baseUrl = opeOpenUrl.getString("configValue");
|
||||
if (baseUrl.endsWith("/")) {
|
||||
baseUrl = baseUrl.substring(0, baseUrl.length() - 1);
|
||||
}
|
||||
//身份证正面
|
||||
{
|
||||
if (StringUtils.isNotBlank(idCardPositive)) {
|
||||
if (StringUtils.isNotBlank(idCardPositive)) {
|
||||
String url = baseUrl + "/sys/common/open/static/" + URLEncoder.encode(idCardPositive, StandardCharsets.UTF_8).replace("%2F", "/") + "?name=" + SafetyUtil.getSecureKey();
|
||||
if (upLoadPath.endsWith("/") || upLoadPath.endsWith("\\")) {
|
||||
upLoadPath = upLoadPath.substring(0, upLoadPath.length() - 1);
|
||||
}
|
||||
String filePath = idCardPositive.substring(0, idCardPositive.lastIndexOf("/"));
|
||||
String fileName = idCardPositive.substring(idCardPositive.lastIndexOf("/") + 1);
|
||||
if (filePath.startsWith("/") || filePath.startsWith("\\")) {
|
||||
filePath = filePath.substring(1);
|
||||
}
|
||||
try {
|
||||
FileDownloader.downloadFile(url, upLoadPath + File.separator + filePath, fileName);
|
||||
mediaData.setIdCardPositive(idCardPositive);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
MediaAsyncErrorLog mediaAsyncErrorLog = new MediaAsyncErrorLog();
|
||||
mediaAsyncErrorLog.setMediaid(idCardPositive);
|
||||
mediaAsyncErrorLogService.save(mediaAsyncErrorLog);
|
||||
throw new RuntimeException("员工申请加入机构-身份证正面文件拉取错误,员工id" + dto.getEmployeeId());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
//身份证反面
|
||||
{
|
||||
if (StringUtils.isNotBlank(idCardNegative)) {
|
||||
if (StringUtils.isNotBlank(idCardNegative)) {
|
||||
String url = baseUrl + "/sys/common/open/static/" + URLEncoder.encode(idCardNegative, StandardCharsets.UTF_8).replace("%2F", "/") + "?name=" + SafetyUtil.getSecureKey();
|
||||
if (upLoadPath.endsWith("/") || upLoadPath.endsWith("\\")) {
|
||||
upLoadPath = upLoadPath.substring(0, upLoadPath.length() - 1);
|
||||
}
|
||||
String filePath = idCardNegative.substring(0, idCardNegative.lastIndexOf("/"));
|
||||
String fileName = idCardNegative.substring(idCardNegative.lastIndexOf("/") + 1);
|
||||
if (filePath.startsWith("/") || filePath.startsWith("\\")) {
|
||||
filePath = filePath.substring(1);
|
||||
}
|
||||
try {
|
||||
FileDownloader.downloadFile(url, upLoadPath + File.separator + filePath, fileName);
|
||||
mediaData.setIdCardNegative(idCardNegative);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
MediaAsyncErrorLog mediaAsyncErrorLog = new MediaAsyncErrorLog();
|
||||
mediaAsyncErrorLog.setMediaid(idCardNegative);
|
||||
mediaAsyncErrorLogService.save(mediaAsyncErrorLog);
|
||||
throw new RuntimeException("员工申请加入机构-身份证反面文件拉取错误,员工id" + dto.getEmployeeId());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
//健康证正面
|
||||
{
|
||||
if (StringUtils.isNotBlank(healthCertificatePositive)) {
|
||||
if (StringUtils.isNotBlank(healthCertificatePositive)) {
|
||||
String url = baseUrl + "/sys/common/open/static/" + URLEncoder.encode(healthCertificatePositive, StandardCharsets.UTF_8).replace("%2F", "/") + "?name=" + SafetyUtil.getSecureKey();
|
||||
if (upLoadPath.endsWith("/") || upLoadPath.endsWith("\\")) {
|
||||
upLoadPath = upLoadPath.substring(0, upLoadPath.length() - 1);
|
||||
}
|
||||
String filePath = healthCertificatePositive.substring(0, healthCertificatePositive.lastIndexOf("/"));
|
||||
String fileName = healthCertificatePositive.substring(healthCertificatePositive.lastIndexOf("/") + 1);
|
||||
if (filePath.startsWith("/") || filePath.startsWith("\\")) {
|
||||
filePath = filePath.substring(1);
|
||||
}
|
||||
try {
|
||||
FileDownloader.downloadFile(url, upLoadPath + File.separator + filePath, fileName);
|
||||
mediaData.setHealthCertificatePositive(healthCertificatePositive);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
MediaAsyncErrorLog mediaAsyncErrorLog = new MediaAsyncErrorLog();
|
||||
mediaAsyncErrorLog.setMediaid(healthCertificatePositive);
|
||||
mediaAsyncErrorLogService.save(mediaAsyncErrorLog);
|
||||
throw new RuntimeException("员工申请加入机构-健康证正面文件拉取错误,员工id" + dto.getEmployeeId());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
//健康证反面
|
||||
{
|
||||
if (StringUtils.isNotBlank(healthCertificateNegative)) {
|
||||
if (StringUtils.isNotBlank(healthCertificateNegative)) {
|
||||
String url = baseUrl + "/sys/common/open/static/" + URLEncoder.encode(healthCertificateNegative, StandardCharsets.UTF_8).replace("%2F", "/") + "?name=" + SafetyUtil.getSecureKey();
|
||||
if (upLoadPath.endsWith("/") || upLoadPath.endsWith("\\")) {
|
||||
upLoadPath = upLoadPath.substring(0, upLoadPath.length() - 1);
|
||||
}
|
||||
String filePath = healthCertificateNegative.substring(0, healthCertificateNegative.lastIndexOf("/"));
|
||||
String fileName = healthCertificateNegative.substring(healthCertificateNegative.lastIndexOf("/") + 1);
|
||||
if (filePath.startsWith("/") || filePath.startsWith("\\")) {
|
||||
filePath = filePath.substring(1);
|
||||
}
|
||||
try {
|
||||
FileDownloader.downloadFile(url, upLoadPath + File.separator + filePath, fileName);
|
||||
mediaData.setHealthCertificateNegative(healthCertificateNegative);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
MediaAsyncErrorLog mediaAsyncErrorLog = new MediaAsyncErrorLog();
|
||||
mediaAsyncErrorLog.setMediaid(healthCertificateNegative);
|
||||
mediaAsyncErrorLogService.save(mediaAsyncErrorLog);
|
||||
throw new RuntimeException("员工申请加入机构-健康证反面文件拉取错误,员工id" + dto.getEmployeeId());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
//银行卡正面
|
||||
{
|
||||
if (StringUtils.isNotBlank(bankPositive)) {
|
||||
if (StringUtils.isNotBlank(bankPositive)) {
|
||||
String url = baseUrl + "/sys/common/open/static/" + URLEncoder.encode(bankPositive, StandardCharsets.UTF_8).replace("%2F", "/") + "?name=" + SafetyUtil.getSecureKey();
|
||||
if (upLoadPath.endsWith("/") || upLoadPath.endsWith("\\")) {
|
||||
upLoadPath = upLoadPath.substring(0, upLoadPath.length() - 1);
|
||||
}
|
||||
String filePath = bankPositive.substring(0, bankPositive.lastIndexOf("/"));
|
||||
String fileName = bankPositive.substring(bankPositive.lastIndexOf("/") + 1);
|
||||
if (filePath.startsWith("/") || filePath.startsWith("\\")) {
|
||||
filePath = filePath.substring(1);
|
||||
}
|
||||
try {
|
||||
FileDownloader.downloadFile(url, upLoadPath + File.separator + filePath, fileName);
|
||||
mediaData.setBankPositive(bankPositive);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
MediaAsyncErrorLog mediaAsyncErrorLog = new MediaAsyncErrorLog();
|
||||
mediaAsyncErrorLog.setMediaid(bankPositive);
|
||||
mediaAsyncErrorLogService.save(mediaAsyncErrorLog);
|
||||
throw new RuntimeException("员工申请加入机构-银行卡正面文件拉取错误,员工id" + dto.getEmployeeId());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
//银行卡反面
|
||||
{
|
||||
if (StringUtils.isNotBlank(bankNegative)) {
|
||||
if (StringUtils.isNotBlank(bankNegative)) {
|
||||
String url = baseUrl + "/sys/common/open/static/" + URLEncoder.encode(bankNegative, StandardCharsets.UTF_8).replace("%2F", "/") + "?name=" + SafetyUtil.getSecureKey();
|
||||
if (upLoadPath.endsWith("/") || upLoadPath.endsWith("\\")) {
|
||||
upLoadPath = upLoadPath.substring(0, upLoadPath.length() - 1);
|
||||
}
|
||||
String filePath = bankNegative.substring(0, bankNegative.lastIndexOf("/"));
|
||||
String fileName = bankNegative.substring(bankNegative.lastIndexOf("/") + 1);
|
||||
if (filePath.startsWith("/") || filePath.startsWith("\\")) {
|
||||
filePath = filePath.substring(1);
|
||||
}
|
||||
try {
|
||||
FileDownloader.downloadFile(url, upLoadPath + File.separator + filePath, fileName);
|
||||
mediaData.setBankNegative(bankNegative);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
MediaAsyncErrorLog mediaAsyncErrorLog = new MediaAsyncErrorLog();
|
||||
mediaAsyncErrorLog.setMediaid(bankNegative);
|
||||
mediaAsyncErrorLogService.save(mediaAsyncErrorLog);
|
||||
throw new RuntimeException("员工申请加入机构-银行卡反面文件拉取错误,员工id" + dto.getEmployeeId());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
//资质证(多张使用逗号分隔)
|
||||
{
|
||||
if (StringUtils.isNotBlank(qualification)) {
|
||||
List<String> list = Arrays.asList(qualification.split(","));
|
||||
for (int i = 0; i < list.size(); i++) {
|
||||
String qua = list.get(i);
|
||||
if (StringUtils.isNotBlank(qua)) {
|
||||
String url = baseUrl + "/sys/common/open/static/" + URLEncoder.encode(qua, StandardCharsets.UTF_8).replace("%2F", "/") + "?name=" + SafetyUtil.getSecureKey();
|
||||
if (upLoadPath.endsWith("/") || upLoadPath.endsWith("\\")) {
|
||||
upLoadPath = upLoadPath.substring(0, upLoadPath.length() - 1);
|
||||
}
|
||||
String filePath = qua.substring(0, qua.lastIndexOf("/"));
|
||||
String fileName = qua.substring(qua.lastIndexOf("/") + 1);
|
||||
if (filePath.startsWith("/") || filePath.startsWith("\\")) {
|
||||
filePath = filePath.substring(1);
|
||||
}
|
||||
try {
|
||||
FileDownloader.downloadFile(url, upLoadPath + File.separator + filePath, fileName);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
MediaAsyncErrorLog mediaAsyncErrorLog = new MediaAsyncErrorLog();
|
||||
mediaAsyncErrorLog.setMediaid(qualification);
|
||||
mediaAsyncErrorLogService.save(mediaAsyncErrorLog);
|
||||
throw new RuntimeException("员工申请加入机构-资质证文件拉取错误,员工id" + dto.getEmployeeId() + ";文件:" + qua);
|
||||
}
|
||||
}
|
||||
}
|
||||
mediaData.setQualification(qualification);
|
||||
}
|
||||
}
|
||||
//无犯罪证明
|
||||
{
|
||||
if (StringUtils.isNotBlank(noCrimeCertificate)) {
|
||||
if (StringUtils.isNotBlank(noCrimeCertificate)) {
|
||||
String url = baseUrl + "/sys/common/open/static/" + URLEncoder.encode(noCrimeCertificate, StandardCharsets.UTF_8).replace("%2F", "/") + "?name=" + SafetyUtil.getSecureKey();
|
||||
if (upLoadPath.endsWith("/") || upLoadPath.endsWith("\\")) {
|
||||
upLoadPath = upLoadPath.substring(0, upLoadPath.length() - 1);
|
||||
}
|
||||
String filePath = noCrimeCertificate.substring(0, noCrimeCertificate.lastIndexOf("/"));
|
||||
String fileName = noCrimeCertificate.substring(noCrimeCertificate.lastIndexOf("/") + 1);
|
||||
if (filePath.startsWith("/") || filePath.startsWith("\\")) {
|
||||
filePath = filePath.substring(1);
|
||||
}
|
||||
try {
|
||||
FileDownloader.downloadFile(url, upLoadPath + File.separator + filePath, fileName);
|
||||
mediaData.setNoCrimeCertificate(noCrimeCertificate);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
MediaAsyncErrorLog mediaAsyncErrorLog = new MediaAsyncErrorLog();
|
||||
mediaAsyncErrorLog.setMediaid(noCrimeCertificate);
|
||||
mediaAsyncErrorLogService.save(mediaAsyncErrorLog);
|
||||
throw new RuntimeException("员工申请加入机构-无犯罪证明文件拉取错误,员工id" + dto.getEmployeeId());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
employeesInfoService.updateById(mediaData);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,20 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<parent>
|
||||
<groupId>com.nursingunit.boot</groupId>
|
||||
<artifactId>nursing-unit-parent</artifactId>
|
||||
<version>2.0.0</version>
|
||||
</parent>
|
||||
<description>员工管理功能模块</description>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<artifactId>nursing-unit-employee</artifactId>
|
||||
<packaging>pom</packaging>
|
||||
|
||||
<modules>
|
||||
<module>nu-employee-api</module>
|
||||
<module>nu-employee-biz</module>
|
||||
</modules>
|
||||
|
||||
</project>
|
||||
|
|
@ -9,5 +9,11 @@
|
|||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<artifactId>nu-iot-local-api</artifactId>
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>com.nursingunit.boot</groupId>
|
||||
<artifactId>nursing-unit-common</artifactId>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
</project>
|
||||
|
|
|
|||
|
|
@ -1,13 +1,11 @@
|
|||
package com.nu.modules.camerainfo.api;
|
||||
|
||||
import com.nu.modules.camerainfo.entity.CameraInfoDto;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import com.nu.entity.CameraInfoEntity;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public interface CameraInfoApi {
|
||||
|
||||
public List<CameraInfoDto> getCameraInfoList();
|
||||
public List<CameraInfoEntity> getCameraInfoList();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -54,7 +54,7 @@
|
|||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.nursingunit.boot</groupId>
|
||||
<artifactId>nu-admin-biz</artifactId>
|
||||
<artifactId>nu-nu-local-api</artifactId>
|
||||
<version>2.0.0</version>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
|
|
|
|||
|
|
@ -8,15 +8,12 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
|
|||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||
import com.nu.modules.camerainfo.api.CameraInfoApi;
|
||||
import com.nu.modules.camerainfo.entity.CameraInfoDto;
|
||||
import com.nu.entity.CameraInfoEntity;
|
||||
import com.nu.modules.tplink.camera.model.CameraTreeModel;
|
||||
import com.nu.modules.tplink.common.entity.TumsConfig;
|
||||
import com.nu.modules.tplink.common.mapper.TumsConfigMapper;
|
||||
import com.nu.modules.yiweilian.humid.service.impl.HumidDeviceServiceImpl;
|
||||
import org.apache.commons.compress.utils.Lists;
|
||||
import org.apache.shiro.SecurityUtils;
|
||||
import org.jeecg.common.api.vo.Result;
|
||||
import org.jeecg.common.system.vo.LoginUser;
|
||||
import org.jeecg.common.util.DateUtils;
|
||||
import com.nu.modules.tplink.camera.entity.CameraInfo;
|
||||
import com.nu.modules.tplink.camera.mapper.CameraInfoMapper;
|
||||
|
|
@ -24,7 +21,6 @@ import com.nu.modules.tplink.camera.service.ICameraInfoService;
|
|||
import com.nu.modules.tplink.common.entity.ErrorCode;
|
||||
import com.nu.modules.tplink.common.service.IErrorCodeService;
|
||||
import com.nu.modules.tplink.utils.TumsApi;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.context.annotation.Lazy;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
|
@ -2871,9 +2867,9 @@ public class CameraInfoServiceImpl extends ServiceImpl<CameraInfoMapper, CameraI
|
|||
}
|
||||
|
||||
@Override
|
||||
public List<CameraInfoDto> getCameraInfoList() {
|
||||
public List<CameraInfoEntity> getCameraInfoList() {
|
||||
List<CameraInfo> list = baseMapper.findAllList();
|
||||
List<CameraInfoDto> listDto =BeanUtil.copyToList(list,CameraInfoDto.class);
|
||||
List<CameraInfoEntity> listDto =BeanUtil.copyToList(list, CameraInfoEntity.class);
|
||||
return listDto;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2,9 +2,8 @@ package com.nu.mq.device.listener;
|
|||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.nu.dto.*;
|
||||
import com.nu.modules.nuBaseInfo.entity.NuBaseInfo;
|
||||
import com.nu.modules.nuBaseInfo.service.INuBaseInfoService;
|
||||
import com.nu.modules.nuBizAdvisoryInfo.entity.NuBizAdvisoryInfo;
|
||||
import com.nu.entity.NuBaseInfoEntity;
|
||||
import com.nu.modules.nubaseinfo.api.INuBaseInfoApi;
|
||||
import com.nu.modules.tplink.camera.entity.CameraCapability;
|
||||
import com.nu.modules.tplink.camera.entity.CameraInfo;
|
||||
import com.nu.modules.tplink.camera.service.ICameraCapabilityService;
|
||||
|
|
@ -36,9 +35,6 @@ public class IotSyncBizMQListener {
|
|||
@Autowired
|
||||
private RabbitMQUtil rabbitMQUtil;
|
||||
|
||||
@Autowired
|
||||
private INuBaseInfoService nuBaseInfoService;
|
||||
|
||||
@Autowired
|
||||
private ICameraInfoService cameraInfoService;
|
||||
|
||||
|
|
@ -57,6 +53,9 @@ public class IotSyncBizMQListener {
|
|||
@Autowired
|
||||
private IHumidDeviceService humidDeviceService;
|
||||
|
||||
@Autowired
|
||||
private INuBaseInfoApi nuBaseInfoApi;
|
||||
|
||||
@RabbitListener(
|
||||
bindings = @QueueBinding(
|
||||
value = @Queue(name = "#{iotDeviceAsyncDQNP.getSyncDeviceQueueName()}"),
|
||||
|
|
@ -73,9 +72,7 @@ public class IotSyncBizMQListener {
|
|||
List<StatusMQDto> statusList = new ArrayList<>();
|
||||
IotNuBaseInfoMQDto iotNuBaseInfoMQDto = dto.getNuBaseInfo();
|
||||
try {
|
||||
QueryWrapper<NuBaseInfo> nuBaseInfoQw = new QueryWrapper<>();
|
||||
nuBaseInfoQw.eq("nu_id",iotNuBaseInfoMQDto.getNuId());
|
||||
NuBaseInfo entity = nuBaseInfoService.getOne(nuBaseInfoQw);
|
||||
NuBaseInfoEntity entity = nuBaseInfoApi.getOneByNuId(iotNuBaseInfoMQDto.getNuId());
|
||||
StatusMQDto statusMQDto = new StatusMQDto();
|
||||
statusMQDto.setAsyncId(iotNuBaseInfoMQDto.getId());
|
||||
statusMQDto.setMessage("成功");
|
||||
|
|
@ -86,12 +83,14 @@ public class IotSyncBizMQListener {
|
|||
statusMQDto.setMessage("忽略");
|
||||
}else{
|
||||
entity.setDelFlag(iotNuBaseInfoMQDto.getDelFlag());
|
||||
nuBaseInfoService.updateById(entity);
|
||||
NuBaseInfoEntity nuBaseInfo = new NuBaseInfoEntity();
|
||||
BeanUtils.copyProperties(entity, nuBaseInfo);
|
||||
nuBaseInfoApi.updateById(nuBaseInfo);
|
||||
}
|
||||
}else{
|
||||
NuBaseInfo nuBaseInfo = new NuBaseInfo();
|
||||
NuBaseInfoEntity nuBaseInfo = new NuBaseInfoEntity();
|
||||
BeanUtils.copyProperties(iotNuBaseInfoMQDto, nuBaseInfo);
|
||||
nuBaseInfoService.save(nuBaseInfo);
|
||||
nuBaseInfoApi.save(nuBaseInfo);
|
||||
}
|
||||
statusList.add(statusMQDto);
|
||||
} catch (Exception e) {
|
||||
|
|
|
|||
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue