Commit e17a9179 authored by fangxinjiang's avatar fangxinjiang

Merge remote-tracking branch 'origin/develop' into develop

parents 9fcd4432 ba1b46ad
...@@ -66,6 +66,8 @@ public class ValidityConstants { ...@@ -66,6 +66,8 @@ public class ValidityConstants {
public static final String PATTERN_50 = "^.{1,50}$"; public static final String PATTERN_50 = "^.{1,50}$";
/** 最多60位 规则 */ /** 最多60位 规则 */
public static final String PATTERN_60 = "^.{1,60}$"; public static final String PATTERN_60 = "^.{1,60}$";
/** 最多200位 规则 */
public static final String PATTERN_200 = "^.{1,200}$";
/** 不超过两位小数的正数 */ /** 不超过两位小数的正数 */
public static final String POSITIVE_INTEGER_PATTERN_TWO_FLOAT = "^[+]?([0-9]+(.[0-9]{1,2})?)$"; public static final String POSITIVE_INTEGER_PATTERN_TWO_FLOAT = "^[+]?([0-9]+(.[0-9]{1,2})?)$";
......
...@@ -12,10 +12,7 @@ import java.io.Serializable; ...@@ -12,10 +12,7 @@ import java.io.Serializable;
*/ */
@Data @Data
public class EkpSalaryParam implements Serializable { public class EkpSalaryParam implements Serializable {
/**
* ID
**/
private String fd_id;
/** /**
* 项目编码 * 项目编码
**/ **/
...@@ -121,7 +118,7 @@ public class EkpSalaryParam implements Serializable { ...@@ -121,7 +118,7 @@ public class EkpSalaryParam implements Serializable {
**/ **/
private String fd_3adfee203f86b2; private String fd_3adfee203f86b2;
/** /**
* 发合计 * 发合计
**/ **/
private String fd_3adfee20fe5ba4; private String fd_3adfee20fe5ba4;
/** /**
...@@ -185,23 +182,23 @@ public class EkpSalaryParam implements Serializable { ...@@ -185,23 +182,23 @@ public class EkpSalaryParam implements Serializable {
**/ **/
private String fd_3aeadee1cf1266; private String fd_3aeadee1cf1266;
/** /**
* 发合计应支出 * 发合计应支出
**/ **/
private String fd_3adfeec730ec44; private String fd_3adfeec730ec44;
/** /**
* 工资发结算状态 * 工资发结算状态
**/ **/
private String fd_3adfeef9440ab2; private String fd_3adfeef9440ab2;
/** /**
* 发合计付款状态 * 发合计付款状态
**/ **/
private String fd_3adfeedd5f3cb2; private String fd_3adfeedd5f3cb2;
/** /**
* 发结算单号 * 发结算单号
**/ **/
private String fd_3aeadf17522642; private String fd_3aeadf17522642;
/** /**
* 发付款单号 * 发付款单号
**/ **/
private String fd_3aeadf17b7d03a; 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;
}
...@@ -303,6 +303,12 @@ public class TInsuranceDetail extends BaseEntity { ...@@ -303,6 +303,12 @@ public class TInsuranceDetail extends BaseEntity {
@Schema(description = "创建人所在部门名称") @Schema(description = "创建人所在部门名称")
private String createUserDeptName; private String createUserDeptName;
/**
* 减员id
*/
@Schema(description = "减员id")
private String refundId;
......
...@@ -2920,14 +2920,11 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap ...@@ -2920,14 +2920,11 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
if(StringUtils.isNotBlank(refund.getRemark())){ if(StringUtils.isNotBlank(refund.getRemark())){
insuranceRefund.setRemark(refund.getRemark()); insuranceRefund.setRemark(refund.getRemark());
} }
if(null == refund.getReduceHandleStatus()){ tInsuranceRefundService.save(insuranceRefund);
tInsuranceRefundService.save(insuranceRefund);
}else{
tInsuranceRefundService.updateByInsDetailId(insuranceRefund);
}
LambdaUpdateWrapper<TInsuranceDetail> updateWrapper = new LambdaUpdateWrapper<>(); LambdaUpdateWrapper<TInsuranceDetail> updateWrapper = new LambdaUpdateWrapper<>();
updateWrapper.set(TInsuranceDetail :: getUpdateBy,user.getId()) updateWrapper.set(TInsuranceDetail :: getUpdateBy,user.getId())
.set(TInsuranceDetail :: getUpdateTime,LocalDateTime.now()) .set(TInsuranceDetail :: getUpdateTime,LocalDateTime.now())
.set(TInsuranceDetail :: getRefundId,insuranceRefund.getId())
.set(TInsuranceDetail :: getReduceHandleStatus,CommonConstants.ONE_INT); .set(TInsuranceDetail :: getReduceHandleStatus,CommonConstants.ONE_INT);
updateWrapper.eq(TInsuranceDetail :: getId,refund.getId()); updateWrapper.eq(TInsuranceDetail :: getId,refund.getId());
update(updateWrapper); update(updateWrapper);
...@@ -3175,7 +3172,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap ...@@ -3175,7 +3172,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
detail.setUpdateTime(LocalDateTime.now()); detail.setUpdateTime(LocalDateTime.now());
detail.setReduceHandleStatus(CommonConstants.TWO_INT); detail.setReduceHandleStatus(CommonConstants.TWO_INT);
detailList.add(detail); detailList.add(detail);
refund.setInsDetailId(record.getId()); refund.setId(detail.getRefundId());
refund.setReduceHandleStatus(CommonConstants.TWO_INT); refund.setReduceHandleStatus(CommonConstants.TWO_INT);
refund.setUpdateBy(user.getId()); refund.setUpdateBy(user.getId());
refund.setUpdateTime(LocalDateTime.now()); refund.setUpdateTime(LocalDateTime.now());
...@@ -3256,7 +3253,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap ...@@ -3256,7 +3253,7 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
tInsuranceDetail.setUpdateTime(LocalDateTime.now()); tInsuranceDetail.setUpdateTime(LocalDateTime.now());
successList.add(tInsuranceDetail); successList.add(tInsuranceDetail);
//更新减员记录 //更新减员记录
refund.setInsDetailId(tInsuranceDetail.getId()); refund.setId(tInsuranceDetail.getRefundId());
refund.setUpdateBy(user.getId()); refund.setUpdateBy(user.getId());
refund.setUpdateTime(LocalDateTime.now()); refund.setUpdateTime(LocalDateTime.now());
refund.setReduceHandleStatus(refundType); refund.setReduceHandleStatus(refundType);
......
...@@ -133,7 +133,7 @@ ...@@ -133,7 +133,7 @@
and detail.CREATE_NAME like concat('%',replace(replace(#{param.createName},'_','\_'),'%','\%'),'%') and detail.CREATE_NAME like concat('%',replace(replace(#{param.createName},'_','\_'),'%','\%'),'%')
</if> </if>
<if test="param.startDate != null and param.startDate.trim() != '' and param.endDate != null and param.endDate.trim() != ''"> <if test="param.startDate != null and param.startDate.trim() != '' and param.endDate != null and param.endDate.trim() != ''">
and detail.CREATE_TIME <![CDATA[ >= ]]> concat(#{param.startDate}, ' 00:00:00') and detail.CREATE_TIME <![CDATA[ <= ]]> concat(#{param.endDate}, ' 23:59:59') and detail.CREATE_TIME <![CDATA[ >= ]]> concat(#{param.startDate}, '00:00:00') and detail.CREATE_TIME <![CDATA[ <= ]]> concat(#{param.endDate}, '23:59:59')
</if> </if>
ORDER BY detail.BUY_HANDLE_STATUS,detail.CREATE_TIME DESC ORDER BY detail.BUY_HANDLE_STATUS,detail.CREATE_TIME DESC
</select> </select>
...@@ -194,7 +194,7 @@ ...@@ -194,7 +194,7 @@
and detail.CREATE_NAME like concat('%',replace(replace(#{param.createName},'_','\_'),'%','\%'),'%') and detail.CREATE_NAME like concat('%',replace(replace(#{param.createName},'_','\_'),'%','\%'),'%')
</if> </if>
<if test="param.startDate != null and param.startDate.trim() != '' and param.endDate != null and param.endDate.trim() != ''"> <if test="param.startDate != null and param.startDate.trim() != '' and param.endDate != null and param.endDate.trim() != ''">
and detail.CREATE_TIME <![CDATA[ >= ]]> concat(#{param.startDate}, ' 00:00:00') and detail.CREATE_TIME <![CDATA[ <= ]]> concat(#{param.endDate}, ' 23:59:59') and detail.CREATE_TIME <![CDATA[ >= ]]> concat(#{param.startDate}, '00:00:00') and detail.CREATE_TIME <![CDATA[ <= ]]> concat(#{param.endDate}, '23:59:59')
</if> </if>
ORDER BY detail.BUY_HANDLE_STATUS,detail.CREATE_TIME DESC ORDER BY detail.BUY_HANDLE_STATUS,detail.CREATE_TIME DESC
</select> </select>
...@@ -254,7 +254,7 @@ ...@@ -254,7 +254,7 @@
and detail.CREATE_NAME like concat('%',replace(replace(#{param.createName},'_','\_'),'%','\%'),'%') and detail.CREATE_NAME like concat('%',replace(replace(#{param.createName},'_','\_'),'%','\%'),'%')
</if> </if>
<if test="param.startDate != null and param.startDate.trim() != '' and param.endDate != null and param.endDate.trim() != ''"> <if test="param.startDate != null and param.startDate.trim() != '' and param.endDate != null and param.endDate.trim() != ''">
and detail.CREATE_TIME <![CDATA[ >= ]]> concat(#{param.startDate}, ' 00:00:00') and detail.CREATE_TIME <![CDATA[ <= ]]> concat(#{param.endDate}, ' 23:59:59') and detail.CREATE_TIME <![CDATA[ >= ]]> concat(#{param.startDate}, '00:00:00') and detail.CREATE_TIME <![CDATA[ <= ]]> concat(#{param.endDate}, '23:59:59')
</if> </if>
ORDER BY detail.BUY_HANDLE_STATUS,detail.CREATE_TIME DESC ORDER BY detail.BUY_HANDLE_STATUS,detail.CREATE_TIME DESC
</select> </select>
...@@ -385,7 +385,7 @@ ...@@ -385,7 +385,7 @@
and detail.CREATE_NAME like concat('%',replace(replace(#{param.createName},'_','\_'),'%','\%'),'%') and detail.CREATE_NAME like concat('%',replace(replace(#{param.createName},'_','\_'),'%','\%'),'%')
</if> </if>
<if test="param.startDate != null and param.startDate.trim() != '' and param.endDate != null and param.endDate.trim() != ''"> <if test="param.startDate != null and param.startDate.trim() != '' and param.endDate != null and param.endDate.trim() != ''">
and detail.CREATE_TIME <![CDATA[ >= ]]> concat(#{param.startDate}, ' 00:00:00') and detail.CREATE_TIME <![CDATA[ <= ]]> concat(#{param.endDate}, ' 23:59:59') and detail.CREATE_TIME <![CDATA[ >= ]]> concat(#{param.startDate}, '00:00:00') and detail.CREATE_TIME <![CDATA[ <= ]]> concat(#{param.endDate}, '23:59:59')
</if> </if>
ORDER BY detail.CREATE_TIME DESC ORDER BY detail.CREATE_TIME DESC
</select> </select>
...@@ -449,16 +449,16 @@ ...@@ -449,16 +449,16 @@
and detail.POLICY_NO like concat('%',replace(replace(#{param.policyNo},'_','\_'),'%','\%'),'%') and detail.POLICY_NO like concat('%',replace(replace(#{param.policyNo},'_','\_'),'%','\%'),'%')
</if> </if>
<if test="param.policyStart != null and param.policyStart.trim() != '' and param.policyEnd == null and param.policyEnd.trim() == ''"> <if test="param.policyStart != null and param.policyStart.trim() != '' and param.policyEnd == null and param.policyEnd.trim() == ''">
AND detail.POLICY_END <![CDATA[ >= ]]> concat(#{param.policyStart}, ' 00:00:00') AND detail.POLICY_END <![CDATA[ >= ]]> concat(#{param.policyStart}, '00:00:00')
</if> </if>
<if test="param.policyEnd != null and param.policyEnd.trim() != '' and param.policyStart == null and param.policyStart.trim() == ''"> <if test="param.policyEnd != null and param.policyEnd.trim() != '' and param.policyStart == null and param.policyStart.trim() == ''">
AND detail.POLICY_START <![CDATA[ <= ]]> concat(#{param.policyEnd}, ' 23:59:59') AND detail.POLICY_START <![CDATA[ <= ]]> concat(#{param.policyEnd}, '23:59:59')
</if> </if>
<if test="param.policyStart != null and param.policyStart.trim() != '' and param.policyEnd != null and param.policyEnd.trim() != ''"> <if test="param.policyStart != null and param.policyStart.trim() != '' and param.policyEnd != null and param.policyEnd.trim() != ''">
and ( and (
(detail.POLICY_START <![CDATA[ <= ]]> concat(#{param.policyStart}, ' 00:00:00') and detail.POLICY_END <![CDATA[ >= ]]> concat(#{param.policyEnd}, ' 23:59:59')) OR (detail.POLICY_START <![CDATA[ <= ]]> concat(#{param.policyStart}, '00:00:00') and detail.POLICY_END <![CDATA[ >= ]]> concat(#{param.policyEnd}, '23:59:59')) OR
(detail.POLICY_START <![CDATA[ >= ]]> concat(#{param.policyStart}, ' 00:00:00') and detail.POLICY_START <![CDATA[ <= ]]> concat(#{param.policyEnd}, ' 23:59:59')) OR (detail.POLICY_START <![CDATA[ >= ]]> concat(#{param.policyStart}, '00:00:00') and detail.POLICY_START <![CDATA[ <= ]]> concat(#{param.policyEnd}, '23:59:59')) OR
(detail.POLICY_END <![CDATA[ >= ]]> concat(#{param.policyStart}, ' 00:00:00') and detail.POLICY_END <![CDATA[ <= ]]> concat(#{param.policyEnd}, ' 23:59:59')) (detail.POLICY_END <![CDATA[ >= ]]> concat(#{param.policyStart}, '00:00:00') and detail.POLICY_END <![CDATA[ <= ]]> concat(#{param.policyEnd}, '23:59:59'))
) )
</if> </if>
<if test="param.invoiceNo != null and param.invoiceNo.trim() != ''"> <if test="param.invoiceNo != null and param.invoiceNo.trim() != ''">
...@@ -471,10 +471,10 @@ ...@@ -471,10 +471,10 @@
and detail.IS_OVERDUE = #{param.isOverdue} and detail.IS_OVERDUE = #{param.isOverdue}
</if> </if>
<if test="param.createStartTime != null and param.createStartTime.trim() != ''"> <if test="param.createStartTime != null and param.createStartTime.trim() != ''">
AND detail.CREATE_TIME <![CDATA[ >= ]]> concat(#{param.createStartTime}, ' 00:00:00') AND detail.CREATE_TIME <![CDATA[ >= ]]> concat(#{param.createStartTime}, '00:00:00')
</if> </if>
<if test="param.createEndTime != null and param.createEndTime.trim() != ''"> <if test="param.createEndTime != null and param.createEndTime.trim() != ''">
AND detail.CREATE_TIME <![CDATA[ <= ]]> concat(#{param.createEndTime}, ' 23:59:59') AND detail.CREATE_TIME <![CDATA[ <= ]]> concat(#{param.createEndTime}, '23:59:59')
</if> </if>
ORDER BY detail.CREATE_TIME DESC ,detail.ID ASC ORDER BY detail.CREATE_TIME DESC ,detail.ID ASC
</select> </select>
...@@ -536,16 +536,16 @@ ...@@ -536,16 +536,16 @@
and detail.POLICY_NO like concat('%',replace(replace(#{param.policyNo},'_','\_'),'%','\%'),'%') and detail.POLICY_NO like concat('%',replace(replace(#{param.policyNo},'_','\_'),'%','\%'),'%')
</if> </if>
<if test="param.policyStart != null and param.policyStart.trim() != '' and param.policyEnd == null and param.policyEnd.trim() == ''"> <if test="param.policyStart != null and param.policyStart.trim() != '' and param.policyEnd == null and param.policyEnd.trim() == ''">
AND detail.POLICY_END <![CDATA[ >= ]]> concat(#{param.policyStart}, ' 00:00:00') AND detail.POLICY_END <![CDATA[ >= ]]> concat(#{param.policyStart}, '00:00:00')
</if> </if>
<if test="param.policyEnd != null and param.policyEnd.trim() != '' and param.policyStart == null and param.policyStart.trim() == ''"> <if test="param.policyEnd != null and param.policyEnd.trim() != '' and param.policyStart == null and param.policyStart.trim() == ''">
AND detail.POLICY_START <![CDATA[ <= ]]> concat(#{param.policyEnd}, ' 23:59:59') AND detail.POLICY_START <![CDATA[ <= ]]> concat(#{param.policyEnd}, '23:59:59')
</if> </if>
<if test="param.policyStart != null and param.policyStart.trim() != '' and param.policyEnd != null and param.policyEnd.trim() != ''"> <if test="param.policyStart != null and param.policyStart.trim() != '' and param.policyEnd != null and param.policyEnd.trim() != ''">
and ( and (
(detail.POLICY_START <![CDATA[ <= ]]> concat(#{param.policyStart}, ' 00:00:00') and detail.POLICY_END <![CDATA[ >= ]]> concat(#{param.policyEnd}, ' 23:59:59')) OR (detail.POLICY_START <![CDATA[ <= ]]> concat(#{param.policyStart}, '00:00:00') and detail.POLICY_END <![CDATA[ >= ]]> concat(#{param.policyEnd}, '23:59:59')) OR
(detail.POLICY_START <![CDATA[ >= ]]> concat(#{param.policyStart}, ' 00:00:00') and detail.POLICY_START <![CDATA[ <= ]]> concat(#{param.policyEnd}, ' 23:59:59')) OR (detail.POLICY_START <![CDATA[ >= ]]> concat(#{param.policyStart}, '00:00:00') and detail.POLICY_START <![CDATA[ <= ]]> concat(#{param.policyEnd}, '23:59:59')) OR
(detail.POLICY_END <![CDATA[ >= ]]> concat(#{param.policyStart}, ' 00:00:00') and detail.POLICY_END <![CDATA[ <= ]]> concat(#{param.policyEnd}, ' 23:59:59')) (detail.POLICY_END <![CDATA[ >= ]]> concat(#{param.policyStart}, '00:00:00') and detail.POLICY_END <![CDATA[ <= ]]> concat(#{param.policyEnd}, '23:59:59'))
) )
</if> </if>
<if test="param.invoiceNo != null and param.invoiceNo.trim() != ''"> <if test="param.invoiceNo != null and param.invoiceNo.trim() != ''">
...@@ -558,10 +558,10 @@ ...@@ -558,10 +558,10 @@
and detail.IS_OVERDUE = #{param.isOverdue} and detail.IS_OVERDUE = #{param.isOverdue}
</if> </if>
<if test="param.createStartTime != null and param.createStartTime.trim() != ''"> <if test="param.createStartTime != null and param.createStartTime.trim() != ''">
AND detail.CREATE_TIME <![CDATA[ >= ]]> concat(#{param.createStartTime}, ' 00:00:00') AND detail.CREATE_TIME <![CDATA[ >= ]]> concat(#{param.createStartTime}, '00:00:00')
</if> </if>
<if test="param.createEndTime != null and param.createEndTime.trim() != ''"> <if test="param.createEndTime != null and param.createEndTime.trim() != ''">
AND detail.CREATE_TIME <![CDATA[ <= ]]> concat(#{param.createEndTime}, ' 23:59:59') AND detail.CREATE_TIME <![CDATA[ <= ]]> concat(#{param.createEndTime}, '23:59:59')
</if> </if>
ORDER BY detail.CREATE_TIME DESC ORDER BY detail.CREATE_TIME DESC
</select> </select>
...@@ -585,7 +585,7 @@ ...@@ -585,7 +585,7 @@
where where
detail.DELETE_FLAG = 0 detail.DELETE_FLAG = 0
and and
detail.ID = refund.INS_DETAIL_ID detail.REFUND_ID = refund.ID
and and
detail.REDUCE_HANDLE_STATUS = 4 detail.REDUCE_HANDLE_STATUS = 4
<if test="param.empName != null and param.empName.trim() != ''"> <if test="param.empName != null and param.empName.trim() != ''">
...@@ -610,16 +610,16 @@ ...@@ -610,16 +610,16 @@
and detail.POLICY_NO like concat('%',replace(replace(#{param.policyNo},'_','\_'),'%','\%'),'%') and detail.POLICY_NO like concat('%',replace(replace(#{param.policyNo},'_','\_'),'%','\%'),'%')
</if> </if>
<if test="param.policyStart != null and param.policyStart.trim() != '' and param.policyEnd == null and param.policyEnd.trim() == ''"> <if test="param.policyStart != null and param.policyStart.trim() != '' and param.policyEnd == null and param.policyEnd.trim() == ''">
AND detail.POLICY_END <![CDATA[ >= ]]> concat(#{param.policyStart}, ' 00:00:00') AND detail.POLICY_END <![CDATA[ >= ]]> concat(#{param.policyStart}, '00:00:00')
</if> </if>
<if test="param.policyEnd != null and param.policyEnd.trim() != '' and param.policyStart == null and param.policyStart.trim() == ''"> <if test="param.policyEnd != null and param.policyEnd.trim() != '' and param.policyStart == null and param.policyStart.trim() == ''">
AND detail.POLICY_START <![CDATA[ <= ]]> concat(#{param.policyEnd}, ' 23:59:59') AND detail.POLICY_START <![CDATA[ <= ]]> concat(#{param.policyEnd}, '23:59:59')
</if> </if>
<if test="param.policyStart != null and param.policyStart.trim() != '' and param.policyEnd != null and param.policyEnd.trim() != ''"> <if test="param.policyStart != null and param.policyStart.trim() != '' and param.policyEnd != null and param.policyEnd.trim() != ''">
and ( and (
(detail.POLICY_START <![CDATA[ <= ]]> concat(#{param.policyStart}, ' 00:00:00') and detail.POLICY_END <![CDATA[ >= ]]> concat(#{param.policyEnd}, ' 23:59:59')) OR (detail.POLICY_START <![CDATA[ <= ]]> concat(#{param.policyStart}, '00:00:00') and detail.POLICY_END <![CDATA[ >= ]]> concat(#{param.policyEnd}, '23:59:59')) OR
(detail.POLICY_START <![CDATA[ >= ]]> concat(#{param.policyStart}, ' 00:00:00') and detail.POLICY_START <![CDATA[ <= ]]> concat(#{param.policyEnd}, ' 23:59:59')) OR (detail.POLICY_START <![CDATA[ >= ]]> concat(#{param.policyStart}, '00:00:00') and detail.POLICY_START <![CDATA[ <= ]]> concat(#{param.policyEnd}, '23:59:59')) OR
(detail.POLICY_END <![CDATA[ >= ]]> concat(#{param.policyStart}, ' 00:00:00') and detail.POLICY_END <![CDATA[ <= ]]> concat(#{param.policyEnd}, ' 23:59:59')) (detail.POLICY_END <![CDATA[ >= ]]> concat(#{param.policyStart}, '00:00:00') and detail.POLICY_END <![CDATA[ <= ]]> concat(#{param.policyEnd}, '23:59:59'))
) )
</if> </if>
ORDER BY refund.CREATE_TIME DESC,detail.ID ASC ORDER BY refund.CREATE_TIME DESC,detail.ID ASC
...@@ -649,7 +649,7 @@ ...@@ -649,7 +649,7 @@
t_insurance_detail detail, t_insurance_detail detail,
t_insurance_refund refund t_insurance_refund refund
where where
detail.ID = refund.INS_DETAIL_ID detail.REFUND_ID = refund.ID
and and
detail.DELETE_FLAG = 0 detail.DELETE_FLAG = 0
and and
...@@ -676,16 +676,16 @@ ...@@ -676,16 +676,16 @@
and detail.POLICY_NO like concat('%',replace(replace(#{param.policyNo},'_','\_'),'%','\%'),'%') and detail.POLICY_NO like concat('%',replace(replace(#{param.policyNo},'_','\_'),'%','\%'),'%')
</if> </if>
<if test="param.policyStart != null and param.policyStart.trim() != '' and param.policyEnd == null and param.policyEnd.trim() == ''"> <if test="param.policyStart != null and param.policyStart.trim() != '' and param.policyEnd == null and param.policyEnd.trim() == ''">
AND detail.POLICY_END <![CDATA[ >= ]]> concat(#{param.policyStart}, ' 00:00:00') AND detail.POLICY_END <![CDATA[ >= ]]> concat(#{param.policyStart}, '00:00:00')
</if> </if>
<if test="param.policyEnd != null and param.policyEnd.trim() != '' and param.policyStart == null and param.policyStart.trim() == ''"> <if test="param.policyEnd != null and param.policyEnd.trim() != '' and param.policyStart == null and param.policyStart.trim() == ''">
AND detail.POLICY_START <![CDATA[ <= ]]> concat(#{param.policyEnd}, ' 23:59:59') AND detail.POLICY_START <![CDATA[ <= ]]> concat(#{param.policyEnd}, '23:59:59')
</if> </if>
<if test="param.policyStart != null and param.policyStart.trim() != '' and param.policyEnd != null and param.policyEnd.trim() != ''"> <if test="param.policyStart != null and param.policyStart.trim() != '' and param.policyEnd != null and param.policyEnd.trim() != ''">
and ( and (
(detail.POLICY_START <![CDATA[ <= ]]> concat(#{param.policyStart}, ' 00:00:00') and detail.POLICY_END <![CDATA[ >= ]]> concat(#{param.policyEnd}, ' 23:59:59')) OR (detail.POLICY_START <![CDATA[ <= ]]> concat(#{param.policyStart}, '00:00:00') and detail.POLICY_END <![CDATA[ >= ]]> concat(#{param.policyEnd}, '23:59:59')) OR
(detail.POLICY_START <![CDATA[ >= ]]> concat(#{param.policyStart}, ' 00:00:00') and detail.POLICY_START <![CDATA[ <= ]]> concat(#{param.policyEnd}, ' 23:59:59')) OR (detail.POLICY_START <![CDATA[ >= ]]> concat(#{param.policyStart}, '00:00:00') and detail.POLICY_START <![CDATA[ <= ]]> concat(#{param.policyEnd}, '23:59:59')) OR
(detail.POLICY_END <![CDATA[ >= ]]> concat(#{param.policyStart}, ' 00:00:00') and detail.POLICY_END <![CDATA[ <= ]]> concat(#{param.policyEnd}, ' 23:59:59')) (detail.POLICY_END <![CDATA[ >= ]]> concat(#{param.policyStart}, '00:00:00') and detail.POLICY_END <![CDATA[ <= ]]> concat(#{param.policyEnd}, '23:59:59'))
) )
</if> </if>
ORDER BY refund.CREATE_TIME DESC ORDER BY refund.CREATE_TIME DESC
...@@ -717,7 +717,7 @@ ...@@ -717,7 +717,7 @@
t_insurance_detail detail, t_insurance_detail detail,
t_insurance_refund refund t_insurance_refund refund
where where
detail.ID = refund.INS_DETAIL_ID detail.REFUND_ID = refund.ID
<if test="param.empName != null and param.empName.trim() != ''"> <if test="param.empName != null and param.empName.trim() != ''">
and detail.EMP_NAME like concat('%',replace(replace(#{param.empName},'_','\_'),'%','\%'),'%') and detail.EMP_NAME like concat('%',replace(replace(#{param.empName},'_','\_'),'%','\%'),'%')
</if> </if>
...@@ -746,10 +746,10 @@ ...@@ -746,10 +746,10 @@
and refund.CREATE_NAME like concat('%',replace(replace(#{param.createName},'_','\_'),'%','\%'),'%') and refund.CREATE_NAME like concat('%',replace(replace(#{param.createName},'_','\_'),'%','\%'),'%')
</if> </if>
<if test="param.startDate != null and param.startDate.trim() != ''"> <if test="param.startDate != null and param.startDate.trim() != ''">
AND refund.CREATE_TIME <![CDATA[ >= ]]> concat(#{param.startDate}, ' 00:00:00') AND refund.CREATE_TIME <![CDATA[ >= ]]> concat(#{param.startDate}, '00:00:00')
</if> </if>
<if test="param.endDate != null and param.endDate.trim() != ''"> <if test="param.endDate != null and param.endDate.trim() != ''">
AND refund.CREATE_TIME <![CDATA[ <= ]]> concat(#{param.endDate}, ' 23:59:59') AND refund.CREATE_TIME <![CDATA[ <= ]]> concat(#{param.endDate}, '23:59:59')
</if> </if>
ORDER BY refund.CREATE_TIME DESC,detail.ID ASC ORDER BY refund.CREATE_TIME DESC,detail.ID ASC
</select> </select>
...@@ -781,7 +781,7 @@ ...@@ -781,7 +781,7 @@
where where
detail.DELETE_FLAG = 0 detail.DELETE_FLAG = 0
and and
detail.ID = refund.INS_DETAIL_ID detail.REFUND_ID = refund.ID
and and
detail.BUY_HANDLE_STATUS = 5 detail.BUY_HANDLE_STATUS = 5
and and
...@@ -965,10 +965,10 @@ ...@@ -965,10 +965,10 @@
and detail.EMP_IDCARD_NO like concat('%',replace(replace(#{param.empIdcardNo},'_','\_'),'%','\%'),'%') and detail.EMP_IDCARD_NO like concat('%',replace(replace(#{param.empIdcardNo},'_','\_'),'%','\%'),'%')
</if> </if>
<if test="param.startDate != null and param.startDate.trim() != ''"> <if test="param.startDate != null and param.startDate.trim() != ''">
AND detail.CREATE_TIME <![CDATA[ >= ]]> concat(#{param.startDate}, '00:00:00') AND detail.CREATE_TIME <![CDATA[ >= ]]> concat(#{param.startDate}, '00:00:00')
</if> </if>
<if test="param.endDate != null and param.endDate.trim() != ''"> <if test="param.endDate != null and param.endDate.trim() != ''">
AND detail.CREATE_TIME <![CDATA[ <= ]]> concat(#{param.endDate}, ' 23:59:59') AND detail.CREATE_TIME <![CDATA[ <= ]]> concat(#{param.endDate}, '23:59:59')
</if> </if>
<if test="param.deptNoList != null"> <if test="param.deptNoList != null">
and detail.DEPT_NO in and detail.DEPT_NO in
...@@ -979,7 +979,7 @@ ...@@ -979,7 +979,7 @@
union all( union all(
select select
detail.id as id, detail.id as id,
detail.BUY_TYPE as buyType, refund.BUY_TYPE as buyType,
detail.EMP_NAME as empName, detail.EMP_NAME as empName,
detail.EMP_IDCARD_NO as empIdcardNo, detail.EMP_IDCARD_NO as empIdcardNo,
detail.INSURANCE_COMPANY_NAME as insuranceCompanyName, detail.INSURANCE_COMPANY_NAME as insuranceCompanyName,
...@@ -997,6 +997,8 @@ ...@@ -997,6 +997,8 @@
t_insurance_refund refund t_insurance_refund refund
where where
detail.DELETE_FLAG = 0 detail.DELETE_FLAG = 0
and
detail.ID = refund.INS_DETAIL_ID
and and
refund.ORDER_NO = #{param.orderNo} refund.ORDER_NO = #{param.orderNo}
<if test="param.empName != null and param.empName.trim() != ''"> <if test="param.empName != null and param.empName.trim() != ''">
...@@ -1006,10 +1008,10 @@ ...@@ -1006,10 +1008,10 @@
and detail.EMP_IDCARD_NO like concat('%',replace(replace(#{param.empIdcardNo},'_','\_'),'%','\%'),'%') and detail.EMP_IDCARD_NO like concat('%',replace(replace(#{param.empIdcardNo},'_','\_'),'%','\%'),'%')
</if> </if>
<if test="param.startDate != null and param.startDate.trim() != ''"> <if test="param.startDate != null and param.startDate.trim() != ''">
AND refund.CREATE_TIME <![CDATA[ >= ]]> concat(#{param.startDate}, '00:00:00') AND refund.CREATE_TIME <![CDATA[ >= ]]> concat(#{param.startDate}, '00:00:00')
</if> </if>
<if test="param.endDate != null and param.endDate.trim() != ''"> <if test="param.endDate != null and param.endDate.trim() != ''">
AND refund.CREATE_TIME <![CDATA[ <= ]]> concat(#{param.endDate}, ' 23:59:59') AND refund.CREATE_TIME <![CDATA[ <= ]]> concat(#{param.endDate}, '23:59:59')
</if> </if>
<if test="param.deptNoList != null"> <if test="param.deptNoList != null">
and detail.DEPT_NO in and detail.DEPT_NO in
...@@ -1050,7 +1052,7 @@ ...@@ -1050,7 +1052,7 @@
AND detail.CREATE_TIME <![CDATA[ >= ]]> concat(#{param.startDate}, '00:00:00') AND detail.CREATE_TIME <![CDATA[ >= ]]> concat(#{param.startDate}, '00:00:00')
</if> </if>
<if test="param.endDate != null and param.endDate.trim() != ''"> <if test="param.endDate != null and param.endDate.trim() != ''">
AND detail.CREATE_TIME <![CDATA[ <= ]]> concat(#{param.endDate}, ' 23:59:59') AND detail.CREATE_TIME <![CDATA[ <= ]]> concat(#{param.endDate}, '23:59:59')
</if> </if>
<if test="param.deptNoList != null"> <if test="param.deptNoList != null">
and detail.DEPT_NO in and detail.DEPT_NO in
......
...@@ -57,7 +57,7 @@ ...@@ -57,7 +57,7 @@
</if> </if>
REDUCE_HANDLE_STATUS = #{param.reduceHandleStatus} REDUCE_HANDLE_STATUS = #{param.reduceHandleStatus}
where where
INS_DETAIL_ID = #{param.insDetailId} ID = #{param.id}
</update> </update>
<update id="updateRefundMoney"> <update id="updateRefundMoney">
update update
......
...@@ -18,6 +18,10 @@ public class OrderConstants { ...@@ -18,6 +18,10 @@ public class OrderConstants {
* 订单id不可为空 * 订单id不可为空
*/ */
public static final String ORDER_ID_IS_EMPTY = "订单id不可为空"; public static final String ORDER_ID_IS_EMPTY = "订单id不可为空";
/**
* 附件id不可为空
*/
public static final String ENCLOSURE_ID_IS_EMPTY = "附件id不可为空";
/** /**
* 订单已办结,不可操作 * 订单已办结,不可操作
*/ */
...@@ -26,4 +30,28 @@ public class OrderConstants { ...@@ -26,4 +30,28 @@ public class OrderConstants {
* 操作成功 * 操作成功
*/ */
public static final String OPERATE_SUCCESS = "操作成功"; public static final String OPERATE_SUCCESS = "操作成功";
/**
* 操作失败
*/
public static final String OPERATE_FAILED = "操作失败";
/**
* 订单编号不能为空
*/
public static final String ORDER_NO_IS_EMPTY = "订单编号不能为空";
/**
* 回复内容和附件,两者必填其一
*/
public static final String REPLY_CONTENT_AND_ENCLOSURE_IS_EMPTY = "回复内容和附件,两者必填其一";
/**
* “回复内容”,200字以内
*/
public static final String REPLY_CONTENT_MORE_THAN_200 = "“回复内容”,200字以内";
/**
* 非法的附件类型
*/
public static final String ENCLOSURE_TYPE_IS_ERROR = "非法的附件类型";
/**
* 附件超出上传上限
*/
public static final String ENCLOSURE_SIZE_ERROR = "附件超出上传上限";
} }
...@@ -23,12 +23,12 @@ public class TOrderEnclosure implements Serializable { ...@@ -23,12 +23,12 @@ public class TOrderEnclosure implements Serializable {
*/ */
@TableId(type = IdType.ASSIGN_ID) @TableId(type = IdType.ASSIGN_ID)
@Schema(description = "主键") @Schema(description = "主键")
private Integer id; private String id;
/** /**
* 订单编号 * 附件标识是0时是订单编号,1时是回复表id
*/ */
@Schema(description = "订单编号") @JsonIgnore
private String orderNo; private String orderNo;
/** /**
......
...@@ -22,7 +22,7 @@ public class TOrderReply implements Serializable { ...@@ -22,7 +22,7 @@ public class TOrderReply implements Serializable {
*/ */
@TableId(type = IdType.ASSIGN_ID) @TableId(type = IdType.ASSIGN_ID)
@Schema(description = "主键") @Schema(description = "主键")
private Integer id; private String id;
/** /**
* 订单编号 * 订单编号
......
package com.yifu.cloud.plus.v1.yifu.order.util;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.ValidityConstants;
import com.yifu.cloud.plus.v1.yifu.common.core.util.Common;
/**
* @author licancan
* @description 校验工具类
* @date 2022-08-30 10:30:16
*/
public class ValidityUtil {
/**
* 验证字符串 最多200位
*
* @author licancan
* @param str
* @return {@link boolean}
*/
public static boolean validate200(final String str){
if(Common.isEmpty(str)){
return Boolean.FALSE;
}
return str.matches(ValidityConstants.PATTERN_200) ;
}
}
package com.yifu.cloud.plus.v1.yifu.order.vo;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.yifu.cloud.plus.v1.yifu.order.entity.TOrderEnclosure;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import java.io.Serializable;
import java.time.LocalDateTime;
import java.util.List;
/**
* @author licancan
* @description 订单详情VO
* @date 2022-08-29 15:18:50
*/
@Data
@Schema(description = "订单详情VO")
public class OrderDetailVO implements Serializable {
private static final long serialVersionUID = -6669349004826405691L;
/**
* 创建人姓名(下单人)
*/
@Schema(description = "创建人姓名(下单人)")
private String createName;
/**
* 创建时间(下单时间)
*/
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern="yyyy-MM-dd HH:mm:ss")
@Schema(description = "创建时间(下单时间)")
private LocalDateTime createTime;
/**
* 项目编码
*/
@Schema(description = "项目编码")
private String deptNo;
/**
* 项目名称
*/
@Schema(description = "项目名称")
private String deptName;
/**
* 订单编号
*/
@Schema(description = "订单编号")
private String orderNo;
/**
* 客户名称
*/
@Schema(description = "客户名称")
private String customerName;
/**
* 订单状态 0待办理 1办理中 2已办结
*/
@Schema(description = "订单状态 0待办理 1办理中 2已办结")
private Integer orderStatus;
/**
* 订单内容
*/
@Schema(description = "订单内容")
private String orderContent;
/**
* 原始单据
*/
@Schema(description = "原始单据")
private List<TOrderEnclosure> orderEnclosure;
}
package com.yifu.cloud.plus.v1.yifu.order.vo;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.yifu.cloud.plus.v1.yifu.order.entity.TOrderEnclosure;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import java.io.Serializable;
import java.time.LocalDateTime;
import java.util.List;
/**
* @author licancan
* @description 订单回复列表vo
* @date 2022-08-29 17:07:50
*/
@Data
@Schema(description = "订单回复列表vo")
public class OrderReplyListVO implements Serializable {
private static final long serialVersionUID = -1376876766552447670L;
/**
* 主键
*/
@Schema(description = "主键")
private String id;
/**
* 订单编号
*/
@Schema(description = "订单编号")
private String orderNo;
/**
* 创建人姓名(回复人)
*/
@Schema(description = "创建人姓名(回复人)")
private String createName;
/**
* 创建时间(回复时间)
*/
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern="yyyy-MM-dd HH:mm:ss")
@Schema(description = "创建时间(回复时间)")
private LocalDateTime createTime;
/**
* 回复内容
*/
@Schema(description = "回复内容")
private String replyContent;
/**
* 回复附件
*/
@Schema(description = "回复附件")
private List<TOrderEnclosure> orderReplyEnclosure;
}
...@@ -2,19 +2,23 @@ package com.yifu.cloud.plus.v1.yifu.order.controller; ...@@ -2,19 +2,23 @@ package com.yifu.cloud.plus.v1.yifu.order.controller;
import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yifu.cloud.plus.v1.yifu.common.core.util.Common;
import com.yifu.cloud.plus.v1.yifu.common.core.util.R; import com.yifu.cloud.plus.v1.yifu.common.core.util.R;
import com.yifu.cloud.plus.v1.yifu.order.constants.OrderConstants;
import com.yifu.cloud.plus.v1.yifu.order.service.TOrderService; import com.yifu.cloud.plus.v1.yifu.order.service.TOrderService;
import com.yifu.cloud.plus.v1.yifu.order.vo.OrderDetailVO;
import com.yifu.cloud.plus.v1.yifu.order.vo.OrderListParam; import com.yifu.cloud.plus.v1.yifu.order.vo.OrderListParam;
import com.yifu.cloud.plus.v1.yifu.order.vo.OrderListVO; import com.yifu.cloud.plus.v1.yifu.order.vo.OrderListVO;
import com.yifu.cloud.plus.v1.yifu.order.vo.OrderReplyListVO;
import io.swagger.v3.oas.annotations.Operation; import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.media.Schema;
import io.swagger.v3.oas.annotations.tags.Tag; import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.RequiredArgsConstructor; import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.*;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.multipart.MultipartFile;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import javax.annotation.Resource; import javax.annotation.Resource;
import java.io.IOException;
import java.util.List; import java.util.List;
/** /**
...@@ -71,4 +75,64 @@ public class OrderController { ...@@ -71,4 +75,64 @@ public class OrderController {
return tOrderService.handleOrder(id,status); return tOrderService.handleOrder(id,status);
} }
/**
* 通过id查询详情
*
* @author licancan
* @param id 订单id
* @return {@link R<OrderDetailVO>}
*/
@Operation(summary = "通过id查询详情", description = "通过id查询详情")
@GetMapping("/{id}")
public R<OrderDetailVO> getInsuranceDetailById(@PathVariable("id") String id) {
return tOrderService.getOrderDetailById(id);
}
/**
* 附件预览下载地址
*
* @author licancan
* @param id 附件表id
* @return {@link R}
*/
@Schema(description = "附件预览下载地址,附件表id")
@GetMapping("/getEnclosureUrl/{id}")
public R getEnclosureUrl(@PathVariable String id) {
return tOrderService.getEnclosureUrl(id);
}
/**
* 添加回复
*
* @author licancan
* @param file 附件
* @param filePath 附件路径
* @param replyContent 回复内容
* @param orderNo 订单编号
* @return {@link R}
* @throws IOException
*/
@Schema(description = "添加回复")
@PostMapping(value = "/uploadReplyEnclosure")
public R uploadReplyEnclosure(@RequestBody MultipartFile[] file, String filePath, String replyContent,String orderNo) throws IOException {
return tOrderService.uploadReplyEnclosure(file, filePath,replyContent,orderNo);
}
/**
* 订单回复列表分页查询
*
* @author licancan
* @param page
* @param orderNo
* @return {@link R<IPage< OrderReplyListVO>>}
*/
@Operation(summary = "订单回复列表分页查询", description = "订单回复列表分页查询")
@GetMapping("/getOrderReplyPageList")
public R<IPage<OrderReplyListVO>> getOrderReplyPageList(Page<OrderReplyListVO> page, String orderNo) {
if (Common.isEmpty(orderNo)){
return R.failed(OrderConstants.ORDER_NO_IS_EMPTY);
}
return R.ok(tOrderService.getOrderReplyPageList(page,orderNo));
}
} }
...@@ -5,8 +5,10 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper; ...@@ -5,8 +5,10 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yifu.cloud.plus.v1.yifu.order.entity.TOrder; import com.yifu.cloud.plus.v1.yifu.order.entity.TOrder;
import com.yifu.cloud.plus.v1.yifu.order.vo.OrderDetailVO;
import com.yifu.cloud.plus.v1.yifu.order.vo.OrderListParam; import com.yifu.cloud.plus.v1.yifu.order.vo.OrderListParam;
import com.yifu.cloud.plus.v1.yifu.order.vo.OrderListVO; import com.yifu.cloud.plus.v1.yifu.order.vo.OrderListVO;
import com.yifu.cloud.plus.v1.yifu.order.vo.OrderReplyListVO;
import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
...@@ -47,4 +49,23 @@ public interface TOrderMapper extends BaseMapper<TOrder> { ...@@ -47,4 +49,23 @@ public interface TOrderMapper extends BaseMapper<TOrder> {
* @return {@link List< OrderListVO>} * @return {@link List< OrderListVO>}
*/ */
List<OrderListVO> getOrderList(@Param("param") OrderListParam param); List<OrderListVO> getOrderList(@Param("param") OrderListParam param);
/**
* 通过id查询详情
*
* @author licancan
* @param id
* @return {@link OrderDetailVO}
*/
OrderDetailVO getOrderDetailById(@Param("id") String id);
/**
* 订单回复列表分页查询
*
* @author licancan
* @param page
* @param orderNo
* @return {@link IPage< OrderReplyListVO>}
*/
IPage<OrderReplyListVO> getOrderReplyPageList(Page<OrderReplyListVO> page,@Param("orderNo") String orderNo);
} }
...@@ -6,9 +6,13 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page; ...@@ -6,9 +6,13 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService; import com.baomidou.mybatisplus.extension.service.IService;
import com.yifu.cloud.plus.v1.yifu.common.core.util.R; import com.yifu.cloud.plus.v1.yifu.common.core.util.R;
import com.yifu.cloud.plus.v1.yifu.order.entity.TOrder; import com.yifu.cloud.plus.v1.yifu.order.entity.TOrder;
import com.yifu.cloud.plus.v1.yifu.order.vo.OrderDetailVO;
import com.yifu.cloud.plus.v1.yifu.order.vo.OrderListParam; import com.yifu.cloud.plus.v1.yifu.order.vo.OrderListParam;
import com.yifu.cloud.plus.v1.yifu.order.vo.OrderListVO; import com.yifu.cloud.plus.v1.yifu.order.vo.OrderListVO;
import com.yifu.cloud.plus.v1.yifu.order.vo.OrderReplyListVO;
import org.springframework.web.multipart.MultipartFile;
import java.io.IOException;
import java.util.List; import java.util.List;
/** /**
...@@ -46,4 +50,45 @@ public interface TOrderService extends IService<TOrder> { ...@@ -46,4 +50,45 @@ public interface TOrderService extends IService<TOrder> {
* @return {@link R<String>} * @return {@link R<String>}
*/ */
R<String> handleOrder(String id, Integer status); R<String> handleOrder(String id, Integer status);
/**
* 通过id查询详情
*
* @author licancan
* @param id
* @return {@link R<OrderDetailVO>}
*/
R<OrderDetailVO> getOrderDetailById(String id);
/**
* 附件预览下载地址
*
* @author licancan
* @param id 附件表id
* @return {@link R}
*/
R getEnclosureUrl(String id);
/**
* 添加回复
*
* @author licancan
* @param file 附件
* @param filePath 附件路径
* @param replyContent 回复内容
* @param orderNo 订单编号
* @return {@link R}
* @throws IOException
*/
R uploadReplyEnclosure(MultipartFile[] file, String filePath, String replyContent, String orderNo) throws IOException;
/**
* 订单回复列表分页查询
*
* @author licancan
* @param page
* @param orderNo
* @return {@link IPage< OrderReplyListVO>}
*/
IPage<OrderReplyListVO> getOrderReplyPageList(Page<OrderReplyListVO> page, String orderNo);
} }
package com.yifu.cloud.plus.v1.yifu.order.service.impl; package com.yifu.cloud.plus.v1.yifu.order.service.impl;
import com.baomidou.mybatisplus.core.metadata.IPage; 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.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; 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.constant.CommonConstants;
import com.yifu.cloud.plus.v1.yifu.common.core.util.Common;
import com.yifu.cloud.plus.v1.yifu.common.core.util.OSSUtil;
import com.yifu.cloud.plus.v1.yifu.common.core.util.R; import com.yifu.cloud.plus.v1.yifu.common.core.util.R;
import com.yifu.cloud.plus.v1.yifu.common.core.vo.YifuUser; import com.yifu.cloud.plus.v1.yifu.common.core.vo.YifuUser;
import com.yifu.cloud.plus.v1.yifu.common.security.util.SecurityUtils; import com.yifu.cloud.plus.v1.yifu.common.security.util.SecurityUtils;
import com.yifu.cloud.plus.v1.yifu.order.constants.OrderConstants; import com.yifu.cloud.plus.v1.yifu.order.constants.OrderConstants;
import com.yifu.cloud.plus.v1.yifu.order.entity.TOrder; import com.yifu.cloud.plus.v1.yifu.order.entity.TOrder;
import com.yifu.cloud.plus.v1.yifu.order.entity.TOrderEnclosure;
import com.yifu.cloud.plus.v1.yifu.order.entity.TOrderReply;
import com.yifu.cloud.plus.v1.yifu.order.mapper.TOrderMapper; import com.yifu.cloud.plus.v1.yifu.order.mapper.TOrderMapper;
import com.yifu.cloud.plus.v1.yifu.order.service.TOrderEnclosureService;
import com.yifu.cloud.plus.v1.yifu.order.service.TOrderReplyService;
import com.yifu.cloud.plus.v1.yifu.order.service.TOrderService; import com.yifu.cloud.plus.v1.yifu.order.service.TOrderService;
import com.yifu.cloud.plus.v1.yifu.order.util.ValidityUtil;
import com.yifu.cloud.plus.v1.yifu.order.vo.OrderDetailVO;
import com.yifu.cloud.plus.v1.yifu.order.vo.OrderListParam; import com.yifu.cloud.plus.v1.yifu.order.vo.OrderListParam;
import com.yifu.cloud.plus.v1.yifu.order.vo.OrderListVO; import com.yifu.cloud.plus.v1.yifu.order.vo.OrderListVO;
import com.yifu.cloud.plus.v1.yifu.order.vo.OrderReplyListVO;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.apache.commons.collections.CollectionUtils; import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.compress.utils.Lists;
import org.apache.commons.lang3.ArrayUtils;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.multipart.MultipartFile;
import javax.annotation.Resource;
import java.io.IOException;
import java.net.URL;
import java.time.LocalDateTime; import java.time.LocalDateTime;
import java.util.ArrayList;
import java.util.List; import java.util.List;
import java.util.Objects;
import java.util.Optional; import java.util.Optional;
/** /**
...@@ -31,6 +48,12 @@ import java.util.Optional; ...@@ -31,6 +48,12 @@ import java.util.Optional;
@Slf4j @Slf4j
@Service @Service
public class TOrderServiceImpl extends ServiceImpl<TOrderMapper, TOrder> implements TOrderService { public class TOrderServiceImpl extends ServiceImpl<TOrderMapper, TOrder> implements TOrderService {
@Resource
private TOrderEnclosureService tOrderEnclosureService;
@Resource
private TOrderReplyService tOrderReplyService;
@Resource
private OSSUtil ossUtil;
/** /**
* 订单列表分页查询 * 订单列表分页查询
...@@ -77,7 +100,7 @@ public class TOrderServiceImpl extends ServiceImpl<TOrderMapper, TOrder> impleme ...@@ -77,7 +100,7 @@ public class TOrderServiceImpl extends ServiceImpl<TOrderMapper, TOrder> impleme
if (StringUtils.isEmpty(id)){ if (StringUtils.isEmpty(id)){
return R.failed(OrderConstants.ORDER_ID_IS_EMPTY); return R.failed(OrderConstants.ORDER_ID_IS_EMPTY);
} }
if (CommonConstants.TWO_INT != status && CommonConstants.THREE_INT != status){ if (CommonConstants.ONE_INT != status && CommonConstants.TWO_INT != status){
return R.failed(OrderConstants.STATUS_ERROR); return R.failed(OrderConstants.STATUS_ERROR);
} }
YifuUser user = SecurityUtils.getUser(); YifuUser user = SecurityUtils.getUser();
...@@ -85,7 +108,7 @@ public class TOrderServiceImpl extends ServiceImpl<TOrderMapper, TOrder> impleme ...@@ -85,7 +108,7 @@ public class TOrderServiceImpl extends ServiceImpl<TOrderMapper, TOrder> impleme
if (!Optional.ofNullable(byId).isPresent()){ if (!Optional.ofNullable(byId).isPresent()){
return R.failed(OrderConstants.DATA_IS_EMPTY); return R.failed(OrderConstants.DATA_IS_EMPTY);
} }
if (CommonConstants.THREE_INT == byId.getOrderStatus()){ if (CommonConstants.TWO_INT == byId.getOrderStatus()){
return R.failed(OrderConstants.ORDER_IS_HANDLED); return R.failed(OrderConstants.ORDER_IS_HANDLED);
} }
byId.setOrderStatus(status); byId.setOrderStatus(status);
...@@ -93,7 +116,171 @@ public class TOrderServiceImpl extends ServiceImpl<TOrderMapper, TOrder> impleme ...@@ -93,7 +116,171 @@ public class TOrderServiceImpl extends ServiceImpl<TOrderMapper, TOrder> impleme
byId.setUpdateName(user.getNickname()); byId.setUpdateName(user.getNickname());
byId.setUpdateTime(LocalDateTime.now()); byId.setUpdateTime(LocalDateTime.now());
this.updateById(byId); this.updateById(byId);
// todo 如果是办结完成同步给ekp
return R.ok(OrderConstants.OPERATE_SUCCESS); return R.ok(OrderConstants.OPERATE_SUCCESS);
} }
/**
* 通过id查询详情
*
* @param id
* @return {@link R<OrderDetailVO>}
* @author licancan
*/
@Override
public R<OrderDetailVO> getOrderDetailById(String id) {
if (StringUtils.isEmpty(id)){
return R.failed(OrderConstants.ORDER_ID_IS_EMPTY);
}
OrderDetailVO orderDetailVO = this.baseMapper.getOrderDetailById(id);
//处理订单附件
if (Optional.ofNullable(orderDetailVO).isPresent()){
List<TOrderEnclosure> list = tOrderEnclosureService.list(Wrappers.<TOrderEnclosure>query().lambda()
.eq(TOrderEnclosure::getOrderNo, orderDetailVO.getOrderNo())
.eq(TOrderEnclosure::getEnclosureFlag,CommonConstants.ZERO_INT)
.eq(TOrderEnclosure::getDeleteFlag,CommonConstants.ZERO_INT)
);
if (CollectionUtils.isNotEmpty(list)){
orderDetailVO.setOrderEnclosure(list);
}else {
orderDetailVO.setOrderEnclosure(Lists.newArrayList());
}
}
return R.ok(orderDetailVO);
}
/**
* 附件预览下载地址
*
* @param id 附件表id
* @return {@link R}
* @author licancan
*/
@Override
public R getEnclosureUrl(String id) {
if(StringUtils.isEmpty(id)){
return R.failed(OrderConstants.ENCLOSURE_ID_IS_EMPTY);
}
TOrderEnclosure orderEnclosure = tOrderEnclosureService.getById(id);
if (!Optional.ofNullable(orderEnclosure).isPresent()) {
return R.failed(OrderConstants.DATA_IS_EMPTY);
}
String enclosureAddress = orderEnclosure.getEnclosureAddress();
log.info("key:"+enclosureAddress);
URL url = ossUtil.getObjectUrl(null, orderEnclosure.getEnclosureAddress());
return new R<>(url.toString());
}
/**
* 添加回复
*
* @author licancan
* @param file 附件
* @param filePath 附件路径
* @param replyContent 回复内容
* @param orderNo 订单编号
* @return {@link R}
* @throws IOException
*/
@Override
@Transactional(rollbackFor = Exception.class)
public R uploadReplyEnclosure(MultipartFile[] file, String filePath, String replyContent, String orderNo) throws IOException {
YifuUser user = SecurityUtils.getUser();
if (Common.isEmpty(orderNo)){
return R.failed(OrderConstants.ORDER_NO_IS_EMPTY);
}
if (Common.isEmpty(replyContent) && ArrayUtils.isEmpty(file)){
return R.failed(OrderConstants.REPLY_CONTENT_AND_ENCLOSURE_IS_EMPTY);
}
// 校验回复内容200字以内
if (!Common.isEmpty(replyContent) && !ValidityUtil.validate200(replyContent)){
return R.failed(OrderConstants.REPLY_CONTENT_MORE_THAN_200);
}
if (ArrayUtils.isNotEmpty(file)){
if (file.length > CommonConstants.TWENTY_INT){
return R.failed(OrderConstants.ENCLOSURE_SIZE_ERROR);
}
for (MultipartFile multipartFile : file) {
if(!Common.checkInsuranceFile(multipartFile.getOriginalFilename())){
return R.failed(OrderConstants.ENCLOSURE_TYPE_IS_ERROR);
}
if (multipartFile.getSize() > (CommonConstants.FIFTY_INT*CommonConstants.BYTE*CommonConstants.BYTE)){
return R.failed(OrderConstants.ENCLOSURE_SIZE_ERROR);
}
}
}
TOrderReply reply = new TOrderReply();
reply.setOrderNo(orderNo);
reply.setReplyContent(Common.isEmpty(replyContent)?null:replyContent);
reply.setCreateName(user.getNickname());
reply.setCreateTime(LocalDateTime.now());
reply.setDeleteFlag(CommonConstants.ZERO_INT);
boolean save = tOrderReplyService.save(reply);
//todo 同步推送ekp
if (save && ArrayUtils.isNotEmpty(file)){
for (MultipartFile multipartFile : file) {
String fileName = System.currentTimeMillis() + "_" + multipartFile.getOriginalFilename();
//filePath不传默认存储空间的根目录
//支持的附件格式
String key = "";
if (!Common.isNotNull(filePath)) {
key = fileName;
} else {
key = filePath + "/" + fileName;
}
boolean flag = ossUtil.uploadFileByStream(multipartFile.getInputStream(), key, null);
if (flag) {
log.info("文件:" + fileName + "上传至存储空间" + ossUtil.getBucketName() + "成功!");
TOrderEnclosure orderEnclosure = new TOrderEnclosure();
orderEnclosure.setOrderNo(reply.getId());
orderEnclosure.setEnclosureName(multipartFile.getOriginalFilename());
orderEnclosure.setEnclosureFlag(CommonConstants.ONE_INT);
orderEnclosure.setEnclosureAddress(key);
orderEnclosure.setDeleteFlag(CommonConstants.ZERO_INT);
try {
tOrderEnclosureService.save(orderEnclosure);
} catch (Exception e) {
log.error("OSS文件上传接口异常:" + e.getMessage());
ossUtil.deleteObject(null, key);
return R.failed("failed:" + e.getMessage());
}
} else {
return R.failed(OrderConstants.OPERATE_FAILED);
}
}
}
return R.ok(OrderConstants.OPERATE_SUCCESS);
}
/**
* 订单回复列表分页查询
*
* @param page
* @param orderNo
* @return {@link IPage<OrderReplyListVO>}
* @author licancan
*/
@Override
public IPage<OrderReplyListVO> getOrderReplyPageList(Page<OrderReplyListVO> page, String orderNo) {
IPage<OrderReplyListVO> orderReplyList = baseMapper.getOrderReplyPageList(page,orderNo);
if (CollectionUtils.isNotEmpty(orderReplyList.getRecords())){
orderReplyList.getRecords().stream().forEach(e ->{
List<TOrderEnclosure> list = tOrderEnclosureService.list(Wrappers.<TOrderEnclosure>query().lambda()
.eq(TOrderEnclosure::getOrderNo, e.getId())
.eq(TOrderEnclosure::getEnclosureFlag,CommonConstants.ONE_INT)
.eq(TOrderEnclosure::getDeleteFlag,CommonConstants.ZERO_INT)
);
if (CollectionUtils.isNotEmpty(list)){
e.setOrderReplyEnclosure(list);
}else {
e.setOrderReplyEnclosure(Lists.newArrayList());
}
});
}
return orderReplyList;
}
} }
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
<mapper namespace="com.yifu.cloud.plus.v1.yifu.order.mapper.TOrderEnclosureMapper"> <mapper namespace="com.yifu.cloud.plus.v1.yifu.order.mapper.TOrderEnclosureMapper">
<resultMap id="BaseResultMap" type="com.yifu.cloud.plus.v1.yifu.order.entity.TOrderEnclosure"> <resultMap id="BaseResultMap" type="com.yifu.cloud.plus.v1.yifu.order.entity.TOrderEnclosure">
<id property="id" column="ID" jdbcType="INTEGER"/> <id property="id" column="ID" jdbcType="VARCHAR"/>
<result property="orderNo" column="ORDER_NO" jdbcType="VARCHAR"/> <result property="orderNo" column="ORDER_NO" jdbcType="VARCHAR"/>
<result property="enclosureName" column="ENCLOSURE_NAME" jdbcType="VARCHAR"/> <result property="enclosureName" column="ENCLOSURE_NAME" jdbcType="VARCHAR"/>
<result property="remark" column="REMARK" jdbcType="VARCHAR"/> <result property="remark" column="REMARK" jdbcType="VARCHAR"/>
......
...@@ -115,4 +115,31 @@ ...@@ -115,4 +115,31 @@
ORDER BY t.ORDER_STATUS,t.CREATE_TIME DESC ORDER BY t.ORDER_STATUS,t.CREATE_TIME DESC
</select> </select>
<select id="getOrderDetailById" resultType="com.yifu.cloud.plus.v1.yifu.order.vo.OrderDetailVO">
select
t.CREATE_NAME as createName,
t.CREATE_TIME as createTime,
t.DEPT_NO as deptNo,
t.DEPT_NAME as deptName,
t.ORDER_NO as orderNo,
t.CUSTOMER_NAME as customerName,
t.ORDER_STATUS as orderStatus,
t.ORDER_CONTENT as orderContent
from t_order t
where t.ID = #{id}
</select>
<select id="getOrderReplyPageList" resultType="com.yifu.cloud.plus.v1.yifu.order.vo.OrderReplyListVO">
select
t.ID as id,
t.ORDER_NO as orderNo,
t.CREATE_NAME as createName,
t.CREATE_TIME as createTime,
t.REPLY_CONTENT as replyContent
from t_order_reply t
where t.DELETE_FLAG = 0
and t.ORDER_NO = #{orderNo}
ORDER BY t.CREATE_TIME DESC
</select>
</mapper> </mapper>
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
<mapper namespace="com.yifu.cloud.plus.v1.yifu.order.mapper.TOrderReplyMapper"> <mapper namespace="com.yifu.cloud.plus.v1.yifu.order.mapper.TOrderReplyMapper">
<resultMap id="BaseResultMap" type="com.yifu.cloud.plus.v1.yifu.order.entity.TOrderReply"> <resultMap id="BaseResultMap" type="com.yifu.cloud.plus.v1.yifu.order.entity.TOrderReply">
<id property="id" column="ID" jdbcType="INTEGER"/> <id property="id" column="ID" jdbcType="VARCHAR"/>
<result property="orderNo" column="ORDER_NO" jdbcType="VARCHAR"/> <result property="orderNo" column="ORDER_NO" jdbcType="VARCHAR"/>
<result property="replyContent" column="REPLY_CONTENT" jdbcType="VARCHAR"/> <result property="replyContent" column="REPLY_CONTENT" jdbcType="VARCHAR"/>
<result property="createName" column="CREATE_NAME" jdbcType="VARCHAR"/> <result property="createName" column="CREATE_NAME" jdbcType="VARCHAR"/>
......
...@@ -20,7 +20,7 @@ package com.yifu.cloud.plus.v1.yifu.salary.mapper; ...@@ -20,7 +20,7 @@ package com.yifu.cloud.plus.v1.yifu.salary.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
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.THaveSalaryNosocial; 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.entity.TSalaryAccount;
import com.yifu.cloud.plus.v1.yifu.salary.vo.AccountCheckVo; import com.yifu.cloud.plus.v1.yifu.salary.vo.AccountCheckVo;
...@@ -97,7 +97,7 @@ public interface TSalaryAccountMapper extends BaseMapper<TSalaryAccount> { ...@@ -97,7 +97,7 @@ public interface TSalaryAccountMapper extends BaseMapper<TSalaryAccount> {
* @Date: 2022/8/29 16:52 * @Date: 2022/8/29 16:52
* @return: java.util.List<com.yifu.cloud.plus.v1.yifu.ekp.vo.EkpSalaryParam> * @return: java.util.List<com.yifu.cloud.plus.v1.yifu.ekp.vo.EkpSalaryParam>
**/ **/
List<EkpSalaryParam> getEkpSalaryParamList(@Param("salaryId") String salaryId); List<EkpSalaryParamVo> getEkpSalaryParamList(@Param("salaryId") String salaryId);
List<TSalaryAccount> noPageDiy(@Param("searchVo") TSalaryAccountSearchVo searchVo, List<TSalaryAccount> noPageDiy(@Param("searchVo") TSalaryAccountSearchVo searchVo,
@Param("idList")List<String> idList); @Param("idList")List<String> idList);
......
...@@ -20,7 +20,7 @@ package com.yifu.cloud.plus.v1.yifu.salary.service; ...@@ -20,7 +20,7 @@ package com.yifu.cloud.plus.v1.yifu.salary.service;
import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService; import com.baomidou.mybatisplus.extension.service.IService;
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.THaveSalaryNosocial; 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.entity.TSalaryAccount;
import com.yifu.cloud.plus.v1.yifu.salary.vo.TSalaryAccountSearchVo; import com.yifu.cloud.plus.v1.yifu.salary.vo.TSalaryAccountSearchVo;
...@@ -95,5 +95,5 @@ public interface TSalaryAccountService extends IService<TSalaryAccount> { ...@@ -95,5 +95,5 @@ public interface TSalaryAccountService extends IService<TSalaryAccount> {
* @Date: 2022/8/29 16:54 * @Date: 2022/8/29 16:54
* @return: java.util.List<com.yifu.cloud.plus.v1.yifu.ekp.vo.EkpSalaryParam> * @return: java.util.List<com.yifu.cloud.plus.v1.yifu.ekp.vo.EkpSalaryParam>
**/ **/
List<EkpSalaryParam> getEkpSalaryParamList(String salaryId); List<EkpSalaryParamVo> getEkpSalaryParamList(String salaryId);
} }
...@@ -19,16 +19,14 @@ package com.yifu.cloud.plus.v1.yifu.salary.service.impl; ...@@ -19,16 +19,14 @@ package com.yifu.cloud.plus.v1.yifu.salary.service.impl;
import com.alibaba.excel.EasyExcel; import com.alibaba.excel.EasyExcel;
import com.alibaba.excel.ExcelWriter; import com.alibaba.excel.ExcelWriter;
import com.alibaba.excel.write.metadata.WriteSheet; 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.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; 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.constant.CommonConstants;
import com.yifu.cloud.plus.v1.yifu.common.core.util.Common; 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.DateUtil;
import com.yifu.cloud.plus.v1.yifu.common.core.util.ExcelUtil; import com.yifu.cloud.plus.v1.yifu.common.core.util.ExcelUtil;
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.THaveSalaryNosocial; 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.entity.TSalaryAccount;
import com.yifu.cloud.plus.v1.yifu.salary.mapper.TSalaryAccountMapper; import com.yifu.cloud.plus.v1.yifu.salary.mapper.TSalaryAccountMapper;
...@@ -203,7 +201,7 @@ public class TSalaryAccountServiceImpl extends ServiceImpl<TSalaryAccountMapper, ...@@ -203,7 +201,7 @@ public class TSalaryAccountServiceImpl extends ServiceImpl<TSalaryAccountMapper,
} }
@Override @Override
public List<EkpSalaryParam> getEkpSalaryParamList(String salaryId) { public List<EkpSalaryParamVo> getEkpSalaryParamList(String salaryId) {
return baseMapper.getEkpSalaryParamList(salaryId); return baseMapper.getEkpSalaryParamList(salaryId);
} }
......
...@@ -38,6 +38,7 @@ import com.yifu.cloud.plus.v1.yifu.common.dapr.util.HttpDaprUtil; ...@@ -38,6 +38,7 @@ 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.common.security.util.SecurityUtils;
import com.yifu.cloud.plus.v1.yifu.ekp.util.EkpSalaryUtil; 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.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.MSalaryEstimate;
import com.yifu.cloud.plus.v1.yifu.salary.entity.TApprovalRecord; import com.yifu.cloud.plus.v1.yifu.salary.entity.TApprovalRecord;
import com.yifu.cloud.plus.v1.yifu.salary.entity.TSalaryAccount; import com.yifu.cloud.plus.v1.yifu.salary.entity.TSalaryAccount;
...@@ -52,6 +53,7 @@ import com.yifu.cloud.plus.v1.yifu.salary.vo.TSalaryStandardExportVo; ...@@ -52,6 +53,7 @@ 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.TSalaryStandardSearchVo;
import com.yifu.cloud.plus.v1.yifu.salary.vo.TSalaryStandardVo; import com.yifu.cloud.plus.v1.yifu.salary.vo.TSalaryStandardVo;
import lombok.extern.log4j.Log4j2; import lombok.extern.log4j.Log4j2;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.context.properties.EnableConfigurationProperties; import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
...@@ -415,25 +417,27 @@ public class TSalaryStandardServiceImpl extends ServiceImpl<TSalaryStandardMappe ...@@ -415,25 +417,27 @@ public class TSalaryStandardServiceImpl extends ServiceImpl<TSalaryStandardMappe
return R.failed("未找到工资表"); return R.failed("未找到工资表");
} else if (s.getStatus() == SalaryConstants.STATUS[2] || s.getStatus() == SalaryConstants.STATUS[10]) { } else if (s.getStatus() == SalaryConstants.STATUS[2] || s.getStatus() == SalaryConstants.STATUS[10]) {
//报账表 //报账表
List<EkpSalaryParam> salaryAccountList = salaryAccountService.getEkpSalaryParamList(id); List<EkpSalaryParamVo> ekpList = salaryAccountService.getEkpSalaryParamList(id);
YifuUser user = SecurityUtils.getUser(); YifuUser user = SecurityUtils.getUser();
if (user != null && salaryAccountList != null && !salaryAccountList.isEmpty()) { if (user != null && ekpList != null && !ekpList.isEmpty()) {
boolean sendStatus = true; boolean sendStatus = true;
String sendBack; String sendBack;
List<TSalaryAccount> accountList = new ArrayList<>(); List<TSalaryAccount> accountList = new ArrayList<>();
TSalaryAccount account; TSalaryAccount account;
Date sendTime = new Date(); Date sendTime = new Date();
String nowMonth = DateUtil.addMonth(0); String nowMonth = DateUtil.addMonth(0);
for (EkpSalaryParam sendParam : salaryAccountList) { EkpSalaryParam sendParam;
for (EkpSalaryParamVo sendParamVo : ekpList) {
// 转化报账表的参数 // 转化报账表的参数
account = new TSalaryAccount(); account = new TSalaryAccount();
account.setId(sendParam.getFd_id()); account.setId(sendParamVo.getSalaryAccountId());
sendParam.setFd_id(null); sendParam = new EkpSalaryParam();
BeanUtils.copyProperties(sendParamVo, sendParam);
sendBack = ekpSalaryUtil.sendToEKP(sendParam); sendBack = ekpSalaryUtil.sendToEKP(sendParam);
account.setSendTime(sendTime); account.setSendTime(sendTime);
account.setSendUser(user.getId()); account.setSendUser(user.getId());
account.setSendUserName(user.getNickname()); account.setSendUserName(user.getNickname());
if (Common.isNotNull(sendBack)) { if (Common.isNotNull(sendBack) && sendBack.length() == 32) {
account.setSendStatus(CommonConstants.ONE_STRING); account.setSendStatus(CommonConstants.ONE_STRING);
account.setSendMonth(nowMonth); account.setSendMonth(nowMonth);
account.setEkpId(sendBack); account.setEkpId(sendBack);
......
...@@ -80,8 +80,8 @@ ...@@ -80,8 +80,8 @@
</resultMap> </resultMap>
<!-- 对接EKP的参数 --> <!-- 对接EKP的参数 -->
<resultMap id="ekpSalaryParamMap" type="com.yifu.cloud.plus.v1.yifu.ekp.vo.EkpSalaryParam"> <resultMap id="ekpSalaryParamVoMap" type="com.yifu.cloud.plus.v1.yifu.ekp.vo.EkpSalaryParamVo">
<id property="fd_id" column="fd_id"/> <id property="salaryAccountId" column="id"/>
<result property="fd_3adfedf98ccba2" column="fd_3adfedf98ccba2"/> <result property="fd_3adfedf98ccba2" column="fd_3adfedf98ccba2"/>
<result property="fd_3adfedf9d2bf1c" column="fd_3adfedf9d2bf1c"/> <result property="fd_3adfedf9d2bf1c" column="fd_3adfedf9d2bf1c"/>
<result property="fd_3adfedfacd65d6" column="fd_3adfedfacd65d6"/> <result property="fd_3adfedfacd65d6" column="fd_3adfedfacd65d6"/>
...@@ -108,6 +108,41 @@ ...@@ -108,6 +108,41 @@
<result property="fd_3adfee20fe5ba4" column="fd_3adfee20fe5ba4"/> <result property="fd_3adfee20fe5ba4" column="fd_3adfee20fe5ba4"/>
<result property="fd_3af9d49d165e90" column="fd_3af9d49d165e90"/> <result property="fd_3af9d49d165e90" column="fd_3af9d49d165e90"/>
<result property="fd_3afab1895feea2" column="fd_3afab1895feea2"/> <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> </resultMap>
<sql id="Base_Column_List"> <sql id="Base_Column_List">
a.ID, a.ID,
...@@ -400,35 +435,68 @@ ...@@ -400,35 +435,68 @@
</select> </select>
<!-- 获取薪资明细 --> <!-- 获取薪资明细 -->
<select id="getEkpSalaryParamList" resultMap="ekpSalaryParamMap"> <select id="getEkpSalaryParamList" resultMap="ekpSalaryParamVoMap">
select select
a.id fd_id a.id fd_id
,a.DEPT_NO fd_3adfedf98ccba2 ,ifnull(a.DEPT_NO,'') fd_3adfedf98ccba2
,a.DEPT_NAME fd_3adfedf9d2bf1c ,ifnull(a.DEPT_NAME,'') fd_3adfedf9d2bf1c
,s.UNIT_NO fd_3adfedfacd65d6 ,'' fd_3adfedfa4410aa
,s.UNIT_NAME fd_3adfedfb174068 ,ifnull(s.UNIT_NO,'') fd_3adfedfacd65d6
,a.EMP_NAME fd_3adfedfb5a68a2 ,ifnull(s.UNIT_NAME,'') fd_3adfedfb174068
,a.EMP_IDCARD fd_3adfedfb8f76d4 ,ifnull(a.EMP_NAME,'') fd_3adfedfb5a68a2
,a.EMP_PHONE fd_3adfedfbd23ab8 ,ifnull(a.EMP_IDCARD,'') fd_3adfedfb8f76d4
,a.BANK_NO fd_3adfedfcb17f1e ,ifnull(a.EMP_PHONE,'') fd_3adfedfbd23ab8
,a.BANK_NAME fd_3adfedfc453cc4 ,ifnull(a.BANK_NO,'') fd_3adfedfcb17f1e
,a.SALARY_MONTH fd_3adfee063acff0 ,ifnull(a.BANK_NAME,'') fd_3adfedfc453cc4
,a.SETTLEMENT_MONTH fd_3adfee0690737c ,ifnull(a.SALARY_MONTH,'') fd_3adfee063acff0
,ifnull(a.SETTLEMENT_MONTH,'') fd_3adfee0690737c
,'1' fd_3adfee01668666 ,'1' fd_3adfee01668666
,a.SOCIAL_PRIORITY fd_3adfedfed8bb28 ,ifnull(a.SOCIAL_PRIORITY,'') fd_3adfedfed8bb28
,a.FUND_PRIORITY fd_3adfedff3a7430 ,ifnull(a.FUND_PRIORITY,'') fd_3adfedff3a7430
,a.OWN_FLAG fd_3adfee0009d070 ,ifnull(a.OWN_FLAG,'') fd_3adfee0009d070
,a.ANNUAL_BONUS_TYPE fd_3adfee01dea2fa ,ifnull(a.ANNUAL_BONUS_TYPE,'') fd_3adfee01dea2fa
,a.RELAY_SALARY fd_3adfee12cb8840 ,ifnull(a.RELAY_SALARY,'') fd_3adfee12cb8840
,pdeduction.SALARY_MONEY fd_3adfee1374ed7a ,ifnull(pdeduction.SALARY_MONEY,'') fd_3adfee1374ed7a
,ifnull(withholidingUnitSocial.SALARY_MONEY,unitSocial.SALARY_MONEY) fd_3adfee1e2b2f78 ,ifnull(ifnull(withholidingUnitSocial.SALARY_MONEY,unitSocial.SALARY_MONEY),'') fd_3adfee1e2b2f78
,ifnull(withholidingPersonSocial.SALARY_MONEY,personalSocial.SALARY_MONEY) fd_3adfee1e88723e ,ifnull(ifnull(withholidingPersonSocial.SALARY_MONEY,personalSocial.SALARY_MONEY),'') fd_3adfee1e88723e
,ifnull(withholidingUnitFund.SALARY_MONEY,unitFund.SALARY_MONEY) fd_3adfee1ee24680 ,ifnull(ifnull(withholidingUnitFund.SALARY_MONEY,unitFund.SALARY_MONEY),'') fd_3adfee1ee24680
,ifnull(withholidingPersonFund.SALARY_MONEY,personalFund.SALARY_MONEY) fd_3adfee1f32fa24 ,ifnull(ifnull(withholidingPersonFund.SALARY_MONEY,personalFund.SALARY_MONEY),'') fd_3adfee1f32fa24
,a.SALARY_TAX fd_3adfee1f901c46 ,ifnull(a.SALARY_TAX,'') fd_3adfee1f901c46
,a.ACTUAL_SALARY fd_3adfee20fe5ba4 ,'' fd_3adfee1ff1ca6a
,a.SALARY_GIVE_TIME fd_3af9d49d165e90 ,'' fd_3adfee203f86b2
,a.INVOICE_TITLE fd_3afab1895feea2 ,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 from t_salary_account a
LEFT JOIN t_salary_standard s on a.SALARY_FORM_ID=s.ID 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 withholidingPersonSocial on withholidingPersonSocial.SALARY_ACCOUNT_ID = a.id and withholidingPersonSocial.JAVA_FIED_NAME='withholidingPersonSocial'
......
...@@ -258,7 +258,7 @@ ...@@ -258,7 +258,7 @@
where m.declare_MONTH <![CDATA[<=]]> #{lastMonth} and m.declare_MONTH like '${nowYear}%' where m.declare_MONTH <![CDATA[<=]]> #{lastMonth} and m.declare_MONTH like '${nowYear}%'
GROUP BY m.EMP_IDCARD,m.INVOICE_TITLE GROUP BY m.EMP_IDCARD,m.INVOICE_TITLE
) m on m.EMP_IDCARD=s.EMP_IDCARD and m.INVOICE_TITLE = s.INVOICE_TITLE ) m on m.EMP_IDCARD=s.EMP_IDCARD and m.INVOICE_TITLE = s.INVOICE_TITLE
left join t_statistics_declarer d on d.EMP_IDCARD=s.EMP_IDCARD and d.DECLARE_MONTH=#{nowMonth} left join t_statistics_declarer d on d.EMP_IDCARD=s.EMP_IDCARD and d.DECLARE_MONTH=#{lastMonth}
where s.DECLARE_MONTH = #{nowMonth} and (d.id is null or d.IS_DECLARE = '0') where s.DECLARE_MONTH = #{nowMonth} and (d.id is null or d.IS_DECLARE = '0')
) )
</insert> </insert>
......
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