3 changed files with 219 additions and 0 deletions
@ -0,0 +1,75 @@ |
|||||
|
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_AFFAIR,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); |
||||
|
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,63 @@ |
|||||
|
package com.qs.serve.modules.seeyon.entity.vo; |
||||
|
|
||||
|
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 memberId; |
||||
|
|
||||
|
/** |
||||
|
* 申请时间 |
||||
|
*/ |
||||
|
private LocalDateTime applyTime; |
||||
|
|
||||
|
/** |
||||
|
* 评论时间 |
||||
|
*/ |
||||
|
private LocalDateTime commitTime; |
||||
|
|
||||
|
} |
Loading…
Reference in new issue