5 changed files with 260 additions and 0 deletions
@ -0,0 +1,28 @@ |
|||||
|
package com.qs.serve.common.util.model; |
||||
|
|
||||
|
import com.fasterxml.jackson.core.JacksonException; |
||||
|
import com.fasterxml.jackson.core.JsonParser; |
||||
|
import com.fasterxml.jackson.databind.DeserializationContext; |
||||
|
import com.fasterxml.jackson.databind.JsonDeserializer; |
||||
|
|
||||
|
import java.io.IOException; |
||||
|
import java.time.LocalDateTime; |
||||
|
import java.time.format.DateTimeFormatter; |
||||
|
|
||||
|
/** |
||||
|
* @author YenHex |
||||
|
* @since 2023/7/25 |
||||
|
*/ |
||||
|
public class QsJsonLocalDateTimeDeserializer extends JsonDeserializer<LocalDateTime> { |
||||
|
|
||||
|
final DateTimeFormatter df = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss"); |
||||
|
|
||||
|
@Override |
||||
|
public LocalDateTime deserialize(JsonParser jsonParser, DeserializationContext deserializationContext) throws IOException, JacksonException { |
||||
|
String val = jsonParser.getText(); |
||||
|
if (val==null||val.isEmpty()){ |
||||
|
return null; |
||||
|
} |
||||
|
return LocalDateTime.parse(val,df); |
||||
|
} |
||||
|
} |
@ -0,0 +1,82 @@ |
|||||
|
package com.qs.serve.modules.seeyon; |
||||
|
|
||||
|
import com.qs.serve.common.model.dto.PageVo; |
||||
|
import com.qs.serve.common.model.dto.R; |
||||
|
import com.qs.serve.common.util.AuthContextUtils; |
||||
|
import com.qs.serve.common.util.CollectionUtil; |
||||
|
import com.qs.serve.common.util.JsonUtil; |
||||
|
import com.qs.serve.modules.seeyon.entity.CtpAffair; |
||||
|
import com.qs.serve.modules.seeyon.entity.bo.SeeYonApproveQuery; |
||||
|
import com.qs.serve.modules.seeyon.entity.vo.SeeYonApproveDataVo; |
||||
|
import com.qs.serve.modules.seeyon.service.impl.SeeYonRequestBaseService; |
||||
|
import com.qs.serve.modules.sys.entity.SysUser; |
||||
|
import com.qs.serve.modules.sys.service.SysUserService; |
||||
|
import com.qs.serve.modules.tbs.common.TbsSeeYonConst; |
||||
|
import lombok.AllArgsConstructor; |
||||
|
import lombok.extern.slf4j.Slf4j; |
||||
|
import org.springframework.web.bind.annotation.GetMapping; |
||||
|
import org.springframework.web.bind.annotation.RequestMapping; |
||||
|
import org.springframework.web.bind.annotation.RestController; |
||||
|
|
||||
|
import java.util.ArrayList; |
||||
|
import java.util.List; |
||||
|
/** |
||||
|
* 致远通用服务 |
||||
|
* @author YenHex |
||||
|
* @since 2023/7/24 |
||||
|
*/ |
||||
|
@Slf4j |
||||
|
@AllArgsConstructor |
||||
|
@RestController |
||||
|
@RequestMapping("seeyon") |
||||
|
public class SeeYonController { |
||||
|
|
||||
|
private SeeYonRequestBaseService seeYonRequestBaseService; |
||||
|
private SysUserService sysUserService; |
||||
|
|
||||
|
/** |
||||
|
* 我的审批列表 |
||||
|
* @param query |
||||
|
* @return |
||||
|
*/ |
||||
|
@GetMapping("listMyCheck") |
||||
|
public R<PageVo<SeeYonApproveDataVo>> listMyCheck(SeeYonApproveQuery query){ |
||||
|
String userId = AuthContextUtils.getSysUserId(); |
||||
|
SysUser sysUser = sysUserService.getById(userId); |
||||
|
sysUser.checkSyAccount(); |
||||
|
query.setMemberId(sysUser.getSyUserId()); |
||||
|
return listAllCha(query); |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* 所有审批 |
||||
|
* @param query |
||||
|
* @return |
||||
|
*/ |
||||
|
@GetMapping("listCheckList") |
||||
|
public R<PageVo<SeeYonApproveDataVo>> listAllCha(SeeYonApproveQuery query){ |
||||
|
R<String> result = seeYonRequestBaseService.postBase(TbsSeeYonConst.API_LIST_CHECK,query,""); |
||||
|
if(result.getStatus()==200){ |
||||
|
PageVo<?> pageVo = JsonUtil.jsonToPojo(result.getData(),PageVo.class); |
||||
|
List<SeeYonApproveDataVo> affairList = new ArrayList<>(); |
||||
|
if(CollectionUtil.isNotEmpty(pageVo.getList())){ |
||||
|
for (Object o : pageVo.getList()) { |
||||
|
String json = JsonUtil.objectToJson(o); |
||||
|
SeeYonApproveDataVo obj = JsonUtil.jsonToPojo(json,SeeYonApproveDataVo.class); |
||||
|
if(obj!=null&&obj.getTargetCode()!=null){ |
||||
|
//tempCode不参与业务。统一类型重新赋值,方便前端跳转
|
||||
|
String tempCode = obj.getTemplateCode().replace("_Test",""); |
||||
|
tempCode = tempCode.replace("contractApply","CostBill"); |
||||
|
obj.setTemplateCode(tempCode); |
||||
|
|
||||
|
affairList.add(obj); |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
PageVo<SeeYonApproveDataVo> resultVo = PageVo.initNewList(pageVo,affairList); |
||||
|
return R.ok(resultVo); |
||||
|
} |
||||
|
return null; |
||||
|
} |
||||
|
|
||||
|
} |
@ -0,0 +1,81 @@ |
|||||
|
package com.qs.serve.modules.seeyon.entity.bo; |
||||
|
|
||||
|
import lombok.Data; |
||||
|
import org.springframework.format.annotation.DateTimeFormat; |
||||
|
|
||||
|
import java.time.LocalDate; |
||||
|
|
||||
|
/** |
||||
|
* @author YenHex |
||||
|
* @since 2023/7/24 |
||||
|
*/ |
||||
|
@Data |
||||
|
public class SeeYonApproveQuery { |
||||
|
|
||||
|
/** |
||||
|
* OA的员工iD |
||||
|
*/ |
||||
|
private String memberId; |
||||
|
|
||||
|
/** |
||||
|
* 模板编码 |
||||
|
*/ |
||||
|
private String templateCode; |
||||
|
|
||||
|
|
||||
|
private String targetId; |
||||
|
|
||||
|
/** |
||||
|
* 标题 |
||||
|
*/ |
||||
|
private String targetTitle; |
||||
|
|
||||
|
/** |
||||
|
* 编码 |
||||
|
*/ |
||||
|
private String targetCode; |
||||
|
|
||||
|
/** |
||||
|
* 申请人信息 |
||||
|
*/ |
||||
|
private String applyUserCode; |
||||
|
private String applyUserName; |
||||
|
|
||||
|
/** |
||||
|
* 客户 |
||||
|
*/ |
||||
|
private String supplierCode; |
||||
|
private String supplierName; |
||||
|
|
||||
|
/** |
||||
|
* 区域 |
||||
|
*/ |
||||
|
private String bizRegion; |
||||
|
private String saleRegion; |
||||
|
|
||||
|
/** |
||||
|
* 状态:3-待审批;4->已审 |
||||
|
*/ |
||||
|
private Integer affairState; |
||||
|
|
||||
|
/** |
||||
|
* 申请开始时间 |
||||
|
*/ |
||||
|
@DateTimeFormat(pattern = "yyyy-MM-dd") |
||||
|
private LocalDate applyStartDate; |
||||
|
@DateTimeFormat(pattern = "yyyy-MM-dd") |
||||
|
private LocalDate applyEndDate; |
||||
|
|
||||
|
/** |
||||
|
* 评论结束时间 |
||||
|
*/ |
||||
|
@DateTimeFormat(pattern = "yyyy-MM-dd") |
||||
|
private LocalDate commitEndDate; |
||||
|
@DateTimeFormat(pattern = "yyyy-MM-dd") |
||||
|
private LocalDate commitStartDate; |
||||
|
|
||||
|
private Integer pageNum; |
||||
|
|
||||
|
private Integer pageSize; |
||||
|
|
||||
|
} |
@ -0,0 +1,68 @@ |
|||||
|
package com.qs.serve.modules.seeyon.entity.vo; |
||||
|
|
||||
|
import com.fasterxml.jackson.databind.annotation.JsonDeserialize; |
||||
|
import com.qs.serve.common.util.model.QsJsonLocalDateTimeDeserializer; |
||||
|
import lombok.Data; |
||||
|
|
||||
|
import java.time.LocalDateTime; |
||||
|
|
||||
|
/** |
||||
|
* @author YenHex |
||||
|
* @since 2023/7/24 |
||||
|
*/ |
||||
|
@Data |
||||
|
public class SeeYonApproveDataVo { |
||||
|
|
||||
|
private String templateCode; |
||||
|
|
||||
|
/** |
||||
|
* 标题 |
||||
|
*/ |
||||
|
private String targetTitle; |
||||
|
|
||||
|
/** |
||||
|
* 编码 |
||||
|
*/ |
||||
|
private String targetCode; |
||||
|
|
||||
|
private String targetId; |
||||
|
|
||||
|
/** |
||||
|
* 申请人信息 |
||||
|
*/ |
||||
|
private String applyUserCode; |
||||
|
private String applyUserName; |
||||
|
|
||||
|
/** |
||||
|
* 客户 |
||||
|
*/ |
||||
|
private String supplierCode; |
||||
|
private String supplierName; |
||||
|
|
||||
|
/** |
||||
|
* 区域 |
||||
|
*/ |
||||
|
private String bizRegion; |
||||
|
private String saleRegion; |
||||
|
|
||||
|
/** |
||||
|
* 状态:0-待审批;1->已审 |
||||
|
*/ |
||||
|
private String affairState; |
||||
|
private String affairId; |
||||
|
|
||||
|
private String memberId; |
||||
|
|
||||
|
/** |
||||
|
* 申请时间 |
||||
|
*/ |
||||
|
@JsonDeserialize(using = QsJsonLocalDateTimeDeserializer.class) |
||||
|
private LocalDateTime applyTime; |
||||
|
|
||||
|
/** |
||||
|
* 评论时间 |
||||
|
*/ |
||||
|
@JsonDeserialize(using = QsJsonLocalDateTimeDeserializer.class) |
||||
|
private LocalDateTime commitTime; |
||||
|
|
||||
|
} |
Loading…
Reference in new issue