Commit 63773fa5 authored by huyuchen's avatar huyuchen

明细接口改造

parent f5218d9f
package com.yifu.cloud.plus.v1.ekp.vo;
import lombok.Data;
import java.io.Serializable;
import java.util.List;
/**
* @Author huyc
* @Date 2024/3/15
* @Description 社保明细更新相关参数
* @Version 1.0
*/
@Data
public class EkpSocialStatusUpdateVo implements Serializable {
/**
* 社保明细
**/
private List<Object> param;
/**
* 更新sql
**/
private String updateSql;
}
package com.yifu.cloud.plus.v1.ekp.controller; package com.yifu.cloud.plus.v1.ekp.controller;
import com.alibaba.fastjson.JSONObject;
import com.yifu.cloud.plus.v1.ekp.service.EkpSocialInfoService; import com.yifu.cloud.plus.v1.ekp.service.EkpSocialInfoService;
import com.yifu.cloud.plus.v1.ekp.vo.EkpSocialPushInfoVo; import com.yifu.cloud.plus.v1.ekp.vo.EkpSocialPushInfoVo;
import com.yifu.cloud.plus.v1.ekp.vo.EkpSocialStatusUpdateVo;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.CommonConstants;
import com.yifu.cloud.plus.v1.yifu.common.core.util.R;
import com.yifu.cloud.plus.v1.yifu.common.log.annotation.SysLog;
import com.yifu.cloud.plus.v1.yifu.common.security.annotation.Inner; import com.yifu.cloud.plus.v1.yifu.common.security.annotation.Inner;
import com.yifu.cloud.plus.v1.yifu.ekp.vo.EkpPushSocialParam; import com.yifu.cloud.plus.v1.yifu.ekp.vo.EkpPushSocialParam;
import io.swagger.v3.oas.annotations.Operation;
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.PostMapping; import org.springframework.web.bind.annotation.PostMapping;
...@@ -11,6 +17,8 @@ import org.springframework.web.bind.annotation.RequestBody; ...@@ -11,6 +17,8 @@ import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController; import org.springframework.web.bind.annotation.RestController;
import java.io.UnsupportedEncodingException;
import java.net.URLDecoder;
import java.util.List; import java.util.List;
...@@ -39,4 +47,24 @@ public class TEkpSocialInfoController { ...@@ -39,4 +47,24 @@ public class TEkpSocialInfoController {
public EkpSocialPushInfoVo pushSocialInfoToEkp(@RequestBody List<EkpPushSocialParam> unPushList) { public EkpSocialPushInfoVo pushSocialInfoToEkp(@RequestBody List<EkpPushSocialParam> unPushList) {
return socialInfoService.pushSocialInfoToEkp(unPushList); return socialInfoService.pushSocialInfoToEkp(unPushList);
} }
/**
* 修改项目表--EKP调用接口
* @author hyc
* @param jsonStr 社保订单明细
* @return R
*/
@Operation(summary = "更新社保明细状态--EKP调用接口", description = "更新社保明细状态--EKP调用接口")
@SysLog("更新社保明细状态--EKP调用接口")
@PostMapping("/updateScoialStatus")
public R updateScoialStatus(@RequestBody String jsonStr) {
try {
jsonStr = URLDecoder.decode(jsonStr, CommonConstants.UTF8).replace("=", "");
} catch (UnsupportedEncodingException e) {
e.printStackTrace();
}
List<EkpSocialStatusUpdateVo> list= JSONObject.parseArray(jsonStr, EkpSocialStatusUpdateVo.class);
return socialInfoService.updateScoialStatus(list);
}
} }
...@@ -31,4 +31,6 @@ public interface EkpSocialInfoMapper extends BaseMapper<EkpSocialInfo> { ...@@ -31,4 +31,6 @@ public interface EkpSocialInfoMapper extends BaseMapper<EkpSocialInfo> {
* @return * @return
*/ */
EkpSocialSumInfoVo getCostSumInfo(@Param("card") String empIdCard, @Param("month") String createMonth); EkpSocialSumInfoVo getCostSumInfo(@Param("card") String empIdCard, @Param("month") String createMonth);
void updateSocialStatus(@Param("sql") String sql);
} }
...@@ -3,6 +3,8 @@ package com.yifu.cloud.plus.v1.ekp.service; ...@@ -3,6 +3,8 @@ package com.yifu.cloud.plus.v1.ekp.service;
import com.baomidou.mybatisplus.extension.service.IService; import com.baomidou.mybatisplus.extension.service.IService;
import com.yifu.cloud.plus.v1.ekp.entity.EkpSocialInfo; import com.yifu.cloud.plus.v1.ekp.entity.EkpSocialInfo;
import com.yifu.cloud.plus.v1.ekp.vo.EkpSocialPushInfoVo; import com.yifu.cloud.plus.v1.ekp.vo.EkpSocialPushInfoVo;
import com.yifu.cloud.plus.v1.ekp.vo.EkpSocialStatusUpdateVo;
import com.yifu.cloud.plus.v1.yifu.common.core.util.R;
import com.yifu.cloud.plus.v1.yifu.ekp.vo.EkpPushSocialParam; import com.yifu.cloud.plus.v1.yifu.ekp.vo.EkpPushSocialParam;
import org.apache.shardingsphere.transaction.annotation.ShardingTransactionType; import org.apache.shardingsphere.transaction.annotation.ShardingTransactionType;
import org.apache.shardingsphere.transaction.core.TransactionType; import org.apache.shardingsphere.transaction.core.TransactionType;
...@@ -21,4 +23,6 @@ public interface EkpSocialInfoService extends IService<EkpSocialInfo> { ...@@ -21,4 +23,6 @@ public interface EkpSocialInfoService extends IService<EkpSocialInfo> {
@Transactional @Transactional
@ShardingTransactionType(TransactionType.BASE) @ShardingTransactionType(TransactionType.BASE)
EkpSocialPushInfoVo pushSocialInfoToEkp(List<EkpPushSocialParam> unPushList); EkpSocialPushInfoVo pushSocialInfoToEkp(List<EkpPushSocialParam> unPushList);
R updateScoialStatus(List<EkpSocialStatusUpdateVo> list);
} }
...@@ -7,12 +7,10 @@ import com.yifu.cloud.plus.v1.ekp.mapper.EkpSocialInfoMapper; ...@@ -7,12 +7,10 @@ import com.yifu.cloud.plus.v1.ekp.mapper.EkpSocialInfoMapper;
import com.yifu.cloud.plus.v1.ekp.service.EkpSocialInfoService; import com.yifu.cloud.plus.v1.ekp.service.EkpSocialInfoService;
import com.yifu.cloud.plus.v1.ekp.vo.EkpDeptInfoVo; import com.yifu.cloud.plus.v1.ekp.vo.EkpDeptInfoVo;
import com.yifu.cloud.plus.v1.ekp.vo.EkpSocialPushInfoVo; import com.yifu.cloud.plus.v1.ekp.vo.EkpSocialPushInfoVo;
import com.yifu.cloud.plus.v1.ekp.vo.EkpSocialStatusUpdateVo;
import com.yifu.cloud.plus.v1.ekp.vo.EkpSocialSumInfoVo; import com.yifu.cloud.plus.v1.ekp.vo.EkpSocialSumInfoVo;
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.BigDecimalUtils; import com.yifu.cloud.plus.v1.yifu.common.core.util.*;
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.LocalDateTimeUtils;
import com.yifu.cloud.plus.v1.yifu.ekp.vo.EkpPushSocialParam; import com.yifu.cloud.plus.v1.yifu.ekp.vo.EkpPushSocialParam;
import com.yifu.cloud.plus.v1.yifu.social.entity.TPaymentSocialPush; import com.yifu.cloud.plus.v1.yifu.social.entity.TPaymentSocialPush;
import lombok.extern.log4j.Log4j2; import lombok.extern.log4j.Log4j2;
...@@ -236,6 +234,20 @@ public class EkpSocialInfoServiceImpl extends ServiceImpl<EkpSocialInfoMapper, E ...@@ -236,6 +234,20 @@ public class EkpSocialInfoServiceImpl extends ServiceImpl<EkpSocialInfoMapper, E
return null; return null;
} }
@Override
public R updateScoialStatus(List<EkpSocialStatusUpdateVo> list) {
if (Optional.ofNullable(list).isPresent()) {
for (EkpSocialStatusUpdateVo socialStatusUpdateVo : list) {
String updateSql = socialStatusUpdateVo.getUpdateSql().replaceAll("\\?","%s");
List<Object> paramList = socialStatusUpdateVo.getParam();
String sql = String.format(updateSql, paramList.toArray());
baseMapper.updateSocialStatus(sql);
}
return R.ok();
}
return null;
}
private void copySocialProperties(EkpPushSocialParam socialParam,EkpSocialInfo socialInfo) { private void copySocialProperties(EkpPushSocialParam socialParam,EkpSocialInfo socialInfo) {
//订单类型 //订单类型
socialInfo.setFd_3add9dd7833db8(socialParam.getFd_3add9dd7833db8()); socialInfo.setFd_3add9dd7833db8(socialParam.getFd_3add9dd7833db8());
......
...@@ -113,4 +113,7 @@ ...@@ -113,4 +113,7 @@
where fd_3adfe8c7e4cf7a = #{card} and fd_3adfe8cb96c41e = #{month} where fd_3adfe8c7e4cf7a = #{card} and fd_3adfe8cb96c41e = #{month}
</select> </select>
<update id="updateSocialStatus">
#{sql}
</update>
</mapper> </mapper>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment