Commit 4355010c authored by 李灿灿's avatar 李灿灿

Merge branch 'develop' into feature-licancan

parents 038410d8 840c989e
......@@ -12,10 +12,7 @@ import java.io.Serializable;
*/
@Data
public class EkpSalaryParam implements Serializable {
/**
* ID
**/
private String fd_id;
/**
* 项目编码
**/
......@@ -121,7 +118,7 @@ public class EkpSalaryParam implements Serializable {
**/
private String fd_3adfee203f86b2;
/**
* 发合计
* 发合计
**/
private String fd_3adfee20fe5ba4;
/**
......@@ -185,23 +182,23 @@ public class EkpSalaryParam implements Serializable {
**/
private String fd_3aeadee1cf1266;
/**
* 发合计应支出
* 发合计应支出
**/
private String fd_3adfeec730ec44;
/**
* 工资发结算状态
* 工资发结算状态
**/
private String fd_3adfeef9440ab2;
/**
* 发合计付款状态
* 发合计付款状态
**/
private String fd_3adfeedd5f3cb2;
/**
* 发结算单号
* 发结算单号
**/
private String fd_3aeadf17522642;
/**
* 发付款单号
* 发付款单号
**/
private String fd_3aeadf17b7d03a;
/**
......
package com.yifu.cloud.plus.v1.yifu.ekp.vo;
import lombok.Data;
/**
* @Author fxj
* @Date 2022/8/22
* @Description 薪资明细对应参数
* @Version 1.0
*/
@Data
public class EkpSalaryParamVo extends EkpSalaryParam {
/**
* 报账表id
**/
private String salaryAccountId;
}
ekp.url=http://119.96.227.251:8080/api/sys-modeling/appModelRestService/addModel
ekp.fdModelId='181d7633ff8bc797276d0d3a54e80ad6'
ekp.fdFlowId='182b40249c1bc940d7226b941c7a4183'
ekp.docStatus='20'
ekp.LoginName='admin'
ekp.docSubject='\u85AA\u8D44\u8BA2\u5355\u660E\u7EC6\u6570\u636E\u63A5\u53E3'
ekp.fdModelId=181d7633ff8bc797276d0d3a54e80ad6
ekp.fdFlowId=182b40249c1bc940d7226b941c7a4183
ekp.docStatus=20
ekp.LoginName=admin
ekp.docSubject=\u85AA\u8D44\u8BA2\u5355\u660E\u7EC6\u6570\u636E\u63A5\u53E3
......@@ -1009,6 +1009,21 @@ public class InsurancesConstants {
*/
public static final String SETTLE_THREE = "无需结算";
/**
* 订单编号不能为空
*/
public static final String ORDER_NO_IS_EMPTY = "订单编号不能为空";
/**
* 购买类型为空
*/
public static final String BUY_TYPE_IS_EMPTY = "购买类型为空";
/**
* 购买类型错误
*/
public static final String BUY_TYPE_ERROR = "购买类型错误";
......
......@@ -285,5 +285,29 @@ public class TInsuranceDetail extends BaseEntity {
@Schema(description = "商险办理时间")
private LocalDateTime handledTime;
private static final long serialVersionUID = 1L;
/**
* 订单编号
*/
@Schema(description = "订单编号")
private String orderNo;
/**
* 创建人所在部门
*/
@Schema(description = "创建人所在部门")
private String createUserDeptId;
/**
* 创建人所在部门名称
*/
@Schema(description = "创建人所在部门名称")
private String createUserDeptName;
private static final long serialVersionUID = 1L;
}
\ No newline at end of file
......@@ -32,6 +32,12 @@ public class TInsuranceRefund extends BaseEntity {
@Schema(description = "保单信息主键")
private String insDetailId;
/**
* 订单编号
*/
@Schema(description = "订单编号")
private String orderNo;
/**
* 减员状态
*/
......@@ -56,7 +62,17 @@ public class TInsuranceRefund extends BaseEntity {
@Schema(description = "是否删除 0否/1是")
private Integer deleteFlag;
/**
* 创建人所在部门
*/
@Schema(description = "创建人所在部门")
private String createUserDeptId;
/**
* 创建人所在部门名称
*/
@Schema(description = "创建人所在部门名称")
private String createUserDeptName;
private static final long serialVersionUID = 1L;
......
package com.yifu.cloud.plus.v1.yifu.insurances.vo;
import lombok.Data;
import java.util.List;
/**
* @author zhaji
* @description TODO
* @date 2022-08-29 11:57:55
*/
@Data
public class InsuranceListOrderParam {
private String orderNo;
private List<InsuranceAddParam> data;
}
......@@ -22,6 +22,12 @@ public class InsuranceListParam implements Serializable {
@Schema(description = "项目编码")
private String deptNo;
/**
* 订单编号
*/
@Schema(description = "订单编号")
private String orderNo;
/**
* 投保状态 1待投保 2投保中 3已投保 4投保退回 5 已减员
*/
......
......@@ -104,6 +104,12 @@ public class InsuranceListVO implements Serializable {
@Schema(description = "创建人(派单人)")
private String createName;
/**
* 创建人部门名称
*/
@Schema(description = "创建人部门名称(派单人)")
private String createUserDeptName;
/**
* 创建者
*/
......
package com.yifu.cloud.plus.v1.yifu.insurances.vo;
import lombok.Data;
import java.util.List;
/**
* @author zhaji
* @description TODO
* @date 2022-08-29 12:13:48
*/
@Data
public class InsuranceOrderBatchParam {
private String orderNo;
private List<InsuranceBatchParam> data;
}
package com.yifu.cloud.plus.v1.yifu.insurances.vo;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import java.util.List;
/**
* @author zhaji
* @description TODO
* @date 2022-08-29 12:35:52
*/
@Data
public class InsuranceOrderRefundParam {
/**
* 订单编号
*/
@Schema(description = "订单编号")
private String orderNo;
private List<InsuranceRefundCheck> data;
}
package com.yifu.cloud.plus.v1.yifu.insurances.vo;
import lombok.Data;
import java.util.List;
/**
* @author zhaji
* @description TODO
* @date 2022-08-29 12:29:28
*/
@Data
public class InsuranceOrderReplaceParam {
private String orderNo;
private List<InsuranceReplaceParam> data;
}
......@@ -23,6 +23,12 @@ public class InsuranceRefundCheck implements Serializable {
@Schema(description = "主键")
private String id;
/**
* 订单编号
*/
@Schema(description = "订单编号")
private String orderNo;
/**
* 员工姓名
*/
......
......@@ -170,6 +170,11 @@ public class InsuranceRefundListVo implements Serializable {
*/
@Schema(description = "减员状态 1待减员 2减员中3减员退回")
private Integer reduceHandleStatus;
/**
* 创建人所在部门名称
*/
@Schema(description = "创建人所在部门名称")
private String createUserDeptName;
/**
* 购买月数
......
......@@ -232,8 +232,11 @@ public class InsuredListVo implements Serializable {
@Schema(description = "购买月数")
private Long buyMonth;
/**
* 创建人所在部门名称
*/
@Schema(description = "创建人所在部门名称")
private String createUserDeptName;
//订单编号、姓名、身份证号、投保类型、项目、岗位、保单开始日期、保单结束日期、保险公司、险种、购买标准、医保、身故或残疾、预估保费、实际保费、保单号、发票号、保单生效日期、商险购买地、商险办理地、是否出险、是否过期、是否失效、派单日期、派单人
}
package com.yifu.cloud.plus.v1.yifu.insurances.vo;
import com.alibaba.excel.annotation.ExcelProperty;
import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.TableField;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonIgnore;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import java.io.Serializable;
import java.time.LocalDate;
import java.time.LocalDateTime;
/**
* @author zhaji
* @description TODO
* @date 2022-08-29 14:47:46
*/
@Data
public class InsuredOrderListVo implements Serializable {
/**
* 主键
*/
@Schema(description = "主键")
private String id;
/**
* 投保类型, 1新增、3批增、4替换
*/
@Schema(description = " 投保类型, 1新增、3批增、4替换")
private Integer buyType;
/**
* 员工姓名
*/
@Schema(description = "员工姓名")
private String empName;
/**
* 员工身份证号
*/
@Schema(description = "员工身份证号")
private String empIdcardNo;
/**
* 保险公司名称
*/
@Schema(description = "保险公司名称")
private String insuranceCompanyName;
/**
* 险种名称
*/
@Schema(description = "险种名称")
private String insuranceTypeName;
/**
* 购买标准
*/
@Schema(description = "购买标准")
private String buyStandard;
/**
* 医疗额度
*/
@Schema(description = "医疗额度")
private String medicalQuota;
/**
* 身故或残疾额度
*/
@Schema(description = "身故或残疾额度")
private String dieDisableQuota;
/**
* 创建人姓名
*/
@Schema(description = "创建人(派单人)")
private String createName;
/**
* 创建人部门名称
*/
@Schema(description = "创建人部门名称(派单人)")
private String createUserDeptName;
/**
* 创建时间
*/
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern="yyyy-MM-dd HH:mm:ss")
@Schema(description = "创建时间")
@TableField(fill = FieldFill.INSERT)
private LocalDateTime createTime;
/**
* 投保状态 1待投保 2投保中 3已投保 4投保退回 5 已减员
*/
@Schema(description = "投保状态 1待投保 2投保中 3已投保 4投保退回 5 已减员")
private Integer buyHandleStatus;
/**
* 减员状态 1待减员 2减员中3减员退回
*/
@Schema(description = "减员状态 1待减员 2减员中3减员退回,4减员成功")
private Integer reduceHandleStatus;
/**
* 减员ID
*/
@Schema(description = "减员ID")
private Integer refundId;
}
package com.yifu.cloud.plus.v1.yifu.insurances.vo;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.v3.oas.annotations.media.Schema;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.Data;
import java.io.Serializable;
import java.util.List;
/**
* @author zhaji
* @description 订单商险列表查询
* @date 2022-08-29 14:44:25
*/
@Data
@Tag(name = "订单商险列表查询")
public class InsuredOrderParam implements Serializable {
/**
* 订单编号
*/
@Schema(description = "订单编号")
private String orderNo;
/**
* 员工姓名
*/
@Schema(description = "员工姓名")
private String empName;
/**
* 员工身份证号
*/
@Schema(description = "员工身份证号")
private String empIdcardNo;
/**
* 开始日期
*/
@Schema(description = "开始日期")
private String startDate;
/**
* 结束日期
*/
@Schema(description = "结束日期")
private String endDate;
/**
* 项目编码列表
*/
@Schema(description = "项目编码列表")
private List<String> deptNoList;
}
......@@ -119,7 +119,7 @@ public class TInsuranceDetailController {
@Operation(summary = "投保新增", description = "投保新增")
@PostMapping("/addInsurance")
public R<List<InsuranceAddParam>> addInsurance(@RequestBody @Valid @Size(min = 1,message = "集合不能为空") List<InsuranceAddParam> paramList){
return tInsuranceDetailService.addInsurance(paramList);
return tInsuranceDetailService.addInsurance(paramList,null);
}
/**
......@@ -132,7 +132,7 @@ public class TInsuranceDetailController {
@Operation(summary = "投保批增", description = "投保批增")
@PostMapping("/batchInsurance")
public R<List<InsuranceBatchParam>> batchInsurance(@RequestBody @Valid @Size(min = 1,message = "集合不能为空") List<InsuranceBatchParam> paramList){
return tInsuranceDetailService.batchInsurance(paramList);
return tInsuranceDetailService.batchInsurance(paramList,null);
}
/**
......@@ -145,7 +145,7 @@ public class TInsuranceDetailController {
@Operation(summary = "投保替换", description = "投保替换")
@PostMapping("/replaceInsurance")
public R<List<InsuranceReplaceParam>> replaceInsurance(@RequestBody @Valid @Size(min = 1,message = "集合不能为空") List<InsuranceReplaceParam> paramList){
return tInsuranceDetailService.replaceInsurance(paramList);
return tInsuranceDetailService.replaceInsurance(paramList,null);
}
/**
......@@ -288,7 +288,7 @@ public class TInsuranceDetailController {
*/
@PostMapping("/saveInsuranceRefund")
public R saveInsuranceRefund(@RequestBody @Valid @Size(min = 1,message = "导入减员列表不能为空") List<InsuranceRefundCheck> insuranceRefundCheckList){
return tInsuranceDetailService.saveInsuranceRefund(insuranceRefundCheckList);
return tInsuranceDetailService.saveInsuranceRefund(insuranceRefundCheckList,null);
}
/**
......@@ -353,7 +353,7 @@ public class TInsuranceDetailController {
*/
@Operation(summary = "已减员列表分页查询", description = "已减员列表分页查询")
@PostMapping("/getInsuranceRefundPageList")
public R<IPage<InsuranceRefundListVo>> getInsuranceRefundPageList(Page<InsuranceRefundParam> page, @RequestBody InsuranceRefundParam param) {
public R getInsuranceRefundPageList(Page<InsuranceRefundParam> page, @RequestBody InsuranceRefundParam param) {
return tInsuranceDetailService.getInsuranceRefundPageList(page,param);
}
......@@ -524,4 +524,71 @@ public class TInsuranceDetailController {
public R<IPage<InsuranceListByIdCardVo>> getInsuranceListByIdCard(Page page, String idCard,String deptNo) {
return new R<>(tInsuranceDetailService.getInsuranceListByIdCard(page, idCard,deptNo));
}
/**
* 订单商险新增
*
* @author zhaji
* @param paramList
* @return {@link R<List<InsuranceAddParam>>}
*/
@Operation(summary = "订单商险新增", description = "订单商险新增")
@PostMapping("/addOrderInsurance")
public R<List<InsuranceAddParam>> addOrderInsurance(@RequestBody InsuranceListOrderParam paramList ){
return tInsuranceDetailService.addOrderInsurance(paramList);
}
/**
* 订单商险批增
*
* @author zhaji
* @param paramList
* @return {@link R<List<InsuranceBatchParam>>}
*/
@Operation(summary = "订单商险批增", description = "订单商险批增")
@PostMapping("/batchOrderInsurance")
public R<List<InsuranceBatchParam>> batchOrderInsurance(@RequestBody InsuranceOrderBatchParam paramList){
return tInsuranceDetailService.batchOrderInsurance(paramList);
}
/**
* 订单商险替换
*
* @author zhaji
* @param paramList
* @return {@link R<List<InsuranceReplaceParam>>}
*/
@Operation(summary = "订单商险替换", description = "订单商险替换")
@PostMapping("/replaceOrderInsurance")
public R<List<InsuranceReplaceParam>> replaceOrderInsurance(@RequestBody InsuranceOrderReplaceParam paramList){
return tInsuranceDetailService.replaceOrderInsurance(paramList);
}
/**
* 订单商险减员
* @param paramList 订单商险减员
* @author zhaji
* @date 2022-07-19
* @since v1.0
*/
@PostMapping("/refundOrderInsurance")
public R refundOrderInsurance(@RequestBody InsuranceOrderRefundParam paramList){
return tInsuranceDetailService.refundOrderInsurance(paramList);
}
/**
* 订单商险列表查询
*
* @author zhaji
* @param page 分页参数
* @param param 查询条件
* @return {@link R<IPage<InsuredListVo>>}
*/
@Operation(summary = "订单商险列表查询", description = "订单商险列表查询")
@PostMapping("/getOrderInsuredListPage")
public R getOrderInsuredListPage(Page<InsuredOrderListVo> page, @RequestBody InsuredOrderParam param) {
return tInsuranceDetailService.getOrderInsuredListPage(page,param);
}
}
......@@ -197,7 +197,44 @@ public interface TInsuranceDetailMapper extends BaseMapper<TInsuranceDetail> {
*/
IPage<InsuranceListByIdCardVo> getInsuranceListByIdCard(Page<TInsuranceDetail> page, @Param("idCard") String idCard, @Param("deptNo")String deptNo);
List<TInsuranceDetail> selectListByempIdcardNo(String empIdcardNo);
/**
* 查询所有在保,未出险,未过期,未失效,未减员的保单信息
*
* @author zhaji
* @param empIdcardNo
* @return {@link List< TInsuranceDetail>}
*/
List<TInsuranceDetail> selectListByEmpIdcardNo(String empIdcardNo);
/**
* 查数据是否存在权限范围内
*
* @author zhaji
* @param regionSql
* @param id
* @return {@link TInsuranceDetail}
*/
TInsuranceDetail selectByRegionSql(@Param("regionSql") String regionSql, @Param("id") String id);
/**
* 商险订单投保列表查询
*
* @author zhaji
* @param page
* @param param
* @return {@link IPage< InsuredOrderListVo>}
*/
IPage<InsuredOrderListVo> getOrderInsuredListPage(Page<InsuredOrderListVo> page,@Param("param") InsuredOrderParam param);
/**
* 商险订单减员列表查询
*
* @author zhaji
* @param page
* @param param
* @return {@link IPage< InsuredOrderListVo>}
*/
IPage<InsuredOrderListVo> getOrderRefundInsuredListPage(Page<InsuredOrderListVo> page,@Param("param") InsuredOrderParam param);
TInsuranceDetail selectByregionSQL(@Param("regionSql") String regionSQL,@Param("id") String id);
}
......@@ -3,6 +3,7 @@ package com.yifu.cloud.plus.v1.yifu.insurances.mapper.insurances;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.yifu.cloud.plus.v1.yifu.insurances.entity.TInsuranceRefund;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
/**
* @author Administrator
......@@ -22,7 +23,7 @@ public interface TInsuranceRefundMapper extends BaseMapper<TInsuranceRefund> {
*/
TInsuranceRefund getByInsDetailId(String id);
void updateByInsDetailId(TInsuranceRefund insuranceRefund);
void updateByInsDetailId(@Param("param") TInsuranceRefund insuranceRefund);
int updateRefundMoney(TInsuranceRefund insuranceRefund);
}
......@@ -75,7 +75,7 @@ public interface TInsuranceDetailService extends IService<TInsuranceDetail> {
* @param paramList
* @return {@link R<List<InsuranceAddParam>>}
*/
R<List<InsuranceAddParam>> addInsurance(List<InsuranceAddParam> paramList);
R<List<InsuranceAddParam>> addInsurance(List<InsuranceAddParam> paramList,String orderNo);
/**
* 商险批增
......@@ -84,7 +84,7 @@ public interface TInsuranceDetailService extends IService<TInsuranceDetail> {
* @param paramList
* @return {@link R<List<InsuranceBatchParam>>}
*/
R<List<InsuranceBatchParam>> batchInsurance(List<InsuranceBatchParam> paramList);
R<List<InsuranceBatchParam>> batchInsurance(List<InsuranceBatchParam> paramList,String orderNo);
/**
* 商险替换
*
......@@ -92,7 +92,7 @@ public interface TInsuranceDetailService extends IService<TInsuranceDetail> {
* @param paramList
* @return {@link R<List<InsuranceReplaceParam>>}
*/
R<List<InsuranceReplaceParam>> replaceInsurance(List<InsuranceReplaceParam> paramList);
R<List<InsuranceReplaceParam>> replaceInsurance(List<InsuranceReplaceParam> paramList,String orderNo);
/**
* 通过id删除
......@@ -187,7 +187,7 @@ public interface TInsuranceDetailService extends IService<TInsuranceDetail> {
* @param insuranceRefundCheckList 减员表
* @return {@link R}
*/
R saveInsuranceRefund(List<InsuranceRefundCheck> insuranceRefundCheckList);
R saveInsuranceRefund(List<InsuranceRefundCheck> insuranceRefundCheckList,String orderNo);
/**
* 已投保列表分页查询
......@@ -354,4 +354,45 @@ public interface TInsuranceDetailService extends IService<TInsuranceDetail> {
* @return {@link R}
*/
IPage<InsuranceListByIdCardVo> getInsuranceListByIdCard(Page<TInsuranceDetail> page, String idCard,String deptNo);
/**
* 新增订单商险
*
* @author zhaji
* @param paramList
* @return {@link R< List< InsuranceReplaceParam>>}
*/
R<List<InsuranceAddParam>> addOrderInsurance(InsuranceListOrderParam paramList);
/**
* 批增订单商险
*
* @author zhaji
* @param paramList
* @return {@link R< List< InsuranceBatchParam>>}
*/
R<List<InsuranceBatchParam>> batchOrderInsurance(InsuranceOrderBatchParam paramList);
/**
* 替换订单商险
*
* @author zhaji
* @param paramList
* @return {@link R< List< InsuranceReplaceParam>>}
*/
R<List<InsuranceReplaceParam>> replaceOrderInsurance(InsuranceOrderReplaceParam paramList);
R refundOrderInsurance(InsuranceOrderRefundParam paramList);
/**
* 订单商险列表查询
*
* @author zhaji
* @param page
* @param param
* @return {@link IPage< InsuredOrderListVo>}
*/
R getOrderInsuredListPage(Page<InsuredOrderListVo> page, InsuredOrderParam param);
SettleVo getInsuranceDetailSettleStatus(String detailId, String defaultSettleId);
}
......@@ -56,12 +56,14 @@ public class TInsuranceEkpServiceImpl extends ServiceImpl<TInsuranceEkpMapper, T
List<TInsuranceEkp> ekpRefundList = this.baseMapper.getEkpRefundList();
List<TInsuranceEkp> failList = new ArrayList<>();
List<TInsuranceEkp> successLit = new ArrayList<>();
SettleVo settle = ekpSettleService.getSettle("12345");
String actualStatus = settle.getActualStatus();
log.info("settle:"+settle.toString());
log.info("actualStatus:"+actualStatus);
if (CollectionUtils.isNotEmpty(ekpRefundList)){
for (TInsuranceEkp tInsuranceEkp : ekpRefundList) {
//结算信息
SettleVo settleVo = tInsuranceDetailService.getInsuranceDetailSettleStatus(tInsuranceEkp.getDetailId(), tInsuranceEkp.getDefaultSettleId());
//实缴结算状态
String actualStatus = settleVo.getActualStatus();
//预缴结算状态
String estimateStatus = settleVo.getEstimateStatus();
Integer pushType = tInsuranceEkp.getPushType();
LambdaQueryWrapper<TInsuranceSettle> queryWrapper = new LambdaQueryWrapper<>();
queryWrapper.eq(TInsuranceSettle :: getId,tInsuranceEkp.getDefaultSettleId());
......@@ -80,10 +82,6 @@ public class TInsuranceEkpServiceImpl extends ServiceImpl<TInsuranceEkpMapper, T
}
EKPInteractiveParam ekpParam = new EKPInteractiveParam();
BeanCopyUtils.copyProperties(tInsuranceEkp,ekpParam);
String detailId = ekpParam.getDetailId();
String defaultSettleId = ekpParam.getDefaultSettleId();
//查询当前结算状态
String status = CommonConstants.ONE_STRING;
if(actualStatus.equals(InsurancesConstants.SETTLE_ZERO)){
String s = EKPUtil.sendToEKP(ekpParam);
//如果发送成功
......
......@@ -53,8 +53,10 @@
<result property="deleteFlag" column="DELETE_FLAG" jdbcType="TINYINT"/>
<result property="handledBy" column="HANDLED_BY" jdbcType="VARCHAR"/>
<result property="handledTime" column="HANDLED_TIME" jdbcType="TIMESTAMP"/>
<result property="orderNo" column="ORDER_NO" jdbcType="VARCHAR"/>
<result property="createUserDeptId" column="CREATE_USER_DEPT_ID" jdbcType="VARCHAR"/>
<result property="createUserDeptName" column="CREATE_USER_DEPT_NAME" jdbcType="VARCHAR"/>
</resultMap>
<sql id="Base_Column_List">
ID,EMP_NAME,
EMP_IDCARD_NO,DEPT_NO,POST,INSURANCE_COMPANY_NAME,INSURANCE_TYPE_NAME,
......@@ -67,7 +69,8 @@
BUY_HANDLE_STATUS,DEFAULT_SETTLE_ID,REDUCE_HANDLE_STATUS,
IS_USE,IS_EFFECT,IS_OVERDUE,REMARK,
CREATE_BY,CREATE_NAME,CREATE_TIME,
UPDATE_BY,UPDATE_TIME,DELETE_FLAG,DEFAULT_SETTLE_ID,HANDLED_BY,HANDLED_TIME
UPDATE_BY,UPDATE_TIME,DELETE_FLAG,DEFAULT_SETTLE_ID,HANDLED_BY,HANDLED_TIME,ORDER_NO,CREATE_USER_DEPT_ID,CREATE_USER_DEPT_NAME
</sql>
<!--投保分页查询-->
<select id="getInsuranceListPage" resultType="com.yifu.cloud.plus.v1.yifu.insurances.vo.InsuranceListVO">
......@@ -86,12 +89,16 @@
detail.CREATE_NAME as createName,
detail.BUY_HANDLE_STATUS as buyHandleStatus,
detail.SETTLE_TYPE as settleType,
detail.CREATE_USER_DEPT_NAME as createUserDeptName,
detail.SETTLE_MONTH as settleMonth
from t_insurance_detail detail
where detail.DELETE_FLAG = 0
<if test="param.deptNo != null and param.deptNo.trim() != ''">
and detail.DEPT_NO = #{param.deptNo}
</if>
<if test="param.orderNo != null and param.orderNo.trim() != ''">
and detail.DEPT_NO = #{param.orderNo}
</if>
<if test="param.deptNo == null or param.deptNo.trim() == ''">
and detail.DEPT_NO in
<foreach collection="param.deptNoList" index="index" item="item" open="(" separator="," close=")">
......@@ -130,7 +137,6 @@
</if>
ORDER BY detail.BUY_HANDLE_STATUS,detail.CREATE_TIME DESC
</select>
<!--投保不分页查询-->
<select id="getInsuranceList" resultType="com.yifu.cloud.plus.v1.yifu.insurances.vo.InsuranceListVO">
select detail.id as id,
......@@ -192,7 +198,6 @@
</if>
ORDER BY detail.BUY_HANDLE_STATUS,detail.CREATE_TIME DESC
</select>
<!--投保办理分页查询-->
<select id="getInsuranceHandleListPage" resultType="com.yifu.cloud.plus.v1.yifu.insurances.vo.InsuranceListVO">
select detail.id as id,
......@@ -253,7 +258,6 @@
</if>
ORDER BY detail.BUY_HANDLE_STATUS,detail.CREATE_TIME DESC
</select>
<select id="getInsuranceDetailById" resultType="com.yifu.cloud.plus.v1.yifu.insurances.vo.InsuranceDetailVO">
select
detail.id as id,
......@@ -385,13 +389,11 @@
</if>
ORDER BY detail.CREATE_TIME DESC
</select>
<update id="updatePolicyNoBatch">
<foreach collection="details" index="index" item="item" separator=";">
update t_insurance_detail set POLICY_NO = #{item.policyNo} where ID = #{item.id}
</foreach>
</update>
<update id="updateInvoiceNoBatch">
<foreach collection="details" index="index" item="item" separator=";">
update t_insurance_detail set INVOICE_NO = #{item.invoiceNo} where ID = #{item.id}
......@@ -417,6 +419,7 @@
detail.IS_OVERDUE as isOverdue,
detail.INSURANCE_COMPANY_NAME as insuranceCompanyName,
detail.INSURANCE_TYPE_NAME as insuranceTypeName,
detail.CREATE_USER_DEPT_NAME as createUserDeptName,
detail.BUY_STANDARD as buyStandard
from
t_insurance_detail detail
......@@ -574,6 +577,7 @@
detail.POLICY_START as policyStart,
detail.POLICY_END as policyEnd,
detail.POLICY_NO as policyNo,
refund.CREATE_USER_DEPT_NAME as createUserDeptName,
refund.CREATE_TIME as refundCreateTime
from
t_insurance_detail detail,
......@@ -900,7 +904,7 @@
</where>
ORDER BY CREATE_TIME desc
</select>
<select id="selectListByempIdcardNo" resultType="com.yifu.cloud.plus.v1.yifu.insurances.entity.TInsuranceDetail">
<select id="selectListByEmpIdcardNo" resultType="com.yifu.cloud.plus.v1.yifu.insurances.entity.TInsuranceDetail">
SELECT
<include refid="Base_Column_List"/>
FROM
......@@ -916,7 +920,8 @@
</where>
ORDER BY CREATE_TIME desc
</select>
<select id="selectByregionSQL" resultType="com.yifu.cloud.plus.v1.yifu.insurances.entity.TInsuranceDetail">
<!--查数据是否存在权限范围内-->
<select id="selectByRegionSql" resultType="com.yifu.cloud.plus.v1.yifu.insurances.entity.TInsuranceDetail">
SELECT
<include refid="Base_Column_List"/>
FROM
......@@ -929,4 +934,130 @@
</where>
ORDER BY CREATE_TIME desc
</select>
<!--商险订单减员列表查询-->
<select id="getOrderRefundInsuredListPage" resultType="com.yifu.cloud.plus.v1.yifu.insurances.vo.InsuredOrderListVo">
(
select
detail.id as id,
detail.BUY_TYPE as buyType,
detail.EMP_NAME as empName,
detail.EMP_IDCARD_NO as empIdcardNo,
detail.INSURANCE_COMPANY_NAME as insuranceCompanyName,
detail.INSURANCE_TYPE_NAME as insuranceTypeName,
detail.BUY_STANDARD as buyStandard,
detail.MEDICAL_QUOTA as medicalQuota,
detail.DIE_DISABLE_QUOTA as dieDisableQuota,
detail.CREATE_NAME as createName,
detail.CREATE_USER_DEPT_NAME as createUserDeptName,
detail.CREATE_TIME as createTime,
detail.BUY_HANDLE_STATUS as buyHandleStatus,
detail.REDUCE_HANDLE_STATUS as reduceHandleStatus
from
t_insurance_detail detail
where
detail.DELETE_FLAG = 0
and
detail.ORDER_NO = #{param.orderNo}
<if test="param.empName != null and param.empName.trim() != ''">
and detail.EMP_NAME like concat('%',replace(replace(#{param.empName},'_','\_'),'%','\%'),'%')
</if>
<if test="param.empIdcardNo != null and param.empIdcardNo.trim() != ''">
and detail.EMP_IDCARD_NO like concat('%',replace(replace(#{param.empIdcardNo},'_','\_'),'%','\%'),'%')
</if>
<if test="param.startDate != null and param.startDate.trim() != ''">
AND detail.CREATE_TIME <![CDATA[ >= ]]> concat(#{param.startDate}, '00:00:00')
</if>
<if test="param.endDate != null and param.endDate.trim() != ''">
AND detail.CREATE_TIME <![CDATA[ <= ]]> concat(#{param.endDate}, ' 23:59:59')
</if>
<if test="param.deptNoList != null">
and detail.DEPT_NO in
<foreach collection="param.deptNoList" index="index" item="item" open="(" separator="," close=")">
#{item}
</foreach>
</if>)
union all(
select
detail.id as id,
detail.BUY_TYPE as buyType,
detail.EMP_NAME as empName,
detail.EMP_IDCARD_NO as empIdcardNo,
detail.INSURANCE_COMPANY_NAME as insuranceCompanyName,
detail.INSURANCE_TYPE_NAME as insuranceTypeName,
detail.BUY_STANDARD as buyStandard,
detail.MEDICAL_QUOTA as medicalQuota,
detail.DIE_DISABLE_QUOTA as dieDisableQuota,
refund.CREATE_NAME as createName,
refund.CREATE_USER_DEPT_NAME as createUserDeptName,
refund.CREATE_TIME as createTime,
detail.BUY_HANDLE_STATUS as buyHandleStatus,
refund.REDUCE_HANDLE_STATUS as reduceHandleStatus
from
t_insurance_detail detail,
t_insurance_refund refund
where
detail.DELETE_FLAG = 0
and
refund.ORDER_NO = #{param.orderNo}
<if test="param.empName != null and param.empName.trim() != ''">
and detail.EMP_NAME like concat('%',replace(replace(#{param.empName},'_','\_'),'%','\%'),'%')
</if>
<if test="param.empIdcardNo != null and param.empIdcardNo.trim() != ''">
and detail.EMP_IDCARD_NO like concat('%',replace(replace(#{param.empIdcardNo},'_','\_'),'%','\%'),'%')
</if>
<if test="param.startDate != null and param.startDate.trim() != ''">
AND refund.CREATE_TIME <![CDATA[ >= ]]> concat(#{param.startDate}, '00:00:00')
</if>
<if test="param.endDate != null and param.endDate.trim() != ''">
AND refund.CREATE_TIME <![CDATA[ <= ]]> concat(#{param.endDate}, ' 23:59:59')
</if>
<if test="param.deptNoList != null">
and detail.DEPT_NO in
<foreach collection="param.deptNoList" index="index" item="item" open="(" separator="," close=")">
#{item}
</foreach>
</if>
)order by createTime desc
</select>
<select id="getOrderInsuredListPage" resultType="com.yifu.cloud.plus.v1.yifu.insurances.vo.InsuredOrderListVo">
select
detail.id as id,
detail.BUY_TYPE as buyType,
detail.EMP_NAME as empName,
detail.EMP_IDCARD_NO as empIdcardNo,
detail.INSURANCE_COMPANY_NAME as insuranceCompanyName,
detail.INSURANCE_TYPE_NAME as insuranceTypeName,
detail.BUY_STANDARD as buyStandard,
detail.MEDICAL_QUOTA as medicalQuota,
detail.DIE_DISABLE_QUOTA as dieDisableQuota,
detail.CREATE_NAME as createName,
detail.CREATE_USER_DEPT_NAME as createUserDeptName,
detail.CREATE_TIME as createTime,
detail.BUY_HANDLE_STATUS as buyHandleStatus
from
t_insurance_detail detail
where
detail.DELETE_FLAG = 0
and
detail.ORDER_NO = #{param.orderNo}
<if test="param.empName != null and param.empName.trim() != ''">
and detail.EMP_NAME like concat('%',replace(replace(#{param.empName},'_','\_'),'%','\%'),'%')
</if>
<if test="param.empIdcardNo != null and param.empIdcardNo.trim() != ''">
and detail.EMP_IDCARD_NO like concat('%',replace(replace(#{param.empIdcardNo},'_','\_'),'%','\%'),'%')
</if>
<if test="param.startDate != null and param.startDate.trim() != ''">
AND detail.CREATE_TIME <![CDATA[ >= ]]> concat(#{param.startDate}, '00:00:00')
</if>
<if test="param.endDate != null and param.endDate.trim() != ''">
AND detail.CREATE_TIME <![CDATA[ <= ]]> concat(#{param.endDate}, ' 23:59:59')
</if>
<if test="param.deptNoList != null">
and detail.DEPT_NO in
<foreach collection="param.deptNoList" index="index" item="item" open="(" separator="," close=")">
#{item}
</foreach>
</if>
</select>
</mapper>
......@@ -13,26 +13,51 @@
<result property="createTime" column="CREATE_TIME" jdbcType="TIMESTAMP"/>
<result property="createBy" column="CREATE_BY" jdbcType="VARCHAR"/>
<result property="createName" column="CREATE_NAME" jdbcType="VARCHAR"/>
</resultMap>
<result property="createBy" column="CREATE_BY" jdbcType="VARCHAR"/>
<result property="orderNo" column="ORDER_NO" jdbcType="VARCHAR"/>
<result property="createUserDeptId" column="CREATE_USER_DEPT_ID" jdbcType="VARCHAR"/>
<result property="createUserDeptName" column="CREATE_USER_DEPT_NAME" jdbcType="VARCHAR"/>
</resultMap>
<sql id="Base_Column_List">
ID,INS_DETAIL_ID,REDUCE_HANDLE_STATUS,
REFUND_MONEY,REMARK,CREATE_TIME,
CREATE_BY,CREATE_NAME
CREATE_BY,CREATE_NAME,ORDER_NO,CREATE_USER_DEPT_ID,CREATE_USER_DEPT_NAME
</sql>
<update id="updateByInsDetailId">
update
t_insurance_refund
set
REDUCE_HANDLE_STATUS = #{reduceHandleStatus},
REMARK = #{remark},
CREATE_NAME= #{createName},
CREATE_BY = #{createBy},
CREATE_TIME = #{createTime},
UPDATE_BY = #{createBy},
UPDATE_TIME = #{createTime}
<if test="param.createName != null and param.createName.trim() != ''">
CREATE_NAME= #{param.createName},
</if>
<if test="param.createBy != null and param.createBy.trim() != ''">
CREATE_BY = #{param.createBy},
</if>
<if test="param.createTime != null">
CREATE_TIME = #{param.createTime},
</if>
<if test="param.updateBy != null and param.updateBy.trim() != ''">
UPDATE_BY = #{param.updateBy},
</if>
<if test="param.updateTime != null ">
UPDATE_TIME = #{param.updateTime},
</if>
<if test="param.createUserDeptName != null and param.createUserDeptName.trim() != ''">
CREATE_USER_DEPT_NAME= #{param.createUserDeptName},
</if>
<if test="param.createUserDeptId != null and param.createUserDeptId.trim() != ''">
CREATE_USER_DEPT_ID = #{param.createUserDeptId},
</if>
<if test="param.orderNo != null and param.orderNo.trim() != ''">
ORDER_NO = #{param.orderNo},
</if>
<if test="param.remark != null and param.remark.trim() != ''">
REMARK = #{param.remark},
</if>
REDUCE_HANDLE_STATUS = #{param.reduceHandleStatus}
where
INS_DETAIL_ID = #{insDetailId}
INS_DETAIL_ID = #{param.insDetailId}
</update>
<update id="updateRefundMoney">
update
......
......@@ -32,6 +32,7 @@ import org.hibernate.validator.constraints.Length;
import javax.validation.constraints.NotBlank;
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
/**
......@@ -358,6 +359,30 @@ public class TSalaryAccount extends BaseEntity {
@ExcelProperty("个税-单位承担")
private BigDecimal salaryTaxUnit;
@ExcelAttribute(name = "发送状态:0未发送,1已发送")
@ExcelProperty("发送状态:0未发送,1已发送")
private String sendStatus;
@ExcelAttribute(name = "发送月份")
@ExcelProperty("发送月份")
private String sendMonth;
@ExcelAttribute(name = "发送时间")
@ExcelProperty("发送时间")
private Date sendTime;
@ExcelAttribute(name = "发送人id")
@ExcelProperty("发送人id")
private String sendUser;
@ExcelAttribute(name = "发送人姓名")
@ExcelProperty("发送人姓名")
private String sendUserName;
@ExcelAttribute(name = "发送返回的EKPID")
@ExcelProperty("发送返回的EKPID")
private String ekpId;
@TableField(exist = false)
private List<TSalaryAccountItem> saiList = new ArrayList<>(); //工资组成部分明细
......
......@@ -22,6 +22,11 @@
<groupId>com.yifu.cloud.plus.v1</groupId>
<artifactId>yifu-common-seata</artifactId>
</dependency>
<dependency>
<groupId>com.yifu.cloud.plus.v1</groupId>
<artifactId>yifu-common-ekp</artifactId>
<version>1.0.0</version>
</dependency>
<dependency>
<groupId>com.yifu.cloud.plus.v1</groupId>
<artifactId>yifu-salary-api</artifactId>
......
......@@ -78,13 +78,13 @@ public class SysMessageSalaryController {
@Operation(description = "生成最低工资提醒")
@GetMapping("/inner/createSysMessageSalary")
public void createSysMessageSalary() {
//结算月
String settleMonth = DateUtil.addMonth(-1);
//薪资月份
String salaryMonth = DateUtil.addMonth(-1);
//1:删除当前结算月数据:
sysMessageSalaryService.deleteAllBySettleMonth(settleMonth);
sysMessageSalaryService.deleteAllBySettleMonth(salaryMonth);
//2:开始生成:
//2.1:普通工资
sysMessageSalaryService.insertSalaryBySettleMonth(settleMonth);
sysMessageSalaryService.insertSalaryBySettleMonth(salaryMonth);
}
/**
......@@ -114,7 +114,7 @@ public class SysMessageSalaryController {
@Operation(description = "最低工资提醒导出")
@PostMapping("/export")
public void export(HttpServletResponse response,
SysMessageSalarySearchVo searchVo) {
@RequestBody SysMessageSalarySearchVo searchVo) {
sysMessageSalaryService.listExport(response,searchVo);
}
......
......@@ -128,7 +128,7 @@ public class THaveSalaryNosocialController {
@Operation(description = "有工资无社保消息提醒导出")
@PostMapping("/export")
public void export(HttpServletResponse response,
THaveSalaryNosocialSearchVo searchVo) {
@RequestBody THaveSalaryNosocialSearchVo searchVo) {
tHaveSalaryNosocialService.listExport(response,searchVo);
}
......@@ -159,8 +159,8 @@ public class THaveSalaryNosocialController {
@Inner
@PostMapping("/inner/generate")
public void generate() {
String settleMonth = DateUtil.addMonth(-1);
tHaveSalaryNosocialService.generate(settleMonth);
String salaryMonth = DateUtil.addMonth(-1);
tHaveSalaryNosocialService.generate(salaryMonth);
}
}
......@@ -207,4 +207,17 @@ public class TSalaryStandardController {
return R.failed("请传参!");
}
}
/**
* @param id 主键
* @Description: 发送至EKP
* @Author: hgw
* @Date: 2022/8/26 11:40
* @return: com.yifu.cloud.plus.v1.yifu.common.core.util.R
**/
@Operation(description = "发送至EKP")
@PostMapping("/doSend")
public R<String> doSend(@RequestParam String id) {
return tSalaryStandardService.doSend(id);
}
}
......@@ -20,6 +20,7 @@ package com.yifu.cloud.plus.v1.yifu.salary.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yifu.cloud.plus.v1.yifu.ekp.vo.EkpSalaryParamVo;
import com.yifu.cloud.plus.v1.yifu.salary.entity.THaveSalaryNosocial;
import com.yifu.cloud.plus.v1.yifu.salary.entity.TSalaryAccount;
import com.yifu.cloud.plus.v1.yifu.salary.vo.AccountCheckVo;
......@@ -89,6 +90,15 @@ public interface TSalaryAccountMapper extends BaseMapper<TSalaryAccount> {
**/
List<String> getAccountYearCheckList();
/**
* @param salaryId
* @Description: 获取薪资明细
* @Author: hgw
* @Date: 2022/8/29 16:52
* @return: java.util.List<com.yifu.cloud.plus.v1.yifu.ekp.vo.EkpSalaryParam>
**/
List<EkpSalaryParamVo> getEkpSalaryParamList(@Param("salaryId") String salaryId);
List<TSalaryAccount> noPageDiy(@Param("searchVo") TSalaryAccountSearchVo searchVo,
@Param("idList")List<String> idList);
......
......@@ -20,6 +20,7 @@ package com.yifu.cloud.plus.v1.yifu.salary.service;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import com.yifu.cloud.plus.v1.yifu.ekp.vo.EkpSalaryParamVo;
import com.yifu.cloud.plus.v1.yifu.salary.entity.THaveSalaryNosocial;
import com.yifu.cloud.plus.v1.yifu.salary.entity.TSalaryAccount;
import com.yifu.cloud.plus.v1.yifu.salary.vo.TSalaryAccountSearchVo;
......@@ -86,4 +87,13 @@ public interface TSalaryAccountService extends IService<TSalaryAccount> {
* @return:
**/
List<String> getAccountYearCheckMap();
/**
* @param salaryId
* @Description: 获取薪资数据
* @Author: hgw
* @Date: 2022/8/29 16:54
* @return: java.util.List<com.yifu.cloud.plus.v1.yifu.ekp.vo.EkpSalaryParam>
**/
List<EkpSalaryParamVo> getEkpSalaryParamList(String salaryId);
}
......@@ -74,5 +74,14 @@ public interface TSalaryStandardService extends IService<TSalaryStandard> {
**/
R<String> deleteSalaryById(String id);
/**
* @param id
* @Description: 推送至ekp
* @Author: hgw
* @Date: 2022/8/26 11:56
* @return: com.yifu.cloud.plus.v1.yifu.common.core.util.R<java.lang.String>
**/
R<String> doSend(String id);
IPage<TSalaryStandard> getTSalaryStandardPageApply(Page<TSalaryStandard> page, TSalaryStandardSearchVo tSalaryStandard);
}
......@@ -13,18 +13,17 @@ import com.yifu.cloud.plus.v1.yifu.common.dapr.config.DaprArchivesProperties;
import com.yifu.cloud.plus.v1.yifu.common.dapr.config.DaprSocialProperties;
import com.yifu.cloud.plus.v1.yifu.common.dapr.util.HttpDaprUtil;
import com.yifu.cloud.plus.v1.yifu.common.security.util.SecurityUtils;
import com.yifu.cloud.plus.v1.yifu.salary.constants.SalaryConstants;
import com.yifu.cloud.plus.v1.yifu.salary.entity.*;
import com.yifu.cloud.plus.v1.yifu.salary.mapper.TSalaryStandardMapper;
import com.yifu.cloud.plus.v1.yifu.salary.service.*;
import com.yifu.cloud.plus.v1.yifu.salary.util.SalaryAccountUtil;
import com.yifu.cloud.plus.v1.yifu.salary.util.SalaryConstants;
import com.yifu.cloud.plus.v1.yifu.salary.vo.*;
import lombok.AllArgsConstructor;
import lombok.extern.log4j.Log4j2;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.bind.annotation.RequestParam;
import java.math.BigDecimal;
import java.net.URLDecoder;
......
......@@ -150,12 +150,12 @@ public class SysMessageSalaryServiceImpl extends ServiceImpl<SysMessageSalaryMap
**/
@Override
public void listExport(HttpServletResponse response, SysMessageSalarySearchVo searchVo) {
String fileName = "最低工资提醒查询批量导出" + DateUtil.getThisTime() + ".xlsx";
String fileName = "最低工资提醒批量导出" + DateUtil.getThisTime() + ".xlsx";
//获取要导出的列表
List<SysMessageSalaryExportVo> list = new ArrayList<>();
// TODO
List<String> settleDomainIds =null;
List<String> ids = null;
List<String> ids = Common.getList(searchVo.getIds());
String sql = null;
int count = noPageCountDiy(searchVo,settleDomainIds,ids,sql);
ServletOutputStream out = null;
......
......@@ -115,17 +115,17 @@ public class THaveSalaryNosocialServiceImpl extends ServiceImpl<THaveSalaryNosoc
* * 4.生成记录
**/
@Override
public void generate(String settleMonth) {
public void generate(String salaryMonth) {
//重新跑上月数据
this.remove(Wrappers.<THaveSalaryNosocial>query().lambda().eq(THaveSalaryNosocial::getSettleMonth,settleMonth));
List<THaveSalaryNosocial> haveSalaryNosocialList = salaryAccountService.getLastMonthTHaveSalaryNosocial(settleMonth);
this.remove(Wrappers.<THaveSalaryNosocial>query().lambda().eq(THaveSalaryNosocial::getMonth,salaryMonth));
List<THaveSalaryNosocial> haveSalaryNosocialList = salaryAccountService.getLastMonthTHaveSalaryNosocial(salaryMonth);
if(!Common.isNotEmpty(haveSalaryNosocialList)){
log.error("获取上月有社保无工资数据为空");
log.error("获取有社保无工资数据为空");
return;
}
//去缴费库查询查询这些人社保是否存在
Map<String, TPaymentInfo> empPaymentInfoMap=Maps.newHashMap();
R<HaveSalaryNoSocialVo> noSocialVoR = socialDaprUtils.getPaymentinfoListByEmpdIdCard(Common.listObjectToStrList(haveSalaryNosocialList, "employeeIdCard"), settleMonth);
R<HaveSalaryNoSocialVo> noSocialVoR = socialDaprUtils.getPaymentinfoListByEmpdIdCard(Common.listObjectToStrList(haveSalaryNosocialList, "employeeIdCard"), salaryMonth);
if (Common.isNotNull(noSocialVoR)&& Common.isNotNull(noSocialVoR.getData())) {
for (TPaymentInfo paymentInfo : noSocialVoR.getData().getPaymentInfos()) {
empPaymentInfoMap.put(paymentInfo.getEmpIdcard(),paymentInfo);
......@@ -191,7 +191,7 @@ public class THaveSalaryNosocialServiceImpl extends ServiceImpl<THaveSalaryNosoc
**/
@Override
public void listExport(HttpServletResponse response, THaveSalaryNosocialSearchVo searchVo) {
String fileName = "有工资无社保查询批量导出" + DateUtil.getThisTime() + ".xlsx";
String fileName = "有工资无社保批量导出" + DateUtil.getThisTime() + ".xlsx";
//获取要导出的列表
List<THaveSalaryNoSocialExportVo> list = new ArrayList<>();
// TODO
......
......@@ -57,7 +57,6 @@ public class TMinSalaryServiceImpl extends ServiceImpl<TMinSalaryMapper, TMinSal
if (Common.isEmpty(tMinSalary.getTown())){
query.isNull(TMinSalary::getTown);
}
query.eq(TMinSalary::getStatus, CommonConstants.ONE_INT);
long res = baseMapper.selectCount(query);
if (res > CommonConstants.ZERO_INT){
return R.failed("已存在对应区域在用的配置信息");
......@@ -88,7 +87,6 @@ public class TMinSalaryServiceImpl extends ServiceImpl<TMinSalaryMapper, TMinSal
query.isNull(TMinSalary::getTown);
}
query.ne(TMinSalary::getId,tMinSalary.getId());
query.eq(TMinSalary::getStatus, CommonConstants.ONE_INT);
long res = baseMapper.selectCount(query);
if (res > CommonConstants.ZERO_INT){
return R.failed("已存在对应区域在用的配置信息");
......
......@@ -19,15 +19,14 @@ package com.yifu.cloud.plus.v1.yifu.salary.service.impl;
import com.alibaba.excel.EasyExcel;
import com.alibaba.excel.ExcelWriter;
import com.alibaba.excel.write.metadata.WriteSheet;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.CommonConstants;
import com.yifu.cloud.plus.v1.yifu.common.core.util.Common;
import com.yifu.cloud.plus.v1.yifu.common.core.util.DateUtil;
import com.yifu.cloud.plus.v1.yifu.common.core.util.ExcelUtil;
import com.yifu.cloud.plus.v1.yifu.ekp.vo.EkpSalaryParamVo;
import com.yifu.cloud.plus.v1.yifu.salary.entity.THaveSalaryNosocial;
import com.yifu.cloud.plus.v1.yifu.salary.entity.TSalaryAccount;
import com.yifu.cloud.plus.v1.yifu.salary.mapper.TSalaryAccountMapper;
......@@ -192,12 +191,18 @@ public class TSalaryAccountServiceImpl extends ServiceImpl<TSalaryAccountMapper,
@Override
public List<THaveSalaryNosocial> getLastMonthTHaveSalaryNosocial(String month) {
return baseMapper.getLastMonthTHaveSalaryNosocial(month,
DateUtil.getYearAndMonth(month,CommonConstants.ONE_INT),
DateUtil.getYearAndMonth(month,CommonConstants.TWO_INT));
DateUtil.getYearAndMonth(month,-CommonConstants.ONE_INT),
DateUtil.getYearAndMonth(month,-CommonConstants.TWO_INT));
}
@Override
public List<String> getAccountYearCheckMap() {
return baseMapper.getAccountYearCheckList();
}
@Override
public List<EkpSalaryParamVo> getEkpSalaryParamList(String salaryId) {
return baseMapper.getEkpSalaryParamList(salaryId);
}
}
......@@ -36,7 +36,9 @@ import com.yifu.cloud.plus.v1.yifu.common.core.vo.YifuUser;
import com.yifu.cloud.plus.v1.yifu.common.dapr.config.DaprSocialProperties;
import com.yifu.cloud.plus.v1.yifu.common.dapr.util.HttpDaprUtil;
import com.yifu.cloud.plus.v1.yifu.common.security.util.SecurityUtils;
import com.yifu.cloud.plus.v1.yifu.salary.constants.SalaryConstants;
import com.yifu.cloud.plus.v1.yifu.ekp.util.EkpSalaryUtil;
import com.yifu.cloud.plus.v1.yifu.ekp.vo.EkpSalaryParam;
import com.yifu.cloud.plus.v1.yifu.ekp.vo.EkpSalaryParamVo;
import com.yifu.cloud.plus.v1.yifu.salary.entity.MSalaryEstimate;
import com.yifu.cloud.plus.v1.yifu.salary.entity.TApprovalRecord;
import com.yifu.cloud.plus.v1.yifu.salary.entity.TSalaryAccount;
......@@ -46,10 +48,12 @@ import com.yifu.cloud.plus.v1.yifu.salary.service.MSalaryEstimateService;
import com.yifu.cloud.plus.v1.yifu.salary.service.TApprovalRecordService;
import com.yifu.cloud.plus.v1.yifu.salary.service.TSalaryAccountService;
import com.yifu.cloud.plus.v1.yifu.salary.service.TSalaryStandardService;
import com.yifu.cloud.plus.v1.yifu.salary.util.SalaryConstants;
import com.yifu.cloud.plus.v1.yifu.salary.vo.TSalaryStandardExportVo;
import com.yifu.cloud.plus.v1.yifu.salary.vo.TSalaryStandardSearchVo;
import com.yifu.cloud.plus.v1.yifu.salary.vo.TSalaryStandardVo;
import lombok.extern.log4j.Log4j2;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.stereotype.Service;
......@@ -60,6 +64,7 @@ import java.io.IOException;
import java.io.InputStream;
import java.net.URLEncoder;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
/**
......@@ -85,6 +90,9 @@ public class TSalaryStandardServiceImpl extends ServiceImpl<TSalaryStandardMappe
@Autowired
private DaprSocialProperties socialProperties;
@Autowired
private EkpSalaryUtil ekpSalaryUtil;
/**
* 标准薪酬工资表简单分页查询
*
......@@ -402,4 +410,60 @@ public class TSalaryStandardServiceImpl extends ServiceImpl<TSalaryStandardMappe
return R.failed("id 不可为空");
}
@Override
public R<String> doSend(String id) {
TSalaryStandard s = this.getById(id);
if (s == null) {
return R.failed("未找到工资表");
} else if (s.getStatus() == SalaryConstants.STATUS[2] || s.getStatus() == SalaryConstants.STATUS[10]) {
//报账表
List<EkpSalaryParamVo> ekpList = salaryAccountService.getEkpSalaryParamList(id);
YifuUser user = SecurityUtils.getUser();
if (user != null && ekpList != null && !ekpList.isEmpty()) {
boolean sendStatus = true;
String sendBack;
List<TSalaryAccount> accountList = new ArrayList<>();
TSalaryAccount account;
Date sendTime = new Date();
String nowMonth = DateUtil.addMonth(0);
EkpSalaryParam sendParam;
for (EkpSalaryParamVo sendParamVo : ekpList) {
// 转化报账表的参数
account = new TSalaryAccount();
account.setId(sendParamVo.getSalaryAccountId());
sendParam = new EkpSalaryParam();
BeanUtils.copyProperties(sendParamVo, sendParam);
sendBack = ekpSalaryUtil.sendToEKP(sendParam);
account.setSendTime(sendTime);
account.setSendUser(user.getId());
account.setSendUserName(user.getNickname());
if (Common.isNotNull(sendBack) && sendBack.length() == 32) {
account.setSendStatus(CommonConstants.ONE_STRING);
account.setSendMonth(nowMonth);
account.setEkpId(sendBack);
} else {
sendStatus = false;
}
accountList.add(account);
}
salaryAccountService.updateBatchById(accountList);
if (sendStatus) {
s.setSendTime(new Date());
s.setSendMonth(DateUtil.addMonth(0));
s.setStatus(SalaryConstants.STATUS[3]);
this.updateById(s);
return R.ok("发送成功!");
} else {
s.setStatus(SalaryConstants.STATUS[10]);
this.updateById(s);
return R.ok("发送失败!");
}
} else {
return R.failed("请登录!");
}
} else {
return R.failed("请刷新后检查薪资表状态!");
}
}
}
......@@ -269,13 +269,17 @@ public class TStatisticsBonusServiceImpl extends ServiceImpl<TStatisticsBonusMap
}
sumDeductSalary = BigDecimalUtils.safeAdd(sdSum,isTax,costReduction);
//年终奖单独扣税
finalSalaryNoSalary = calculationSalary(annousTax,infoVo.getAnnualBonus());
//年终奖合并扣税
if (isSend) {
//年终奖单独扣税
finalSalaryNoSalary = calculationSalary(annousTax,infoVo.getAnnualBonus());
wSalary = infoVo.getAnnualBonus();
finalSalaryWithSalary = finalSalaryNoSalary;
} else {
//年终奖单独扣税
finalSalaryNoSalary = calculationSalary(annousTax,infoVo.getAnnualBonus());
BigDecimal annualTSalary = calculationSalaryT(personTax,infoVo.getAnnualTSalary(),sumTax);
finalSalaryNoSalary = BigDecimalUtils.safeAdd(finalSalaryNoSalary,annualTSalary);
wSalary = BigDecimalUtils.safeAdd(infoVo.getAnnualBonus(), infoVo.getAnnualTSalary());
finalSalaryWithSalary = calculationSalary(annousTax, wSalary);
}
......@@ -516,6 +520,32 @@ public class TStatisticsBonusServiceImpl extends ServiceImpl<TStatisticsBonusMap
return anRes;
}
/**
* @param personTax 薪资扣税阶梯表list
* @param annualSalary 年终奖
* @Description: 计算薪资扣税-个税
* @Author: huyc
* @Date: 2022/8/23
* @return: java.math.BigDecimal
**/
private static BigDecimal calculationSalaryT(List<TSalaryTaxConfig> personTax, BigDecimal annualSalary, BigDecimal sumTax) {
//本次年终奖纳税额
BigDecimal res = BigDecimal.ZERO;
//计算年终奖税
//计算个税
for (TSalaryTaxConfig sub : personTax) {
if (annualSalary.compareTo(sub.getMinIncome()) == SalaryConstants.MORE_THAN
&& annualSalary.compareTo(sub.getMaxIncome()) != SalaryConstants.MORE_THAN) {
//annualSalary = realDeduSalary * ((double) ((annualSalary.getTaxRate() * 1.0) / 100)) - sumTax - sub.getQuick();
res = annualSalary.multiply(new BigDecimal(sub.getWithholdingRate()).divide(
SalaryConstants.B_ONEHUNDRED, SalaryConstants.PLACES, BigDecimal.ROUND_HALF_UP))
.subtract(sumTax).subtract(sub.getQuickDeducation());// 应纳税额
break;
}
}
return res;
}
@Override
public List<TStatisticsBonus> noPageDiy(TStatisticsBonusSearchVo searchVo) {
LambdaQueryWrapper<TStatisticsBonus> wrapper = buildQueryWrapper(searchVo);
......
......@@ -158,7 +158,7 @@ public class TStatisticsDeclarerServiceImpl extends ServiceImpl<TStatisticsDecla
baseMapper.updateById(tStatisticsDeclarer);
return R.ok();
}
return R.failed(CommonConstants.PARAM_IS_NOT_ERROR);
return R.failed(CommonConstants.PARAM_IS_NOT_ERROR);
}
@Override
......@@ -274,16 +274,18 @@ public class TStatisticsDeclarerServiceImpl extends ServiceImpl<TStatisticsDecla
}
//根据身份证号和申报月份查找申报人员
TStatisticsDeclarer tStatisticsDeclarer = baseMapper.selectOne(Wrappers.<TStatisticsDeclarer>query().lambda()
List<TStatisticsDeclarer> declarerList = baseMapper.selectList(Wrappers.<TStatisticsDeclarer>query().lambda()
.eq(TStatisticsDeclarer::getEmpIdcard, excel.getEmpIdcard())
.eq(TStatisticsDeclarer::getDeclareMonth, excel.getDeclareMonth())
.last(CommonConstants.LAST_ONE_SQL));
if (Common.isNotNull(tStatisticsDeclarer)) {
tStatisticsDeclarer.setIsDeclare(excel.getIsDeclare());
if (Common.isNotNull(excel.getUndeclareReason())) {
tStatisticsDeclarer.setUndeclareReason(excel.getUndeclareReason());
.eq(TStatisticsDeclarer::getEmpName, excel.getEmpName()));
if (Common.isNotNull(declarerList)) {
for (TStatisticsDeclarer tStatisticsDeclarer: declarerList) {
tStatisticsDeclarer.setIsDeclare(excel.getIsDeclare());
if (Common.isNotNull(excel.getUndeclareReason())) {
tStatisticsDeclarer.setUndeclareReason(excel.getUndeclareReason());
}
baseMapper.updateById(tStatisticsDeclarer);
}
baseMapper.updateById(tStatisticsDeclarer);
}else {
errorMessageList.add(new ErrorMessage(excel.getRowIndex(), "未找到身份证和申报月份对应的申报人员信息"));
continue;
......
......@@ -33,7 +33,7 @@ public class SalaryConstants {
* @return:
**/
public static final Integer[] AUDIT_STATUS = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9};
public static final int[] STATUS = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9};
public static final int[] STATUS = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10};
public static final String[] AUDIT_STATUS_STRING = {"待提交", "待审核", "-", "待发放", "已发放", "审核不通过", "确认不通过", "财务退回", "结算单调整待审核", "结算单调整待打印"};
//发放失败-认领状态 0待认领1待出账2已发放3再次失败待认领
public static final Integer[] LOST_STATUS = {0, 1, 2, 3};
......
......@@ -178,9 +178,9 @@
province,
city,
town,
DEPART_ID,
DEPART_NAME,
DEPART_NO,
DEPT_ID,
DEPT_NAME,
DEPT_NO,
0 as TYPE
FROM
(
......@@ -189,10 +189,10 @@
a.EMP_ID employee_id,
a.EMP_IDCARD employee_idnum,
a.EMP_NAME employee_name,
s.DEPART_ID,
s.DEPART_NAME,
s.DEPART_NO,
a.SALARY_DATE salary_month,
s.DEPT_ID,
s.DEPT_NAME,
s.DEPT_NO,
a.SALARY_MONTH salary_month,
a.SETTLEMENT_MONTH settle_month,
sum(i.SALARY_MONEY) AS actual_salary,
sum(l.SALARY_MONEY) AS relay_Salary,
......@@ -210,9 +210,10 @@
LEFT JOIN t_salary_account_item l ON l.SALARY_ACCOUNT_ID = a.id and l.JAVA_FIED_NAME = 'relaySalary'
WHERE
a.DELETE_FLAG = 0
and s.SEND_MONTH = #{settleMonth}
and a.FORM_TYPE='0'
and a.SALARY_MONTH = #{settleMonth}
AND s.STATUS IN (3, 4)
GROUP BY a.EMP_IDCARD,a.SALARY_DATE
GROUP BY a.EMP_IDCARD,a.SALARY_MONTH
) b
WHERE b.salary_base > b.actual_salary
</select>
......@@ -273,7 +274,7 @@
<!--生成前,先删除老数据-->
<delete id="deleteAllBySettleMonth">
delete from sys_message_salary where settle_month = #{settleMonth}
delete from sys_message_salary where SALARY_MONTH = #{settleMonth}
</delete>
......
......@@ -11,7 +11,7 @@
<result property="customerName" column="CUSTOMER_NAME"/>
<result property="settlementOrganName" column="SETTLEMENT_ORGAN_NAME"/>
<result property="settlementOrganNo" column="SETTLEMENT_ORGAN_NO"/>
<result property="feedBack" column="FEEDBACK"/>
<result property="feedBack" column="FEED_BACK"/>
<result property="reasonType" column="REASON_TYPE"/>
<result property="month" column="month"/>
</resultMap>
......@@ -23,7 +23,7 @@
<result property="month" column="month"/>
<result property="relaySalary" column="RELAY_SALARY"/>
<result property="createName" column="CREATE_NAME"/>
<result property="feedBack" column="FEEDBACK"/>
<result property="feedBack" column="FEED_BACK"/>
</resultMap>
<sql id="Base_Column_List">
......@@ -39,7 +39,7 @@
a.month,
a.SETTLE_MONTH,
a.relay_salary,
a.FEEDBACK,
a.FEED_BACK,
a.CREATE_NAME,
a.REASON_TYPE
</sql>
......
......@@ -99,11 +99,12 @@
#{nowMonth} DECLARE_MONTH,c.EMP_NAME,c.EMP_IDCARD,c.EMP_PHONE,c.INVOICE_TITLE DECLARE_UNIT,
if(c.FORM_TYPE=0,'0',if(c.FORM_TYPE=3 or c.FORM_TYPE=4,'1','-')) OCCUPATION_TYPE FROM
(SELECT s.* FROM t_salary_account s,
(SELECT a.EMP_NAME,a.EMP_IDCARD,a.EMP_PHONE,a.INVOICE_TITLE,a.FORM_TYPE,MAX(CREATE_TIME) max_day,a.SETTLEMENT_MONTH
(SELECT a.EMP_NAME,a.EMP_IDCARD,a.EMP_PHONE,a.INVOICE_TITLE,a.FORM_TYPE,MAX(CREATE_TIME) max_day,a.SETTLEMENT_MONTH,
if(a.FORM_TYPE=0,'0',if(a.FORM_TYPE=3 or a.FORM_TYPE=4,'1','-')) CUPATION_TYPE
FROM t_salary_account a WHERE a.DELETE_FLAG = '0' AND a.SETTLEMENT_MONTH = #{lastMonth}
GROUP BY a.EMP_IDCARD,a.INVOICE_TITLE,a.FORM_TYPE,a.SETTLEMENT_MONTH) b
GROUP BY a.EMP_IDCARD,a.INVOICE_TITLE,CUPATION_TYPE,a.SETTLEMENT_MONTH) b
WHERE s.DELETE_FLAG = '0' AND b.max_day = s.CREATE_TIME
AND s.EMP_IDCARD = b.EMP_IDCARD AND s.INVOICE_TITLE = b.INVOICE_TITLE
AND s.SETTLEMENT_MONTH = b.SETTLEMENT_MONTH AND s.FORM_TYPE = b.FORM_TYPE ) c
AND s.SETTLEMENT_MONTH = b.SETTLEMENT_MONTH) c
</select>
</mapper>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment