Commit 06c1a3d8 authored by fangxinjiang's avatar fangxinjiang

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

parents e6127c44 62432d18
......@@ -67,7 +67,7 @@ public class ValidityConstants {
/** 最多60位 规则 */
public static final String PATTERN_60 = "^.{1,60}$";
/** 最多200位 规则 */
public static final String PATTERN_200 = "^.{1,200}$";
public static final String PATTERN_200 = "[\\s\\S]{1,200}$";
/** 不超过两位小数的正数 */
public static final String POSITIVE_INTEGER_PATTERN_TWO_FLOAT = "^[+]?([0-9]+(.[0-9]{1,2})?)$";
......
......@@ -37,5 +37,10 @@
<version>1.0.0</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>commons-io</groupId>
<artifactId>commons-io</artifactId>
<version>2.6</version>
</dependency>
</dependencies>
</project>
package com.yifu.cloud.plus.v1.yifu.ekp.config;
import lombok.Data;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.PropertySource;
import org.springframework.stereotype.Component;
/**
* @author licancan
* @description 对接ekp订单
* @date 2022-08-31 15:35:20
*/
@Data
@Component
@PropertySource("classpath:ekpOrderConfig.properties")
@ConfigurationProperties(value = "ekporder",ignoreInvalidFields = false)
public class EkpOrderProperties {
/**
* 接口url
*/
String url;
/**
* 订单modelId
*/
String orderFdModelId;
/**
* 订单flowID
*/
String orderFdFlowId;
/**
* 订单回复modelId
*/
String replyFdModelId;
/**
* 订单回复flowID
*/
String replyFdFlowId;
/**
* 订单附件key
*/
String replyAttachKey;
String docStatus;
String LoginName;
/**
* 描述:用于项目订单更新接口
*/
String orderDocSubject;
/**
* 描述:用于订单回复接口
*/
String replyDocSubject;
}
package com.yifu.cloud.plus.v1.yifu.ekp.util;
import com.yifu.cloud.plus.v1.yifu.ekp.config.EkpOrderProperties;
import com.yifu.cloud.plus.v1.yifu.ekp.constant.EkpConstants;
import com.yifu.cloud.plus.v1.yifu.ekp.vo.AttachmentForm;
import com.yifu.cloud.plus.v1.yifu.ekp.vo.EkpOrderParam;
import com.yifu.cloud.plus.v1.yifu.ekp.vo.EkpOrderReplyParam;
import io.micrometer.core.instrument.util.StringUtils;
import lombok.extern.log4j.Log4j2;
import org.apache.commons.io.FileUtils;
import org.apache.commons.lang.ArrayUtils;
import org.codehaus.jackson.map.ObjectMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.http.*;
import org.springframework.util.LinkedMultiValueMap;
import org.springframework.util.MultiValueMap;
import org.springframework.web.client.RestTemplate;
import org.springframework.web.multipart.MultipartFile;
import javax.activation.DataHandler;
import javax.activation.DataSource;
import javax.activation.FileDataSource;
import java.io.File;
import java.util.ArrayList;
import java.util.List;
/**
* @author licancan
* @description 对接ekp订单
* @date 2022-08-31 15:35:20
*/
@Log4j2
@EnableConfigurationProperties(EkpOrderProperties.class)
public class EkpOrderUtil {
@Autowired
private EkpOrderProperties ekpProperties;
/**
* 更新订单状态
*
* @author licancan
* @param param
* @return {@link String}
*/
public String sendOrderToEKP(EkpOrderParam param){
log.info("推送EKP开始--订单状态");
RestTemplate yourRestTemplate = new RestTemplate();
try{
String formValues = new ObjectMapper().writeValueAsString(param);
//指向EKP的接口url
//把ModelingAppModelParameterAddForm转换成MultiValueMap
MultiValueMap<String,Object> wholeForm = new LinkedMultiValueMap<>();
wholeForm.add("docSubject",ekpProperties.getOrderDocSubject());
wholeForm.add("docCreator", "{\"LoginName\":\"admin\"}");
wholeForm.add("docStatus", ekpProperties.getDocStatus());
wholeForm.add("fdModelId", ekpProperties.getOrderFdModelId());
wholeForm.add("fdFlowId", ekpProperties.getOrderFdFlowId());
wholeForm.add("formValues", formValues);
log.info("wholeForm:" + wholeForm);
HttpHeaders headers = new HttpHeaders();
//如果EKP对该接口启用了Basic认证,那么客户端需要加入
//addAuth(headers,"yourAccount"+":"+"yourPassword");是VO,则使用APPLICATION_JSON
headers.setContentType(MediaType.MULTIPART_FORM_DATA);
//必须设置上传类型,如果入参是字符串,使用MediaType.TEXT_PLAIN;如果
HttpEntity<MultiValueMap<String,Object>> entity = new HttpEntity<MultiValueMap<String,Object>>(wholeForm,headers);
//有返回值的情况 VO可以替换成具体的JavaBean
ResponseEntity<String> obj = yourRestTemplate.exchange(ekpProperties.getUrl(), HttpMethod.POST, entity, String.class);
String body = obj.getBody();
if (StringUtils.isBlank(body)){
log.error(EkpConstants.SEND_FAILED);
return null;
}else{
log.info(EkpConstants.SEND_SUCCESS + body);
return body;
}
}catch (Exception e){
log.error(e);
return null;
}
}
/**
* 推送订单回复
*
* @author licancan
* @param param
* @return {@link String}
*/
public String sendReplyToEKP(EkpOrderReplyParam param, MultipartFile[] multipartFiles){
log.info("推送EKP开始--订单回复信息");
RestTemplate yourRestTemplate = new RestTemplate();
List<AttachmentForm> fileList = createAllAttach(multipartFiles);
try{
String formValues = new ObjectMapper().writeValueAsString(param);
//指向EKP的接口url
//把ModelingAppModelParameterAddForm转换成MultiValueMap
MultiValueMap<String,Object> wholeForm = new LinkedMultiValueMap<>();
wholeForm.add("docSubject",ekpProperties.getReplyDocSubject());
wholeForm.add("docCreator", "{\"LoginName\":\"admin\"}");
wholeForm.add("docStatus", ekpProperties.getDocStatus());
wholeForm.add("fdModelId", ekpProperties.getReplyFdModelId());
wholeForm.add("fdFlowId", ekpProperties.getReplyFdFlowId());
wholeForm.add("formValues", formValues);
wholeForm.add("attachmentForms", fileList);
log.info("wholeForm:" + wholeForm);
HttpHeaders headers = new HttpHeaders();
//如果EKP对该接口启用了Basic认证,那么客户端需要加入
//addAuth(headers,"yourAccount"+":"+"yourPassword");是VO,则使用APPLICATION_JSON
headers.setContentType(MediaType.MULTIPART_FORM_DATA);
//必须设置上传类型,如果入参是字符串,使用MediaType.TEXT_PLAIN;如果
HttpEntity<MultiValueMap<String,Object>> entity = new HttpEntity<MultiValueMap<String,Object>>(wholeForm,headers);
//有返回值的情况 VO可以替换成具体的JavaBean
ResponseEntity<String> obj = yourRestTemplate.exchange(ekpProperties.getUrl(), HttpMethod.POST, entity, String.class);
String body = obj.getBody();
if (StringUtils.isBlank(body)){
log.error(EkpConstants.SEND_FAILED);
return null;
}else{
log.info(EkpConstants.SEND_SUCCESS + body);
return body;
}
}catch (Exception e){
log.error(e);
return null;
}finally {
//将产生的临时附件删除,这里的fileList没值得话是[],不会是null,如果是null需要做判空处理
fileList.stream().forEach(e -> {
FileDataSource dataSource = (FileDataSource)e.getFdAttachment().getDataSource();
boolean delete = dataSource.getFile().delete();
log.info("临时附件删除结果:",delete);
});
}
}
/**
* 处理成ekp要的附件格式
*
* @author licancan
* @param multipartFiles
* @return {@link List<AttachmentForm>}
*/
public List<AttachmentForm> createAllAttach(MultipartFile[] multipartFiles){
List<AttachmentForm> attForms = new ArrayList<>();
if (ArrayUtils.isNotEmpty(multipartFiles)){
try {
for (MultipartFile multipartFile : multipartFiles) {
AttachmentForm attForm = new AttachmentForm();
//设置附件关键字,注意附件列表的key是一样的
attForm.setFdKey(ekpProperties.getReplyAttachKey());
attForm.setFdFileName(multipartFile.getOriginalFilename());
File file = new File(multipartFile.getOriginalFilename());
FileUtils.copyInputStreamToFile(multipartFile.getInputStream(), file);
DataSource dataSource = new FileDataSource(file);
DataHandler dataHandler = new DataHandler(dataSource);
attForm.setFdAttachment(dataHandler);
attForms.add(attForm);
}
}catch (Exception e){
log.error("createAllAttach--->error:",e);
}
}
return attForms;
}
}
package com.yifu.cloud.plus.v1.yifu.ekp.vo;
import lombok.Data;
import javax.activation.DataHandler;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlMimeType;
/**
* @author licancan
* @description ekp附件类
* @date 2022-08-31 17:02:49
*/
@XmlAccessorType(XmlAccessType.FIELD)
@Data
public class AttachmentForm {
private String fdKey;
private String fdFileName;
@XmlMimeType("application/octet-stream")
private DataHandler fdAttachment;
}
package com.yifu.cloud.plus.v1.yifu.ekp.vo;
import lombok.Data;
import java.io.Serializable;
/**
* @author licancan
* @description 对接ekp订单请求参数
* @date 2022-08-31 15:35:20
*/
@Data
public class EkpOrderParam implements Serializable {
private static final long serialVersionUID = 8276721461475968927L;
/**
* 订单编号
**/
private String fd_3b0b02a93e9cda;
/**
* 订单状态 待处理,处理中,已办结
**/
private String fd_3b0b02a34a0134;
}
package com.yifu.cloud.plus.v1.yifu.ekp.vo;
import lombok.Data;
import java.io.Serializable;
/**
* @author licancan
* @description 对接ekp订单回复请求参数
* @date 2022-08-31 15:35:20
*/
@Data
public class EkpOrderReplyParam implements Serializable {
private static final long serialVersionUID = 8671347855651484998L;
/**
* 订单编号
**/
private String fd_3ac904bbaf972a;
/**
* 回复人 (人员账号)
**/
private String fd_3ac904badcaa06;
/**
* 回复时间
**/
private String fd_3ac904b8590598;
/**
* 回复内容
*/
private String fd_3ac904c7798e5c;
}
org.springframework.boot.autoconfigure.EnableAutoConfiguration=\
com.yifu.cloud.plus.v1.yifu.ekp.util.EkpOrderUtil,\
com.yifu.cloud.plus.v1.yifu.ekp.util.EkpInsuranceUtil,\
com.yifu.cloud.plus.v1.yifu.ekp.util.EkpSalaryUtil,\
com.yifu.cloud.plus.v1.yifu.ekp.util.EkpSocialUtil,\
......
ekporder.url=http://119.96.227.251:8080/api/sys-modeling/appModelRestService/addModel
ekporder.orderFdModelId=182f1b7ffe2e96f975564e44e559847d
ekporder.orderFdFlowId=182f1c098ce991ca96bc927408792beb
ekporder.replyFdModelId=182f1bb35bb2156fb9a02904bc88dd8a
ekporder.replyFdFlowId=182f1c3d6f5724e335b88d544be8c993
ekporder.replyAttachKey=fd_3ac904c9342fe2
ekporder.docStatus=20
ekporder.LoginName=admin
ekporder.orderDocSubject=\u7528\u4e8e\u9879\u76ee\u8ba2\u5355\u66f4\u65b0\u63a5\u53e3
ekporder.replyDocSubject=\u7528\u4e8e\u8ba2\u5355\u56de\u590d\u63a5\u53e3
......@@ -995,14 +995,14 @@ public class InsurancesConstants {
public static final String SETTLE_ZERO = "未结算";
/**
* 已结算
* 结算中
*/
public static final String SETTLE_ONE = "已结算";
public static final String SETTLE_ONE = "结算中";
/**
* 结算中
* 已结算
*/
public static final String SETTLE_TWO = "结算中";
public static final String SETTLE_TWO = "已结算";
/**
* 无需结算
......
......@@ -325,6 +325,12 @@ public class InsuranceDetailVO implements Serializable {
@Schema(description = "被替换人项目名称(替换类型专用字段)")
private String coverProjectName;
/**
* 被替换人封面抬头
*/
@Schema(description = "被替换人封面抬头")
private String coveInvoiceTitle;
/**
* 退保金额 todo 数据库暂时没有
*/
......
......@@ -78,6 +78,12 @@ public class InsuredOrderListVo implements Serializable {
@Schema(description = "创建人(派单人)")
private String createName;
/**
* 创建人id
*/
@Schema(description = "创建人id(派单人id)")
private String createBy;
/**
* 创建人部门名称
*/
......
......@@ -6,6 +6,7 @@ import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.Data;
import java.io.Serializable;
import java.time.LocalDate;
import java.util.List;
/**
......@@ -37,13 +38,13 @@ public class InsuredOrderParam implements Serializable {
* 开始日期
*/
@Schema(description = "开始日期")
private String startDate;
private LocalDate startDate;
/**
* 结束日期
*/
@Schema(description = "结束日期")
private String endDate;
private LocalDate endDate;
/**
* 项目编码列表
......
......@@ -1030,7 +1030,6 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
}
}
if (CollectionUtils.isNotEmpty(successList)){
//todo 判断是否推送过保费到ekp,如果推送过就新增一条负的,将结算表中的数据求和放到明细表中
for (TInsuranceDetail detail : successList) {
if (StringUtils.isNotBlank(detail.getDefaultSettleId())){
TInsuranceSettle settle = tInsuranceSettleService.getById(detail.getDefaultSettleId());
......@@ -1051,12 +1050,16 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
detail.setEstimatePremium(new BigDecimal("0.00"));
}
tInsuranceSettleService.save(burden);
//推送负的给ekp
String s = pushEstimate(detail, CommonConstants.THREE_INT);
//这里退回的时候,必须置为null,防止是实缴的时候,登记保费出错
if(StringUtils.isNotBlank(s)){
detail.setDefaultSettleId(null);
SettleVo settleVo = getInsuranceDetailSettleStatus(detail.getId(), detail.getDefaultSettleId());
if(!Common.isEmpty(settleVo) && InsurancesConstants.SETTLE_ONE.equals(settleVo.getEstimateStatus()) && InsurancesConstants.SETTLE_ONE.equals(settleVo.getActualStatus())){
//推送负的给ekp
String s = pushEstimate(detail, CommonConstants.THREE_INT);
//这里退回的时候,必须置为null,防止是实缴的时候,登记保费出错
if(StringUtils.isNotBlank(s)){
detail.setDefaultSettleId(null);
}
}
}
}
//获取成功数据的remark
......@@ -3169,13 +3172,14 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
if (null != jsonObject){
record.setProjectName(Optional.ofNullable(jsonObject.getDepartName()).orElse(""));
}
TInsuranceDetail detail = new TInsuranceDetail();
TInsuranceDetail detail = getById(record.getId());
TInsuranceRefund refund = new TInsuranceRefund();
detail.setId(record.getId());
//update状态由「待减员」置为「减员中」
detail.setUpdateBy(user.getId());
detail.setUpdateTime(LocalDateTime.now());
detail.setReduceHandleStatus(CommonConstants.TWO_INT);
detailList.add(detail);
refund.setId(detail.getRefundId());
refund.setReduceHandleStatus(CommonConstants.TWO_INT);
......@@ -4496,13 +4500,13 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
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);
if (InsurancesConstants.SETTLE_ONE.equals(settleVo.getEstimateStatus()) || InsurancesConstants.SETTLE_ONE.equals(settleVo.getActualStatus())){
param.setErrorMessage(InsurancesConstants.SETTLE_MONTH_CHANGE_SETTLE_STATUS_TWO_ERROR);
errorList.add(param);
continue;
}
if (InsurancesConstants.SETTLE_TWO.equals(settleVo.getActualStatus())){
param.setErrorMessage(InsurancesConstants.SETTLE_HANDLE_THREE_NOT_REGISTERED);
if (InsurancesConstants.SETTLE_TWO.equals(settleVo.getEstimateStatus()) || InsurancesConstants.SETTLE_TWO.equals(settleVo.getActualStatus())){
param.setErrorMessage(InsurancesConstants.SETTLE_MONTH_CHANGE_SETTLE_STATUS_THREE_ERROR);
errorList.add(param);
continue;
}
......@@ -5003,13 +5007,13 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
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);
if (InsurancesConstants.SETTLE_ONE.equals(settleVo.getEstimateStatus()) || InsurancesConstants.SETTLE_ONE.equals(settleVo.getActualStatus())){
param.setErrorMessage(InsurancesConstants.DEPT_NO_CHANGE_SETTLE_STATUS_TWO_ERROR);
errorList.add(param);
continue;
}
if (InsurancesConstants.SETTLE_TWO.equals(settleVo.getActualStatus())){
param.setErrorMessage(InsurancesConstants.SETTLE_HANDLE_THREE_NOT_REGISTERED);
if (InsurancesConstants.SETTLE_TWO.equals(settleVo.getEstimateStatus()) || InsurancesConstants.SETTLE_TWO.equals(settleVo.getActualStatus())){
param.setErrorMessage(InsurancesConstants.DEPT_NO_CHANGE_SETTLE_STATUS_THREE_ERROR);
errorList.add(param);
continue;
}
......@@ -5387,11 +5391,12 @@ public class TInsuranceDetailServiceImpl extends ServiceImpl<TInsuranceDetailMap
param.setSettleType(InsurancesConstants.ACTUAL_SETTLE_BILL);
pushType = CommonConstants.SEVEN_INT;
}
if(StringUtils.isBlank(eKPInsuranceUtil.sendToEkp(param))){
String s = eKPInsuranceUtil.sendToEkp(param);
if(StringUtils.isBlank(s)){
saveInsuranceEkp(param,pushType);
return null;
}else {
return eKPInsuranceUtil.sendToEkp(param);
return s;
}
}
......
......@@ -133,7 +133,7 @@
and detail.CREATE_NAME like concat('%',replace(replace(#{param.createName},'_','\_'),'%','\%'),'%')
</if>
<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>
ORDER BY detail.BUY_HANDLE_STATUS,detail.CREATE_TIME DESC
</select>
......@@ -194,7 +194,7 @@
and detail.CREATE_NAME like concat('%',replace(replace(#{param.createName},'_','\_'),'%','\%'),'%')
</if>
<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>
ORDER BY detail.BUY_HANDLE_STATUS,detail.CREATE_TIME DESC
</select>
......@@ -254,7 +254,7 @@
and detail.CREATE_NAME like concat('%',replace(replace(#{param.createName},'_','\_'),'%','\%'),'%')
</if>
<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>
ORDER BY detail.BUY_HANDLE_STATUS,detail.CREATE_TIME DESC
</select>
......@@ -386,7 +386,7 @@
and detail.CREATE_NAME like concat('%',replace(replace(#{param.createName},'_','\_'),'%','\%'),'%')
</if>
<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>
ORDER BY detail.CREATE_TIME DESC
</select>
......@@ -452,16 +452,16 @@
and detail.POLICY_NO like concat('%',replace(replace(#{param.policyNo},'_','\_'),'%','\%'),'%')
</if>
<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 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 test="param.policyStart != null and param.policyStart.trim() != '' and param.policyEnd != null and param.policyEnd.trim() != ''">
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_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_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_END <![CDATA[ >= ]]> concat(#{param.policyStart}, ' 00:00:00') and detail.POLICY_END <![CDATA[ <= ]]> concat(#{param.policyEnd}, ' 23:59:59'))
)
</if>
<if test="param.invoiceNo != null and param.invoiceNo.trim() != ''">
......@@ -474,10 +474,10 @@
and detail.IS_OVERDUE = #{param.isOverdue}
</if>
<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 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>
ORDER BY detail.CREATE_TIME DESC ,detail.ID ASC
</select>
......@@ -539,16 +539,16 @@
and detail.POLICY_NO like concat('%',replace(replace(#{param.policyNo},'_','\_'),'%','\%'),'%')
</if>
<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 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 test="param.policyStart != null and param.policyStart.trim() != '' and param.policyEnd != null and param.policyEnd.trim() != ''">
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_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_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_END <![CDATA[ >= ]]> concat(#{param.policyStart}, ' 00:00:00') and detail.POLICY_END <![CDATA[ <= ]]> concat(#{param.policyEnd}, ' 23:59:59'))
)
</if>
<if test="param.invoiceNo != null and param.invoiceNo.trim() != ''">
......@@ -561,10 +561,10 @@
and detail.IS_OVERDUE = #{param.isOverdue}
</if>
<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 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>
ORDER BY detail.CREATE_TIME DESC
</select>
......@@ -613,16 +613,16 @@
and detail.POLICY_NO like concat('%',replace(replace(#{param.policyNo},'_','\_'),'%','\%'),'%')
</if>
<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 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 test="param.policyStart != null and param.policyStart.trim() != '' and param.policyEnd != null and param.policyEnd.trim() != ''">
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_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_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_END <![CDATA[ >= ]]> concat(#{param.policyStart}, ' 00:00:00') and detail.POLICY_END <![CDATA[ <= ]]> concat(#{param.policyEnd}, ' 23:59:59'))
)
</if>
ORDER BY refund.CREATE_TIME DESC,detail.ID ASC
......@@ -679,16 +679,16 @@
and detail.POLICY_NO like concat('%',replace(replace(#{param.policyNo},'_','\_'),'%','\%'),'%')
</if>
<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 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 test="param.policyStart != null and param.policyStart.trim() != '' and param.policyEnd != null and param.policyEnd.trim() != ''">
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_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_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_END <![CDATA[ >= ]]> concat(#{param.policyStart}, ' 00:00:00') and detail.POLICY_END <![CDATA[ <= ]]> concat(#{param.policyEnd}, ' 23:59:59'))
)
</if>
ORDER BY refund.CREATE_TIME DESC
......@@ -749,10 +749,10 @@
and refund.CREATE_NAME like concat('%',replace(replace(#{param.createName},'_','\_'),'%','\%'),'%')
</if>
<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 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>
ORDER BY refund.CREATE_TIME DESC,detail.ID ASC
</select>
......@@ -944,6 +944,7 @@
select
detail.id as id,
detail.BUY_TYPE as buyType,
detail.CREATE_BY as createBy,
detail.EMP_NAME as empName,
detail.EMP_IDCARD_NO as empIdcardNo,
detail.INSURANCE_COMPANY_NAME as insuranceCompanyName,
......@@ -968,11 +969,11 @@
<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 test="param.startDate != null ">
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 test="param.endDate != null ">
AND detail.CREATE_TIME <![CDATA[ <= ]]> concat(#{param.endDate}, ' 23:59:59')
</if>
<if test="param.deptNoList != null">
and detail.DEPT_NO in
......@@ -984,6 +985,7 @@
select
detail.id as id,
refund.BUY_TYPE as buyType,
refund.CREATE_BY as createBy,
detail.EMP_NAME as empName,
detail.EMP_IDCARD_NO as empIdcardNo,
detail.INSURANCE_COMPANY_NAME as insuranceCompanyName,
......@@ -1011,11 +1013,11 @@
<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 test="param.startDate != null">
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 test="param.endDate != null ">
AND refund.CREATE_TIME <![CDATA[ <= ]]> concat(#{param.endDate}, ' 23:59:59')
</if>
<if test="param.deptNoList != null">
and detail.DEPT_NO in
......
......@@ -42,6 +42,10 @@ public class OrderConstants {
* 订单不存在
*/
public static final String ORDER_NO_NOT_EXIST = "订单不存在";
/**
* 订单已办结,无法添加回复
*/
public static final String ORDER_STATUS_IS_TWO = "订单已办结,无法添加回复";
/**
* 订单已存在
*/
......
......@@ -65,6 +65,12 @@
<artifactId>commons-collections</artifactId>
<version>3.2.2</version>
</dependency>
<dependency>
<groupId>com.yifu.cloud.plus.v1</groupId>
<artifactId>yifu-common-ekp</artifactId>
<version>1.0.0</version>
<scope>compile</scope>
</dependency>
</dependencies>
<build>
......
......@@ -10,6 +10,9 @@ 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.vo.YifuUser;
import com.yifu.cloud.plus.v1.yifu.common.security.util.SecurityUtils;
import com.yifu.cloud.plus.v1.yifu.ekp.util.EkpOrderUtil;
import com.yifu.cloud.plus.v1.yifu.ekp.vo.EkpOrderParam;
import com.yifu.cloud.plus.v1.yifu.ekp.vo.EkpOrderReplyParam;
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.TOrderEnclosure;
......@@ -56,6 +59,8 @@ public class TOrderServiceImpl extends ServiceImpl<TOrderMapper, TOrder> impleme
private TOrderHandlerService tOrderHandlerService;
@Resource
private OSSUtil ossUtil;
@Resource
private EkpOrderUtil ekpOrderUtil;
/**
* 订单列表分页查询
......@@ -120,10 +125,39 @@ public class TOrderServiceImpl extends ServiceImpl<TOrderMapper, TOrder> impleme
byId.setUpdateName(user.getNickname());
byId.setUpdateTime(LocalDateTime.now());
this.updateById(byId);
// todo 如果是办结完成同步给ekp
// 状态同步给ekp
EkpOrderParam param = new EkpOrderParam();
param.setFd_3b0b02a93e9cda(byId.getOrderNo());
param.setFd_3b0b02a34a0134(getOrderStatus(status));
//ekpOrderUtil.sendOrderToEKP(param);
return R.ok(OrderConstants.OPERATE_SUCCESS);
}
/**
* 获取订单状态
*
* @author licancan
* @param orderStatus
* @return {@link String}
*/
private String getOrderStatus(Integer orderStatus){
String result;
switch (orderStatus){
case 0:
result = "待处理";
break;
case 1:
result = "处理中";
break;
case 2:
result = "已办结";
break;
default:
result = "";
}
return result;
}
/**
* 通过id查询详情
*
......@@ -200,6 +234,10 @@ public class TOrderServiceImpl extends ServiceImpl<TOrderMapper, TOrder> impleme
);
if (!Optional.ofNullable(one).isPresent()){
return R.failed(OrderConstants.ORDER_NO_NOT_EXIST);
}else {
if (CommonConstants.TWO_INT == one.getOrderStatus()){
return R.failed(OrderConstants.ORDER_STATUS_IS_TWO);
}
}
if (Common.isEmpty(replyContent) && ArrayUtils.isEmpty(file)){
return R.failed(OrderConstants.REPLY_CONTENT_AND_ENCLOSURE_IS_EMPTY);
......@@ -231,7 +269,13 @@ public class TOrderServiceImpl extends ServiceImpl<TOrderMapper, TOrder> impleme
reply.setCreateTime(LocalDateTime.now());
reply.setDeleteFlag(CommonConstants.ZERO_INT);
boolean save = tOrderReplyService.save(reply);
//todo 同步推送ekp
//同步推送ekp
EkpOrderReplyParam param = new EkpOrderReplyParam();
param.setFd_3ac904bbaf972a(orderNo);
param.setFd_3ac904badcaa06(user.getUsername());
param.setFd_3ac904b8590598(reply.getCreateTime().toString());
param.setFd_3ac904c7798e5c(replyContent);
//ekpOrderUtil.sendReplyToEKP(param,file);
if (save && ArrayUtils.isNotEmpty(file)){
for (MultipartFile multipartFile : file) {
String fileName = System.currentTimeMillis() + "_" + multipartFile.getOriginalFilename();
......@@ -408,6 +452,10 @@ public class TOrderServiceImpl extends ServiceImpl<TOrderMapper, TOrder> impleme
);
if (!Optional.ofNullable(one).isPresent()){
return R.failed(OrderConstants.ORDER_NO_NOT_EXIST);
}else {
if (CommonConstants.TWO_INT == one.getOrderStatus()){
return R.failed(OrderConstants.ORDER_STATUS_IS_TWO);
}
}
if (Common.isEmpty(vo.getCreateName())){
return R.failed(OrderConstants.REPLY_NAME_IS_EMPTY);
......
......@@ -34,7 +34,10 @@ import java.math.BigDecimal;
* @date 2022-08-05 11:40:14
*/
@Data
public class TStatisticsCurrentReportMarketVo extends RowIndex implements Serializable {
public class TStatisticsCurrentReportMarketVo implements Serializable {
@ExcelAttribute(name = "行号")
private Integer rowIndex;
/**
* 税务主体(封面抬头)
......
......@@ -135,18 +135,19 @@ public class TStatisticsCurrentReportMarketServiceImpl extends ServiceImpl<TStat
declareMonth = DateUtil.getYearMonth(cachedDataList.get(0).getCreateStart());
}
if (Common.isEmpty(declareMonth)) {
errorMessageList.add(new ErrorMessage(CommonConstants.ZERO_INT
, "请检查‘税款所属期起’单元格格式是文本格式,且满足日期格式yyyy-MM-dd或yyyyMMdd"));
}
try {
Integer.parseInt(declareMonth);
} catch (Exception e) {
errorMessageList.add(new ErrorMessage(CommonConstants.ZERO_INT
errorMessageList.add(new ErrorMessage(CommonConstants.TWO_INT
, "请检查‘税款所属期起’单元格格式是文本格式,且满足日期格式yyyy-MM-dd或yyyyMMdd"));
} else {
try {
Integer.parseInt(declareMonth);
} catch (Exception e) {
errorMessageList.add(new ErrorMessage(CommonConstants.TWO_INT
, "请检查‘税款所属期起’单元格格式是文本格式,且满足日期格式yyyy-MM-dd或yyyyMMdd"));
}
}
declareTitle = cachedDataList.get(0).getInvoiceTitle();
if (Common.isEmpty(declareTitle)) {
errorMessageList.add(new ErrorMessage(CommonConstants.ZERO_INT
errorMessageList.add(new ErrorMessage(CommonConstants.TWO_INT
, "封面抬头全称-不能为空"));
}
if (Common.isNotNull(declareMonth) && Common.isNotNull(declareTitle)) {
......@@ -157,7 +158,7 @@ public class TStatisticsCurrentReportMarketServiceImpl extends ServiceImpl<TStat
queryWrapperSc.setEntity(sdsCheck);
int count = baseMapper.getCountByMonthAndTitle(declareMonth, declareTitle);
if (count > CommonConstants.ZERO_INT) {
errorMessageList.add(new ErrorMessage(CommonConstants.ZERO_INT
errorMessageList.add(new ErrorMessage(CommonConstants.TWO_INT
, "当前月同一-封面抬头全称-已存在数据。"));
}
}
......
......@@ -106,5 +106,6 @@
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) c
GROUP BY c.EMP_IDCARD,c.INVOICE_TITLE,c.SETTLEMENT_MONTH
</select>
</mapper>
......@@ -80,7 +80,6 @@
1=1
<include refid="tStatisticsRemuneration_where"/>
</where>
group by a.EMP_IDCARD,a.DECLARE_MONTH,a.EMP_NAME
order by a.DECLARE_MONTH desc
</select>
......@@ -88,7 +87,7 @@
<select id="doStatisticsRemuneration" resultMap="tStatisticsRemunerationMap">
select
#{nowMonth} DECLARE_MONTH,a.EMP_NAME,a.EMP_IDCARD,sum(a.SALARY_TAX) PERSONAL_TAX,
sum(a.SALARY_TAX_UNIT) INCOME,a.INVOICE_TITLE DECLARE_UNIT,'居民身份证' CARD_TYPE
sum(a.RELAY_SALARY) INCOME,a.INVOICE_TITLE DECLARE_UNIT,'居民身份证' CARD_TYPE
from t_salary_account a
where a.DELETE_FLAG = 0 and a.SETTLEMENT_MONTH = #{lastMonth} and a.FORM_TYPE = '4'
GROUP BY a.EMP_IDCARD,DECLARE_UNIT
......
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