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;
/**
* 订单编号
*/
@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);
}
......@@ -267,7 +267,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
*/
@Override
@Transactional(value = "insurancesTransactionManager" ,rollbackFor = {Exception.class})
public R<List<InsuranceAddParam>> addInsurance(List<InsuranceAddParam> paramList) {
public R<List<InsuranceAddParam>> addInsurance(List<InsuranceAddParam> paramList,String orderNo) {
if (CollectionUtils.isEmpty(paramList)){
return R.failed(CommonConstants.DATA_CAN_NOT_EMPTY);
}
......@@ -286,7 +286,10 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
TInsuranceDetail detail = new TInsuranceDetail();
BeanCopyUtils.copyProperties(success,detail);
//购买类型,默认为「新增」
detail.setOrderNo(orderNo);
detail.setBuyType(CommonConstants.ONE_INT);
detail.setCreateUserDeptId(user.getDeptId().toString());
detail.setCreateUserDeptName(user.getDeptName());
//投保状态:待投保
detail.setBuyHandleStatus(CommonConstants.ONE_INT);
detail.setPolicyStart(LocalDateUtil.parseLocalDate(success.getPolicyStart()));
......@@ -314,7 +317,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
*/
@Override
@Transactional(value = "insurancesTransactionManager" ,rollbackFor = {Exception.class})
public R<List<InsuranceBatchParam>> batchInsurance(List<InsuranceBatchParam> paramList) {
public R<List<InsuranceBatchParam>> batchInsurance(List<InsuranceBatchParam> paramList,String orderNo) {
if (CollectionUtils.isEmpty(paramList)){
return R.failed(CommonConstants.DATA_CAN_NOT_EMPTY);
}
......@@ -337,6 +340,9 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
//投保状态:待投保
detail.setBuyHandleStatus(CommonConstants.ONE_INT);
//保费都默认是0
detail.setOrderNo(orderNo);
detail.setCreateUserDeptId(user.getDeptId().toString());
detail.setCreateUserDeptName(user.getDeptName());
detail.setActualPremium(new BigDecimal("0.00"));
detail.setEstimatePremium(new BigDecimal("0.00"));
detail.setCreateBy(user.getId());
......@@ -359,7 +365,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
*/
@Override
@Transactional(value = "insurancesTransactionManager" ,rollbackFor = {Exception.class})
public R<List<InsuranceReplaceParam>> replaceInsurance(List<InsuranceReplaceParam> paramList) {
public R<List<InsuranceReplaceParam>> replaceInsurance(List<InsuranceReplaceParam> paramList,String orderNo) {
if (CollectionUtils.isEmpty(paramList)){
return R.failed(CommonConstants.DATA_CAN_NOT_EMPTY);
}
......@@ -397,6 +403,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
this.updateById(detail);
//新数据置为待办理
newDetail.setId(null);
newDetail.setOrderNo(orderNo);
newDetail.setBuyHandleStatus(CommonConstants.ONE_INT);
newDetail.setBuyType(CommonConstants.FOUR_INT);
newDetail.setEmpName(success.getReplaceEmpName());
......@@ -410,6 +417,8 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
newDetail.setIsUse(null);
newDetail.setIsEffect(null);
newDetail.setReduceHandleStatus(null);
newDetail.setCreateUserDeptId(user.getDeptId().toString());
newDetail.setCreateUserDeptName(user.getDeptName());
newDetail.setSignFlag(CommonConstants.ZERO_INT);
//创建时间是新数据插入时间
newDetail.setCreateTime(LocalDateTime.now());
......@@ -1338,7 +1347,6 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
detail.setUpdateTime(LocalDateTime.now());
if (StringUtils.isNotBlank(success.getPolicyNo())){
detail.setPolicyNo(success.getPolicyNo());
//如果保单号不为空,将替换类型的保单号也全部更新
List<TInsuranceReplace> list = tInsuranceReplaceService.list(Wrappers.<TInsuranceReplace>query().lambda()
.eq(TInsuranceReplace::getOriginInsuranceDetailId, detail.getId()));
......@@ -1358,6 +1366,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
// todo 判断是否推送过ekp,没推送过调新增接口,推送过调更新接口
if (StringUtils.isNotBlank(detail.getDefaultSettleId())){
SettleVo settleVo = getInsuranceDetailSettleStatus(detail.getId(), detail.getDefaultSettleId());
if(!Common.isEmpty(settleVo) && InsurancesConstants.SETTLE_ZERO.equals(settleVo.getActualStatus())){
TInsuranceSettle settle = tInsuranceSettleService.getById(detail.getDefaultSettleId());
if (Optional.ofNullable(settle).isPresent()){
settle.setActualPremium(new BigDecimal(success.getActualPremium()));
......@@ -1375,6 +1384,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
}
});
}
}
}else {
//保费存储
TInsuranceSettle settle = new TInsuranceSettle();
......@@ -2612,7 +2622,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
continue;
}else {
//查数据是否存在权限范围内
TInsuranceDetail detailByRegionSQL = this.baseMapper.selectByregionSQL(regionSQL, detail.getId());
TInsuranceDetail detailByRegionSQL = this.baseMapper.selectByRegionSql(regionSQL, detail.getId());
if (!Optional.ofNullable(detailByRegionSQL).isPresent()){
param.setErrorMessage(InsurancesConstants.NO_UPDATE_DETAIL_JURISDICTION);
listResult.add(param);
......@@ -2703,12 +2713,14 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
if (StringUtils.isNotBlank(detail.getDefaultSettleId())){
TInsuranceSettle settle = tInsuranceSettleService.getById(detail.getDefaultSettleId());
if (Optional.ofNullable(settle).isPresent()){
if (CommonConstants.TWO_STRING.equals(settle.getSettleHandleStatus())){
SettleVo settleVo = getInsuranceDetailSettleStatus(detail.getId(), detail.getDefaultSettleId());
if(!Common.isEmpty(settleVo)){
if (InsurancesConstants.SETTLE_ONE.equals(settleVo.getActualStatus())){
param.setErrorMessage(InsurancesConstants.SETTLE_HANDLE_TWO_NOT_REGISTERED);
listResult.add(param);
continue;
}
if (CommonConstants.THREE_STRING.equals(settle.getSettleHandleStatus())){
if (InsurancesConstants.SETTLE_TWO.equals(settleVo.getActualStatus())){
param.setErrorMessage(InsurancesConstants.SETTLE_HANDLE_THREE_NOT_REGISTERED);
listResult.add(param);
continue;
......@@ -2716,6 +2728,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
}
}
}
}
listSuccess.add(param);
}
map.put("listResult",listResult);
......@@ -2882,7 +2895,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
* @return {@link R}
*/
@Override
public R saveInsuranceRefund(List<InsuranceRefundCheck> insuranceRefundCheckList) {
public R saveInsuranceRefund(List<InsuranceRefundCheck> insuranceRefundCheckList,String orderNo) {
YifuUser user = SecurityUtils.getUser();
if(!Common.isNotEmpty(insuranceRefundCheckList)){
return R.failed("当前导入的减员信息为空");
......@@ -2899,6 +2912,11 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
insuranceRefund.setCreateBy(user.getId());
insuranceRefund.setCreateName(user.getNickname());
insuranceRefund.setCreateTime(LocalDateTime.now());
insuranceRefund.setUpdateTime(LocalDateTime.now());
insuranceRefund.setUpdateBy(user.getId());
insuranceRefund.setOrderNo(orderNo);
insuranceRefund.setCreateUserDeptId(user.getDeptId().toString());
insuranceRefund.setCreateUserDeptName(user.getDeptName());
if(StringUtils.isNotBlank(refund.getRemark())){
insuranceRefund.setRemark(refund.getRemark());
}
......@@ -3159,8 +3177,8 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
detailList.add(detail);
refund.setInsDetailId(record.getId());
refund.setReduceHandleStatus(CommonConstants.TWO_INT);
refund.setCreateBy(user.getId());
refund.setCreateTime(LocalDateTime.now());
refund.setUpdateBy(user.getId());
refund.setUpdateTime(LocalDateTime.now());
refundList.add(refund);
}
}
......@@ -3239,8 +3257,8 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
successList.add(tInsuranceDetail);
//更新减员记录
refund.setInsDetailId(tInsuranceDetail.getId());
refund.setCreateBy(user.getId());
refund.setCreateTime(LocalDateTime.now());
refund.setUpdateBy(user.getId());
refund.setUpdateTime(LocalDateTime.now());
refund.setReduceHandleStatus(refundType);
refundList.add(refund);
}else{
......@@ -3285,8 +3303,10 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
for (InsuranceHandleImportParam param : successList) {
TInsuranceOperate operate = new TInsuranceOperate();
LambdaUpdateWrapper<TInsuranceRefund> refund = new LambdaUpdateWrapper<>();
refund.eq(TInsuranceRefund :: getInsDetailId ,param.getId());
refund.set(TInsuranceRefund :: getRemark,param.getRemark());
refund.eq(TInsuranceRefund :: getInsDetailId ,param.getId())
.set(TInsuranceRefund :: getRemark,param.getRemark())
.set(TInsuranceRefund :: getUpdateTime,LocalDateTime.now())
.set(TInsuranceRefund :: getUpdateBy,user.getId());
LambdaUpdateWrapper<TInsuranceDetail> updateWrapper = new LambdaUpdateWrapper<>();
updateWrapper.eq(TInsuranceDetail::getId, param.getId())
.set(TInsuranceDetail::getUpdateBy, user.getId())
......@@ -4467,24 +4487,23 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
String defaultSettleId = insuranceDetail.getDefaultSettleId();
if(StringUtils.isNotEmpty(defaultSettleId)){
//查询结算状态
LambdaQueryWrapper<TInsuranceSettle> insuranceSettleQuery = new LambdaQueryWrapper<>();
insuranceSettleQuery.eq(TInsuranceSettle :: getId,defaultSettleId);
TInsuranceSettle insuranceSettle = tInsuranceSettleService.getOne(insuranceSettleQuery);
if (!Common.isEmpty(insuranceSettle)){
//当前结算状态为结算中时,不能变更结算月
if (CommonConstants.TWO_STRING.equals(insuranceSettle.getSettleHandleStatus())){
param.setErrorMessage(InsurancesConstants.SETTLE_MONTH_CHANGE_SETTLE_STATUS_TWO_ERROR);
TInsuranceSettle settle = tInsuranceSettleService.getById(defaultSettleId);
if (Optional.ofNullable(settle).isPresent()){
SettleVo settleVo = getInsuranceDetailSettleStatus(insuranceDetail.getId(), defaultSettleId);
if(!Common.isEmpty(settleVo)){
if (InsurancesConstants.SETTLE_ONE.equals(settleVo.getActualStatus())){
param.setErrorMessage(InsurancesConstants.SETTLE_HANDLE_TWO_NOT_REGISTERED);
errorList.add(param);
continue;
}
//当前结算状态为已结算时,不能变更结算月
if (CommonConstants.THREE_STRING.equals(insuranceSettle.getSettleHandleStatus())){
param.setErrorMessage(InsurancesConstants.SETTLE_MONTH_CHANGE_SETTLE_STATUS_THREE_ERROR);
if (InsurancesConstants.SETTLE_TWO.equals(settleVo.getActualStatus())){
param.setErrorMessage(InsurancesConstants.SETTLE_HANDLE_THREE_NOT_REGISTERED);
errorList.add(param);
continue;
}
}
}
}
//当前保单信息的为已减员时不能变更结算月
if(null != insuranceDetail.getReduceHandleStatus()){
if( CommonConstants.FOUR_INT == insuranceDetail.getReduceHandleStatus() ){
......@@ -4656,7 +4675,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
String detailId = insuranceDetail.getId();
//查数据是否存在权限范围内
String regionSQL = getRegionSQL(user);
TInsuranceDetail detailByRegionSQL = this.baseMapper.selectByregionSQL(regionSQL,detailId);
TInsuranceDetail detailByRegionSQL = this.baseMapper.selectByRegionSql(regionSQL,detailId);
if (!Optional.ofNullable(detailByRegionSQL).isPresent() || !user.getId().equals(detailByRegionSQL.getUpdateBy())){
param.setErrorMessage(InsurancesConstants.NO_DETAIL_JURISDICTION);
errorList.add(param);
......@@ -4975,22 +4994,23 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
String defaultSettleId = insuranceDetail.getDefaultSettleId();
if (StringUtils.isNotBlank(defaultSettleId)){
//查询结算状态
LambdaQueryWrapper<TInsuranceSettle> insuranceSettleQuery = new LambdaQueryWrapper<>();
insuranceSettleQuery.eq(TInsuranceSettle :: getId,defaultSettleId);
TInsuranceSettle insuranceSettle = tInsuranceSettleService.getOne(insuranceSettleQuery);
//当前结算状态为结算中时,不能变更结算项目
if (CommonConstants.TWO_STRING.equals(insuranceSettle.getSettleHandleStatus())){
param.setErrorMessage(InsurancesConstants.DEPT_NO_CHANGE_SETTLE_STATUS_TWO_ERROR);
TInsuranceSettle settle = tInsuranceSettleService.getById(defaultSettleId);
if (Optional.ofNullable(settle).isPresent()){
SettleVo settleVo = getInsuranceDetailSettleStatus(insuranceDetail.getId(), defaultSettleId);
if(!Common.isEmpty(settleVo)){
if (InsurancesConstants.SETTLE_ONE.equals(settleVo.getActualStatus())){
param.setErrorMessage(InsurancesConstants.SETTLE_HANDLE_TWO_NOT_REGISTERED);
errorList.add(param);
continue;
}
//当前结算状态为已结算时,不能变更结算项目
if (CommonConstants.THREE_STRING.equals(insuranceSettle.getSettleHandleStatus())){
param.setErrorMessage(InsurancesConstants.DEPT_NO_CHANGE_SETTLE_STATUS_THREE_ERROR);
if (InsurancesConstants.SETTLE_TWO.equals(settleVo.getActualStatus())){
param.setErrorMessage(InsurancesConstants.SETTLE_HANDLE_THREE_NOT_REGISTERED);
errorList.add(param);
continue;
}
}
}
}
//预估
if (param.getNewSettleType() == CommonConstants.ZERO_INT){
//按月
......@@ -5110,7 +5130,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
return R.failed("身份证格式不正确");
}
//查询所有在保,未出险,未过期,未失效,未减员的保单信息
List<TInsuranceDetail> list = this.baseMapper.selectListByempIdcardNo(empIdcardNo);
List<TInsuranceDetail> list = this.baseMapper.selectListByEmpIdcardNo(empIdcardNo);
if (CollectionUtils.isEmpty(list)){
return R.failed("无可出险的保单");
}
......@@ -5146,6 +5166,69 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
}
@Override
public R<List<InsuranceAddParam>> addOrderInsurance(InsuranceListOrderParam paramList) {
String orderNo = paramList.getOrderNo();
if (StringUtils.isBlank(orderNo)) {
return R.failed(InsurancesConstants.ORDER_NO_IS_EMPTY);
}
return addInsurance(paramList.getData(),paramList.getOrderNo());
}
@Override
public R<List<InsuranceBatchParam>> batchOrderInsurance(InsuranceOrderBatchParam paramList) {
String orderNo = paramList.getOrderNo();
if (StringUtils.isBlank(orderNo)) {
return R.failed(InsurancesConstants.ORDER_NO_IS_EMPTY);
}
return batchInsurance(paramList.getData(),paramList.getOrderNo());
}
@Override
public R<List<InsuranceReplaceParam>> replaceOrderInsurance(InsuranceOrderReplaceParam paramList) {
String orderNo = paramList.getOrderNo();
if (StringUtils.isBlank(orderNo)) {
return R.failed(InsurancesConstants.ORDER_NO_IS_EMPTY);
}
return replaceInsurance(paramList.getData(),paramList.getOrderNo());
}
@Override
public R refundOrderInsurance(InsuranceOrderRefundParam paramList) {
String orderNo = paramList.getOrderNo();
if (StringUtils.isBlank(orderNo)) {
return R.failed(InsurancesConstants.ORDER_NO_IS_EMPTY);
}
return saveInsuranceRefund(paramList.getData(),paramList.getOrderNo());
}
/**
* 订单商险列表查询
*
* @author zhaji
* @param page
* @param param
* @return {@link IPage< InsuredOrderListVo>}
*/
@Override
public R getOrderInsuredListPage(Page<InsuredOrderListVo> page, InsuredOrderParam param) {
YifuUser user = SecurityUtils.getUser();
List<String> deptNoList = getDeptNoList(user);
Page<InsuredOrderListVo> pageList = new Page<>();
if(CollectionUtils.isEmpty(deptNoList)){
return R.ok(pageList);
}
param.setDeptNoList(deptNoList);
String orderNo = param.getOrderNo();
if (StringUtils.isBlank(orderNo)) {
return R.failed(InsurancesConstants.ORDER_NO_IS_EMPTY);
}
//查询所有投保信息
IPage<InsuredOrderListVo> orderInsuredList = baseMapper.getOrderRefundInsuredListPage(page, param);
//查询所有的减员信息
return R.ok(orderInsuredList);
}
/**
* 获取项目权限
*
......@@ -5252,6 +5335,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
List<String> deptNoList =new ArrayList<>();
deptNoList.add(tInsuranceDetail.getDeptNo());
BeanCopyUtils.copyProperties(tInsuranceDetail,param);
param.setDetailId(tInsuranceDetail.getId());
//获取当前项目的名称,客户名称和客户编码
R<SetInfoVo> setInfoByCodes = archivesDaprUtil.getSetInfoByCodes(deptNoList);
if (null != setInfoByCodes && setInfoByCodes.getCode() == CommonConstants.SUCCESS && Common.isNotNull(setInfoByCodes.getData())) {
......@@ -5310,11 +5394,11 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
* @param
* @return {@link String}
*/
@Override
public SettleVo getInsuranceDetailSettleStatus(String detailId,String settleId){
String id = detailId+CommonConstants.DOWN_LINE_STRING+settleId;
//获取ekp结算信息
SettleVo settle = ekpSettleService.getSettle(id);
return settle;
return ekpSettleService.getSettle(id);
}
/**
......
......@@ -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"/>
<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);
......
......@@ -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)) {
.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);
}
}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>
......
......@@ -72,6 +72,77 @@
<result property="createTime" column="CREATE_TIME"/>
<result property="updateBy" column="UPDATE_BY"/>
<result property="updateTime" column="UPDATE_TIME"/>
<result property="sendStatus" column="SEND_STATUS"/>
<result property="sendTime" column="SEND_TIME"/>
<result property="sendUser" column="SEND_USER"/>
<result property="sendUserName" column="SEND_USER_NAME"/>
<result property="sendMonth" column="SEND_MONTH"/>
</resultMap>
<!-- 对接EKP的参数 -->
<resultMap id="ekpSalaryParamVoMap" type="com.yifu.cloud.plus.v1.yifu.ekp.vo.EkpSalaryParamVo">
<id property="salaryAccountId" column="id"/>
<result property="fd_3adfedf98ccba2" column="fd_3adfedf98ccba2"/>
<result property="fd_3adfedf9d2bf1c" column="fd_3adfedf9d2bf1c"/>
<result property="fd_3adfedfacd65d6" column="fd_3adfedfacd65d6"/>
<result property="fd_3adfedfb174068" column="fd_3adfedfb174068"/>
<result property="fd_3adfedfb5a68a2" column="fd_3adfedfb5a68a2"/>
<result property="fd_3adfedfb8f76d4" column="fd_3adfedfb8f76d4"/>
<result property="fd_3adfedfbd23ab8" column="fd_3adfedfbd23ab8"/>
<result property="fd_3adfedfcb17f1e" column="fd_3adfedfcb17f1e"/>
<result property="fd_3adfedfc453cc4" column="fd_3adfedfc453cc4"/>
<result property="fd_3adfee063acff0" column="fd_3adfee063acff0"/>
<result property="fd_3adfee0690737c" column="fd_3adfee0690737c"/>
<result property="fd_3adfee01668666" column="fd_3adfee01668666"/>
<result property="fd_3adfedfed8bb28" column="fd_3adfedfed8bb28"/>
<result property="fd_3adfedff3a7430" column="fd_3adfedff3a7430"/>
<result property="fd_3adfee0009d070" column="fd_3adfee0009d070"/>
<result property="fd_3adfee01dea2fa" column="fd_3adfee01dea2fa"/>
<result property="fd_3adfee12cb8840" column="fd_3adfee12cb8840"/>
<result property="fd_3adfee1374ed7a" column="fd_3adfee1374ed7a"/>
<result property="fd_3adfee1e2b2f78" column="fd_3adfee1e2b2f78"/>
<result property="fd_3adfee1e88723e" column="fd_3adfee1e88723e"/>
<result property="fd_3adfee1ee24680" column="fd_3adfee1ee24680"/>
<result property="fd_3adfee1f32fa24" column="fd_3adfee1f32fa24"/>
<result property="fd_3adfee1f901c46" column="fd_3adfee1f901c46"/>
<result property="fd_3adfee20fe5ba4" column="fd_3adfee20fe5ba4"/>
<result property="fd_3af9d49d165e90" column="fd_3af9d49d165e90"/>
<result property="fd_3afab1895feea2" column="fd_3afab1895feea2"/>
<result property="fd_3adfedfa4410aa" column="fd_3adfedfa4410aa"/>
<result property="fd_3adfee1ff1ca6a" column="fd_3adfee1ff1ca6a"/>
<result property="fd_3adfee203f86b2" column="fd_3adfee203f86b2"/>
<result property="fd_3adfee21802434" column="fd_3adfee21802434"/>
<result property="fd_3adfee4ba5ad36" column="fd_3adfee4ba5ad36"/>
<result property="fd_3adfee4c0c59ee" column="fd_3adfee4c0c59ee"/>
<result property="fd_3adfee5dd14866" column="fd_3adfee5dd14866"/>
<result property="fd_3adfee5e3d1638" column="fd_3adfee5e3d1638"/>
<result property="fd_3adfeeb34ea0ea" column="fd_3adfeeb34ea0ea"/>
<result property="fd_3adfeededfb5a6" column="fd_3adfeededfb5a6"/>
<result property="fd_3adfeed3a20598" column="fd_3adfeed3a20598"/>
<result property="fd_3aea30866d0c30" column="fd_3aea30866d0c30"/>
<result property="fd_3aea309696d32e" column="fd_3aea309696d32e"/>
<result property="fd_3adfeec6db8766" column="fd_3adfeec6db8766"/>
<result property="fd_3adfeef8ef38fc" column="fd_3adfeef8ef38fc"/>
<result property="fd_3adfeedd08222c" column="fd_3adfeedd08222c"/>
<result property="fd_3aeadede4cea84" column="fd_3aeadede4cea84"/>
<result property="fd_3aeadee1cf1266" column="fd_3aeadee1cf1266"/>
<result property="fd_3adfeec730ec44" column="fd_3adfeec730ec44"/>
<result property="fd_3adfeef9440ab2" column="fd_3adfeef9440ab2"/>
<result property="fd_3adfeedd5f3cb2" column="fd_3adfeedd5f3cb2"/>
<result property="fd_3aeadf17522642" column="fd_3aeadf17522642"/>
<result property="fd_3aeadf17b7d03a" column="fd_3aeadf17b7d03a"/>
<result property="fd_3adfeec782070a" column="fd_3adfeec782070a"/>
<result property="fd_3adfeef9b9fb3e" column="fd_3adfeef9b9fb3e"/>
<result property="fd_3adfeeddacf6d4" column="fd_3adfeeddacf6d4"/>
<result property="fd_3aeadf182ef6a2" column="fd_3aeadf182ef6a2"/>
<result property="fd_3aeadf1892fdb2" column="fd_3aeadf1892fdb2"/>
<result property="fd_3adfeec7ccdd1c" column="fd_3adfeec7ccdd1c"/>
<result property="fd_3adfeefa1eba32" column="fd_3adfeefa1eba32"/>
<result property="fd_3adfeede08d430" column="fd_3adfeede08d430"/>
<result property="fd_3aeadf191c62a0" column="fd_3aeadf191c62a0"/>
<result property="fd_3aeadf1992544c" column="fd_3aeadf1992544c"/>
<result property="fd_3af9d49d165e90" column="fd_3af9d49d165e90"/>
<result property="fd_3afab1895feea2" column="fd_3afab1895feea2"/>
</resultMap>
<sql id="Base_Column_List">
a.ID,
......@@ -121,7 +192,12 @@
a.CREATE_NAME,
a.CREATE_TIME,
a.UPDATE_BY,
a.UPDATE_TIME
a.UPDATE_TIME,
a.SEND_STATUS,
a.SEND_TIME,
a.SEND_USER,
a.SEND_USER_NAME,
a.SEND_MONTH
</sql>
<sql id="tSalaryAccount_where">
<if test="tSalaryAccount != null">
......@@ -247,6 +323,9 @@
</if>
<if test="tSalaryAccount.salaryTaxUnit != null">
AND a.SALARY_TAX_UNIT = #{tSalaryAccount.salaryTaxUnit}
</if>
<if test="tSalaryAccount.sendStatus != null">
AND a.SEND_STATUS = #{tSalaryAccount.sendStatus}
</if>
</if>
</sql>
......@@ -338,7 +417,8 @@
where
a.DELETE_FLAG = 0
and s.send_month in ( #{month} , #{month2} , #{month3})
and a.FORM_TYPE='0'
and a.SALARY_MONTH in ( #{month} , #{month2} , #{month3})
AND s.STATUS IN (3, 4)
GROUP BY a.EMP_IDCARD, a.SALARY_MONTH limit 10
) a
......@@ -354,6 +434,85 @@
where a.DELETE_FLAG = 0 and a.FORM_TYPE = '0' and a.SALARY_MONTH like concat(DATE_FORMAT(NOW(), '%Y'), '%')
</select>
<!-- 获取薪资明细 -->
<select id="getEkpSalaryParamList" resultMap="ekpSalaryParamVoMap">
select
a.id fd_id
,ifnull(a.DEPT_NO,'') fd_3adfedf98ccba2
,ifnull(a.DEPT_NAME,'') fd_3adfedf9d2bf1c
,'' fd_3adfedfa4410aa
,ifnull(s.UNIT_NO,'') fd_3adfedfacd65d6
,ifnull(s.UNIT_NAME,'') fd_3adfedfb174068
,ifnull(a.EMP_NAME,'') fd_3adfedfb5a68a2
,ifnull(a.EMP_IDCARD,'') fd_3adfedfb8f76d4
,ifnull(a.EMP_PHONE,'') fd_3adfedfbd23ab8
,ifnull(a.BANK_NO,'') fd_3adfedfcb17f1e
,ifnull(a.BANK_NAME,'') fd_3adfedfc453cc4
,ifnull(a.SALARY_MONTH,'') fd_3adfee063acff0
,ifnull(a.SETTLEMENT_MONTH,'') fd_3adfee0690737c
,'1' fd_3adfee01668666
,ifnull(a.SOCIAL_PRIORITY,'') fd_3adfedfed8bb28
,ifnull(a.FUND_PRIORITY,'') fd_3adfedff3a7430
,ifnull(a.OWN_FLAG,'') fd_3adfee0009d070
,ifnull(a.ANNUAL_BONUS_TYPE,'') fd_3adfee01dea2fa
,ifnull(a.RELAY_SALARY,'') fd_3adfee12cb8840
,ifnull(pdeduction.SALARY_MONEY,'') fd_3adfee1374ed7a
,ifnull(ifnull(withholidingUnitSocial.SALARY_MONEY,unitSocial.SALARY_MONEY),'') fd_3adfee1e2b2f78
,ifnull(ifnull(withholidingPersonSocial.SALARY_MONEY,personalSocial.SALARY_MONEY),'') fd_3adfee1e88723e
,ifnull(ifnull(withholidingUnitFund.SALARY_MONEY,unitFund.SALARY_MONEY),'') fd_3adfee1ee24680
,ifnull(ifnull(withholidingPersonFund.SALARY_MONEY,personalFund.SALARY_MONEY),'') fd_3adfee1f32fa24
,ifnull(a.SALARY_TAX,'') fd_3adfee1f901c46
,'' fd_3adfee1ff1ca6a
,'' fd_3adfee203f86b2
,ifnull(a.ACTUAL_SALARY,'') fd_3adfee20fe5ba4
,'' fd_3adfee21802434
,'' fd_3adfee4ba5ad36
,'' fd_3adfee4c0c59ee
,'' fd_3adfee5dd14866
,'' fd_3adfee5e3d1638
,'' fd_3adfeeb34ea0ea
,'' fd_3adfeededfb5a6
,'' fd_3adfeed3a20598
,'' fd_3aea30866d0c30
,'' fd_3aea309696d32e
,'' fd_3adfeec6db8766
,'' fd_3adfeef8ef38fc
,'' fd_3adfeedd08222c
,'' fd_3aeadede4cea84
,'' fd_3aeadee1cf1266
,'' fd_3adfeec730ec44
,'' fd_3adfeef9440ab2
,'' fd_3adfeedd5f3cb2
,'' fd_3aeadf17522642
,'' fd_3aeadf17b7d03a
,'' fd_3adfeec782070a
,'' fd_3adfeef9b9fb3e
,'' fd_3adfeeddacf6d4
,'' fd_3aeadf182ef6a2
,'' fd_3aeadf1892fdb2
,'' fd_3adfeec7ccdd1c
,'' fd_3adfeefa1eba32
,'' fd_3adfeede08d430
,'' fd_3aeadf191c62a0
,'' fd_3aeadf1992544c
,ifnull(a.SALARY_GIVE_TIME,'') fd_3af9d49d165e90
,ifnull(a.INVOICE_TITLE,'') fd_3afab1895feea2
from t_salary_account a
LEFT JOIN t_salary_standard s on a.SALARY_FORM_ID=s.ID
left join t_salary_account_item withholidingPersonSocial on withholidingPersonSocial.SALARY_ACCOUNT_ID = a.id and withholidingPersonSocial.JAVA_FIED_NAME='withholidingPersonSocial'
left join t_salary_account_item withholidingPersonFund on withholidingPersonFund.SALARY_ACCOUNT_ID = a.id and withholidingPersonFund.JAVA_FIED_NAME='withholidingPersonFund'
left join t_salary_account_item personalSocial on personalSocial.SALARY_ACCOUNT_ID = a.id and personalSocial.JAVA_FIED_NAME='personalSocial'
left join t_salary_account_item personalFund on personalFund.SALARY_ACCOUNT_ID = a.id and personalFund.JAVA_FIED_NAME='personalFund'
left join t_salary_account_item exemptionPersionTax on exemptionPersionTax.SALARY_ACCOUNT_ID = a.id and exemptionPersionTax.JAVA_FIED_NAME='exemptionPersionTax'
left join t_salary_account_item unitSocial on unitSocial.SALARY_ACCOUNT_ID = a.id and unitSocial.JAVA_FIED_NAME='unitSocial'
left join t_salary_account_item unitFund on unitFund.SALARY_ACCOUNT_ID = a.id and unitFund.JAVA_FIED_NAME='unitFund'
left join t_salary_account_item withholidingUnitSocial on withholidingUnitSocial.SALARY_ACCOUNT_ID = a.id and withholidingUnitSocial.JAVA_FIED_NAME='withholidingUnitSocial'
left join t_salary_account_item withholidingUnitFund on withholidingUnitFund.SALARY_ACCOUNT_ID = a.id and withholidingUnitFund.JAVA_FIED_NAME='withholidingUnitFund'
left join t_salary_account_item pdeduction on pdeduction.SALARY_ACCOUNT_ID = a.id and pdeduction.JAVA_FIED_NAME='pdeduction'
where a.DELETE_FLAG = 0 and a.SALARY_FORM_ID = #{salaryId} and a.SEND_STATUS = '0'
</select>
<select id="noPageDiy" resultMap="tSalaryAccountMap" parameterType="com.yifu.cloud.plus.v1.yifu.salary.entity.TSalaryAccount">
SELECT
<include refid="Base_Column_List"/>
......
......@@ -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