丽知:钉钉报表优化
This commit is contained in:
parent
baad38a4c1
commit
7686e3e496
|
@ -6,6 +6,9 @@ import com.github.pagehelper.PageInfo;
|
|||
import com.hzya.frame.page.PageAttribute;
|
||||
import com.hzya.frame.plugin.lets.dingtalk.entity.DingU8cBillEntity;
|
||||
import com.hzya.frame.plugin.lets.dingtalk.service.IDingU8cBillService;
|
||||
import com.hzya.frame.plugin.lets.dingtalk.vo.U8CCorpVO;
|
||||
import com.hzya.frame.plugin.lets.entity.BdCorpEntity;
|
||||
import com.hzya.frame.plugin.lets.util.QueryU8CEntityUtil;
|
||||
import com.hzya.frame.web.action.DefaultController;
|
||||
import com.hzya.frame.web.entity.JsonResultEntity;
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
|
@ -16,7 +19,9 @@ import org.springframework.web.bind.annotation.RequestMapping;
|
|||
import org.springframework.web.bind.annotation.ResponseBody;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import static com.hzya.frame.web.entity.BaseResult.getSuccessMessageEntity;
|
||||
|
||||
|
@ -33,6 +38,8 @@ public class DingU8CBillController extends DefaultController {
|
|||
|
||||
@Autowired
|
||||
private IDingU8cBillService dingU8cBillService;
|
||||
@Autowired
|
||||
private QueryU8CEntityUtil queryU8CEntityUtil;
|
||||
|
||||
/** 分页查询 */
|
||||
// @RequestMapping(value = "queryPaged")
|
||||
|
@ -82,5 +89,14 @@ public class DingU8CBillController extends DefaultController {
|
|||
}
|
||||
}
|
||||
|
||||
/** U8C 公司查询*/
|
||||
@RequestMapping(value = "queryU8CAllCorp")
|
||||
@ResponseBody
|
||||
public JsonResultEntity queryU8CAllCorp(){
|
||||
List<BdCorpEntity> bdCorpEntities = queryU8CEntityUtil.queryBdCorp();
|
||||
List<U8CCorpVO> collect = bdCorpEntities.stream().map(index->new U8CCorpVO(index.getUnitcode(),index.getUnitname())).collect(Collectors.toList());
|
||||
return getSuccessMessageEntity("U8C 公司查询成功",collect);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
|
@ -54,7 +54,7 @@
|
|||
<if test="u8c_code_corp != null and u8c_code_corp != ''"> and u8c_code_corp = #{u8c_code_corp} </if>
|
||||
<if test="u8c_name_corp != null and u8c_name_corp != ''"> and u8c_name_corp = #{u8c_name_corp} </if>
|
||||
<if test="u8c_bill_type != null and u8c_bill_type != ''"> and u8c_bill_type = #{u8c_bill_type} </if>
|
||||
<if test="u8c_bill_code != null and u8c_bill_code != ''"> and u8c_bill_code = #{u8c_bill_code} </if>
|
||||
<if test="u8c_bill_code != null and u8c_bill_code != ''"> and u8c_bill_code like concat('%',#{u8c_bill_code},'%') </if>
|
||||
<if test="u8c_bill_id != null and u8c_bill_id != ''"> and u8c_bill_id = #{u8c_bill_id} </if>
|
||||
<if test="push_status != null and push_status != ''"> and push_status = #{push_status} </if>
|
||||
<if test="push_info != null and push_info != ''"> and push_info = #{push_info} </if>
|
||||
|
|
|
@ -68,11 +68,12 @@ public class DingU8cBillServiceImpl extends BaseService<DingU8cBillEntity, Strin
|
|||
}
|
||||
|
||||
@Override
|
||||
public List<DingU8cBillEntity> query(DingU8cBillEntity o) {
|
||||
List<DingU8cBillEntity> dingU8cBillEntityList = super.query(o);
|
||||
// for (DingU8cBillEntity dingU8cBillEntity : dingU8cBillEntityList) {
|
||||
//
|
||||
// }
|
||||
public List<DingU8cBillEntity> query(DingU8cBillEntity entity) {
|
||||
if (entity.getStart_time() != null && entity.getEnd_time() != null) {
|
||||
entity.setStart_time(entity.getStart_time()+" 00:00:00");
|
||||
entity.setEnd_time(entity.getEnd_time()+" 23:59:58");
|
||||
}
|
||||
List<DingU8cBillEntity> dingU8cBillEntityList = super.query(entity);
|
||||
return dingU8cBillEntityList;
|
||||
}
|
||||
|
||||
|
@ -140,7 +141,8 @@ public class DingU8cBillServiceImpl extends BaseService<DingU8cBillEntity, Strin
|
|||
status = processInstanceResponseBodyResult.getStatus();
|
||||
if ("RUNNING".equals(status) || "TERMINATED".equals(status)) {
|
||||
//审批中、已撤销不处理
|
||||
return null;
|
||||
Assert.state(false,"根据公司编码:{},单据号:{},实例id:{}补推失败,该审批实例在审批中或已被撤销请检查。"
|
||||
,dingU8cBillEntityNew.getU8c_code_corp(),dingU8cBillEntityNew.getU8c_bill_code(),dingU8cBillEntityNew.getDing_talk_process_id());
|
||||
}
|
||||
//查询u8c的单据状态//spzt:1审核 null 未审核
|
||||
String u8cPkCorp = dingU8cBillEntityNew.getU8c_pk_corp();
|
||||
|
@ -160,7 +162,8 @@ public class DingU8cBillServiceImpl extends BaseService<DingU8cBillEntity, Strin
|
|||
return dingU8cBillEntityNew;
|
||||
}catch (Exception e){
|
||||
if(dingU8cBillEntityNew != null){
|
||||
Assert.state(false,"根据公司编码:{},单据号:{},实例id:{}补推失败,失败原因:{}",e.getMessage());
|
||||
Assert.state(false,"根据公司编码:{},单据号:{},实例id:{}补推失败,失败原因:{}"
|
||||
,dingU8cBillEntityNew.getU8c_code_corp(),dingU8cBillEntityNew.getU8c_bill_code(),dingU8cBillEntityNew.getDing_talk_process_id(),e.getMessage());
|
||||
}else {
|
||||
Assert.state(false,e.getMessage());
|
||||
|
||||
|
@ -171,6 +174,7 @@ public class DingU8cBillServiceImpl extends BaseService<DingU8cBillEntity, Strin
|
|||
|
||||
@Autowired
|
||||
private PushU8CByApiCode pushU8CByApiCode;
|
||||
|
||||
public void approveArapDjzb(DingU8cBillEntity dingU8cBillEntity) throws Exception {
|
||||
//获取当前时间
|
||||
LocalDate now = LocalDate.now();
|
||||
|
@ -217,6 +221,7 @@ public class DingU8cBillServiceImpl extends BaseService<DingU8cBillEntity, Strin
|
|||
}
|
||||
|
||||
}
|
||||
|
||||
public void refuse(DingU8cBillEntity dingU8cBillEntity) throws IOException {
|
||||
// 服务器访问地址及端口,例如 http://ip:port
|
||||
String serviceUrl = OverallConstant.getOverAllValue("u8cApiUrl");
|
||||
|
@ -256,12 +261,11 @@ public class DingU8cBillServiceImpl extends BaseService<DingU8cBillEntity, Strin
|
|||
}
|
||||
|
||||
|
||||
|
||||
|
||||
public String getDingTalkToken() throws Exception {
|
||||
GetAccessTokenResponseBody tokenBody = DingTalkUtils.getTokenBody(APPKEY, AppSecret);
|
||||
return tokenBody.getAccessToken();
|
||||
}
|
||||
|
||||
public String getMobileByUserId(String token, String userId) {
|
||||
OapiV2UserGetResponse user = DingTalkUtils.getUserById(token, userId);
|
||||
String mobile = user.getResult().getMobile();
|
||||
|
@ -270,6 +274,7 @@ public class DingU8cBillServiceImpl extends BaseService<DingU8cBillEntity, Strin
|
|||
|
||||
@Autowired
|
||||
private IArapDjzbDao arapDjzbDao;
|
||||
|
||||
/**
|
||||
* 查询u8c付款单主表
|
||||
*/
|
||||
|
|
|
@ -0,0 +1,13 @@
|
|||
package com.hzya.frame.plugin.lets.dingtalk.vo;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
public class U8CCorpVO {
|
||||
public String unitcode;
|
||||
public String unitName;
|
||||
}
|
Loading…
Reference in New Issue