Browse Source

优化

master
dimengzhe 2 years ago
parent
commit
3a215282fe
  1. 14
      anrui-buscenter/anrui-buscenter-api/src/main/java/com/yxt/anrui/buscenter/api/bussalesorder/app/order/OrderQuery.java
  2. 1
      anrui-buscenter/anrui-buscenter-biz/src/main/java/com/yxt/anrui/buscenter/biz/bussalesorder/BusSalesOrderMapper.xml
  3. 28
      anrui-buscenter/anrui-buscenter-biz/src/main/java/com/yxt/anrui/buscenter/biz/bussalesorder/BusSalesOrderService.java
  4. 15
      anrui-fin/anrui-fin-biz/src/main/java/com/yxt/anrui/fin/biz/fincollectionconfirmation/FinCollectionConfirmationService.java
  5. 7
      anrui-flowable/anrui-flowable-api/src/main/java/com/yxt/anrui/flowable/api/flowtask/FlowableQuery.java
  6. 14
      anrui-flowable/anrui-flowable-biz/src/main/java/com/yxt/anrui/flowable/biz/flowtask/FlowTaskService.java
  7. 38
      anrui-portal/anrui-portal-biz/src/main/java/com/yxt/anrui/portal/biz/flow/FlowableRest.java
  8. 11
      anrui-terminal/anrui-terminal-api/src/main/java/com/yxt/anrui/terminal/api/app/flowable/AppFlowableRecordVo.java
  9. 32
      anrui-terminal/anrui-terminal-biz/src/main/java/com/yxt/anrui/terminal/biz/app/AppService.java

14
anrui-buscenter/anrui-buscenter-api/src/main/java/com/yxt/anrui/buscenter/api/bussalesorder/app/order/OrderQuery.java

@ -3,7 +3,6 @@ package com.yxt.anrui.buscenter.api.bussalesorder.app.order;
import com.yxt.common.core.query.Query;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.springframework.beans.factory.annotation.Autowired;
/**
* @Author dimengzhe
@ -23,4 +22,17 @@ public class OrderQuery implements Query {
private String menuUrl;
@ApiModelProperty("用户sid")
private String userSid;
@ApiModelProperty("订单状态")
private String nodeState;
@ApiModelProperty("车型")
private String modelName;
@ApiModelProperty("合同编号")
private String contractNo;
@ApiModelProperty("发起人")
private String createByName;
@ApiModelProperty("发起部门")
private String createByDept;
@ApiModelProperty("销售类型")
private String saleTypeKey;
}

1
anrui-buscenter/anrui-buscenter-biz/src/main/java/com/yxt/anrui/buscenter/biz/bussalesorder/BusSalesOrderMapper.xml

@ -68,6 +68,7 @@
FROM bus_sales_order bo
left join bus_sales_order_price bp on bp.salesOrderSid = bo.sid
left join bus_sales_order_deposit bd on bd.salesOrderSid = bo.sid
left join bus_sales_order_model bm on bm.salesOrderSid = bo.sid
<where>
${ew.sqlSegment}
<if test="name != null and name != ''">

28
anrui-buscenter/anrui-buscenter-biz/src/main/java/com/yxt/anrui/buscenter/biz/bussalesorder/BusSalesOrderService.java

@ -5724,9 +5724,31 @@ public class BusSalesOrderService extends MybatisBaseService<BusSalesOrderMapper
return p;
}
//=======================
/* String orgSidPath = pagerQuery.getOrgPath();
orgSidPath = sysOrganizationFeign.selectByCJOrgPath(orgSidPath).getData();
qw.like("bo.orgSidPath", orgSidPath);*/
//节点状态
if(StringUtils.isNotBlank(pagerQuery.getNodeState())){
qw.like("bo.nodeState",pagerQuery.getNodeState());
}
//车型
if(StringUtils.isNotBlank(pagerQuery.getModelName())){
qw.like("bm.modelName",pagerQuery.getModelName());
}
//合同编号
if(StringUtils.isNotBlank(pagerQuery.getContractNo())){
qw.like("bo.contractNo",pagerQuery.getContractNo());
}
//发起人
if(StringUtils.isNotBlank(pagerQuery.getCreateByName())){
qw.like("bo.staffName",pagerQuery.getCreateByName());
}
//发起部门
if(StringUtils.isNotBlank(pagerQuery.getCreateByDept())){
qw.like("bo.orgName",pagerQuery.getCreateByDept());
}
//销售类型
if(StringUtils.isNotBlank(pagerQuery.getSaleTypeKey())){
qw.eq("bo.payTypeKey",pagerQuery.getSaleTypeKey());
}
String typeState = "getSaleOrdersByOrgPath";//查询接口的标识
IPage<AppBusSalesOrderVo> pagging = baseMapper.getSaleOrders(page, qw, pq.getParams().getName(), typeState);
for (AppBusSalesOrderVo record : pagging.getRecords()) {

15
anrui-fin/anrui-fin-biz/src/main/java/com/yxt/anrui/fin/biz/fincollectionconfirmation/FinCollectionConfirmationService.java

@ -47,6 +47,7 @@ import com.yxt.anrui.buscenter.api.busdelivered.BusDeliveredFeign;
import com.yxt.anrui.buscenter.api.busdeposit.AppBusDepositBuscenterDetailVo;
import com.yxt.anrui.buscenter.api.busdeposit.BusDepositFeign;
import com.yxt.anrui.buscenter.api.bussalesorder.BusSalesOrderFeign;
import com.yxt.anrui.buscenter.api.bussalesorder.app.order.AppOrderDepositInfoVo;
import com.yxt.anrui.buscenter.api.bussalesorder.app.order.AppOrderDetailsVo;
import com.yxt.anrui.buscenter.api.bussalesorder.app.order.AppOrderModelInfoVo;
import com.yxt.anrui.buscenter.api.bussalesorder.app.order.AppOrderPriceInfoVo;
@ -2207,6 +2208,20 @@ public class FinCollectionConfirmationService extends MybatisBaseService<FinColl
AppOrderDetailsVo vo = orderDetails.getData();
if (vo != null) {
AppOrderPriceInfoVo priceInfoVo = vo.getPriceInfo();
AppOrderDepositInfoVo depositInfo = vo.getDepositInfo();
if(depositInfo != null){
if("02".equals(depositInfo.getDepositTypeKey())){//订金结转
BigDecimal decimalDeposit = BigDecimal.ZERO;
if(StringUtils.isNotBlank(depositInfo.getDepositTotal())){
decimalDeposit = new BigDecimal(depositInfo.getDepositTotal());
}
if(StringUtils.isNotBlank(depositInfo.getMakeUpDeposit())){
decimalDeposit = decimalDeposit.subtract(new BigDecimal(depositInfo.getMakeUpDeposit()));
}
decimalDeposit = decimalDeposit.divide(new BigDecimal(priceInfoVo.getNumber()), BigDecimal.ROUND_CEILING);
bigDecimalVinAll = bigDecimalVinAll.add(decimalDeposit);
}
}
//单台整体成交价
BigDecimal singleFinalPrice = new BigDecimal(priceInfoVo.getSingleFinalPrice());
BigDecimal leftAll = BigDecimal.ZERO;

7
anrui-flowable/anrui-flowable-api/src/main/java/com/yxt/anrui/flowable/api/flowtask/FlowableQuery.java

@ -1,5 +1,6 @@
package com.yxt.anrui.flowable.api.flowtask;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.util.HashMap;
@ -12,10 +13,10 @@ import java.util.Map;
**/
@Data
public class FlowableQuery {
@ApiModelProperty("列表中的procDefId")
private String modelId;
@ApiModelProperty("列表中的processVariables")
private Map<String,Object> map = new HashMap<>();
@ApiModelProperty("列表中的taskDefKey")
private String taskDefKey;
}

14
anrui-flowable/anrui-flowable-biz/src/main/java/com/yxt/anrui/flowable/biz/flowtask/FlowTaskService.java

@ -304,8 +304,9 @@ public class FlowTaskService extends MybatisBaseService<FlowTaskMapper, FlowTask
List<HistoricActivityInstance> list = historyService
.createHistoricActivityInstanceQuery()
.processInstanceId(procInsId)
.orderByHistoricActivityInstanceStartTime()
.desc().list();
// .orderByHistoricActivityInstanceStartTime()
// .desc().list();
.list();
Map<String,String> processInstance=processService.getProcessInstanceById(procInsId);
List<FlowTask> hisFlowList = new ArrayList<>();
for (HistoricActivityInstance histIns : list) {
@ -314,6 +315,11 @@ public class FlowTaskService extends MybatisBaseService<FlowTaskMapper, FlowTask
flowTask.setTaskId(histIns.getTaskId());
flowTask.setTaskName(histIns.getActivityName());
flowTask.setTaskDefKey(histIns.getActivityId());
flowTask.setProcDefId(histIns.getProcessDefinitionId());
HistoricTaskInstance historicTaskInstance = historyService.createHistoricTaskInstanceQuery()
.includeProcessVariables().taskId(histIns.getTaskId()).singleResult();
Map<String, Object> processVariables = historicTaskInstance.getProcessVariables();
flowTask.setProcVars(processVariables);
Date startTime = histIns.getStartTime();
flowTask.setCreateTime(startTime);
Date endTime = histIns.getEndTime();
@ -323,9 +329,6 @@ public class FlowTaskService extends MybatisBaseService<FlowTaskMapper, FlowTask
//processInstance.get("END_TIME_") timestap类型不能转string
String end_time_ = processInstance.get("END_TIME_") == null ? "" : "end";
flowTask.setProcessEndTime(end_time_);
/*
flowTask.setCreateTime(histIns.getStartTime());
flowTask.setFinishTime(histIns.getEndTime());*/
if (StringUtils.isNotBlank(histIns.getAssignee())) {
ResultBean<List<SysUserVo>> sysUserVoResultBean = sysUserFeign.fetchBySids(histIns.getAssignee());// sysUserService.selectUserById(Long.parseLong(histIns.getAssignee()));
List<SysUserVo> data1 = sysUserVoResultBean.getData();
@ -2108,6 +2111,7 @@ public class FlowTaskService extends MybatisBaseService<FlowTaskMapper, FlowTask
}else{
if(flowableQuery.getTaskDefKey().equals(item.getId())){
taskKeyTrue = true;
continue;
}
if(taskKeyTrue){
log.info("flowElement:{}", item);

38
anrui-portal/anrui-portal-biz/src/main/java/com/yxt/anrui/portal/biz/flow/FlowableRest.java

@ -29,6 +29,8 @@ import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.date.DateUtil;
import com.alibaba.fastjson.JSON;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yxt.anrui.flowable.api.flowtask.FlowTaskFeign;
import com.yxt.anrui.flowable.api.flowtask.FlowableQuery;
import com.yxt.anrui.flowable.api.processcomment.ProcessCommentFeign;
import com.yxt.anrui.portal.api.flow.*;
import com.yxt.anrui.portal.api.flow.app.FlowTaskDoQuery;
@ -46,6 +48,7 @@ import com.yxt.common.core.query.PagerQuery;
import com.yxt.common.core.result.ResultBean;
import com.yxt.common.core.vo.PagerVo;
import io.swagger.annotations.Api;
import org.apache.commons.collections4.comparators.NullComparator;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.RequestMapping;
@ -84,6 +87,10 @@ public class FlowableRest implements FlowableFeign {
private SysUrlConfigService sysUrlConfigService;
@Value("${config.url.prefix}")
private String urlPrefix;
private static final NullComparator<Date> nullComparator = new NullComparator<>();
@Autowired
private FlowTaskFeign flowTaskFeign;
/*
@Override
@ -159,7 +166,6 @@ public class FlowableRest implements FlowableFeign {
public ResultBean<List<PCHistTaskListAndCommentList>> flowRecordAndComment(String procInsId, String deployId) {
ResultBean<com.yxt.anrui.flowable.api.flowtask.FlowRecordVo> flowRecordVoResultBean = flowableService.flowRecord(procInsId, deployId);
com.yxt.anrui.flowable.api.flowtask.FlowRecordVo flowRecordVo = flowRecordVoResultBean.getData();
// private List<com.yxt.anrui.flowable.api.flowtask.FlowTask> flowList = new ArrayList<>();
List<PCHistTaskListAndCommentList> flowList = new ArrayList<>();
//流转记录
List<com.yxt.anrui.flowable.api.flowtask.FlowTask> flowList1 = flowRecordVo.getFlowList();
@ -184,8 +190,34 @@ public class FlowableRest implements FlowableFeign {
a.setState(1+"");
flowList.add(a);
});
flowList.sort((t1, t2) -> t2.getTime().compareTo(t1.getTime()));
//flowRecordVo.setFlowList(flowList);
if(flowList1.size()>0){
com.yxt.anrui.flowable.api.flowtask.FlowTask appFlowableRecordVo = flowList1.get(flowList1.size()-1);
if(!"Event_end".equals(appFlowableRecordVo.getTaskDefKey())){
String proDefId = appFlowableRecordVo.getProcDefId();
Map<String,Object> map = (Map<String, Object>) appFlowableRecordVo.getProcVars();
FlowableQuery flowableQuery = new FlowableQuery();
flowableQuery.setModelId(proDefId);
flowableQuery.setTaskDefKey(appFlowableRecordVo.getTaskDefKey());
flowableQuery.setMap(map);
ResultBean<List<Map<String,Object>>> resultBean = flowTaskFeign.yuyanTest(flowableQuery);
if(!resultBean.getData().isEmpty()){
List<Map<String,Object>> mapList = resultBean.getData();
mapList.forEach(f->{
PCHistTaskListAndCommentList a = new PCHistTaskListAndCommentList();
Map<String, Object> stringObjectMap = BeanUtil.beanToMap(f);
stringObjectMap.put("taskName",f.get("nodeName").toString());
stringObjectMap.put("finishTime",null);
stringObjectMap.put("createTime","");
stringObjectMap.put("taskUserInfos",new ArrayList<>());
a.setFlowableRecordVo(stringObjectMap);
a.setState(3 + "");
flowList.add(a);
});
}
}
}
flowList.sort(Comparator.nullsLast(Comparator.comparing(PCHistTaskListAndCommentList::getTime,nullComparator)));
// flowList.sort((t1, t2) -> t2.getTime().compareTo(t1.getTime()));
ResultBean<List<PCHistTaskListAndCommentList>> resultBean = new ResultBean<List<PCHistTaskListAndCommentList>>().success();
resultBean.setData(flowList);
return resultBean;

11
anrui-terminal/anrui-terminal-api/src/main/java/com/yxt/anrui/terminal/api/app/flowable/AppFlowableRecordVo.java

@ -9,6 +9,7 @@ import lombok.Data;
import java.util.Date;
import java.util.List;
import java.util.Map;
/**
* @Author dimengzhe
@ -53,4 +54,14 @@ public class AppFlowableRecordVo implements Vo {
@JsonIgnore
private AppFlowCommentVo comment;
@ApiModelProperty("任务编号")
private String taskId;
@ApiModelProperty("任务Key")
private String taskDefKey;
@ApiModelProperty("流程ID")
private String procDefId;
private Map<String,Object> procVars;
}

32
anrui-terminal/anrui-terminal-biz/src/main/java/com/yxt/anrui/terminal/biz/app/AppService.java

@ -7,12 +7,14 @@ import com.yxt.anrui.flowable.api.flow.FlowableShareQuery;
import com.yxt.anrui.flowable.api.flowcomment.FlowComment;
import com.yxt.anrui.flowable.api.flowtask.FlowRecordVo;
import com.yxt.anrui.flowable.api.flowtask.FlowTaskFeign;
import com.yxt.anrui.flowable.api.flowtask.FlowableQuery;
import com.yxt.anrui.flowable.api.processcomment.ProcessCommentDto;
import com.yxt.anrui.flowable.api.processcomment.ProcessCommentFeign;
import com.yxt.anrui.terminal.api.app.ShareMessageQuery;
import com.yxt.anrui.terminal.api.app.flowable.*;
import com.yxt.common.base.utils.StringUtils;
import com.yxt.common.core.result.ResultBean;
import org.apache.commons.collections4.comparators.NullComparator;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
@ -34,12 +36,12 @@ public class AppService {
private ProcessCommentFeign processCommentFeign;
@Autowired
private FlowableFeign flowableFeign;
private static final NullComparator<Date> nullComparator = new NullComparator<>();
public ResultBean<List<AppFlowableRecordVo>> getProgressList(AppFlowableRecordQuery appFlowableRecordQuery) {
ResultBean<List<AppFlowableRecordVo>> rb = ResultBean.fireFail();
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
String procInsId = appFlowableRecordQuery.getProgressId();
// String deployId = appFlowableRecordQuery.getDeployId();
ResultBean<FlowRecordVo> resultBean = flowTaskFeign.businessFlowRecord(procInsId);
List<AppFlowableRecordVo> voList = Optional.ofNullable(resultBean.getData().getFlowList()).orElse(new ArrayList<>()).stream().map(m -> JSON.parseObject(JSON.toJSONString(m), AppFlowableRecordVo.class)).collect(Collectors.toList());
voList.removeAll(Collections.singleton(null));
@ -82,8 +84,6 @@ public class AppService {
progressList.forEach(f -> {
AppFlowableRecordAndCommentVo a = new AppFlowableRecordAndCommentVo();
a.setTime(f.getFinishTime() == null ? new Date() : f.getFinishTime());
// a.setTime(f.getCreateTime());
a.setFlowableRecordVo(f);
a.setState(0 + "");
list.add(a);
@ -98,7 +98,31 @@ public class AppService {
a.setState(1 + "");
list.add(a);
});
list.sort((t1, t2) -> t2.getTime().compareTo(t1.getTime()));
// list.sort((t1, t2) -> t2.getTime().compareTo(t1.getTime()));
if(progressList.size()>0){
AppFlowableRecordVo appFlowableRecordVo = progressList.get(progressList.size()-1);
if(!"Event_end".equals(appFlowableRecordVo.getTaskDefKey())){
String proDefId = appFlowableRecordVo.getProcDefId();
Map<String,Object> map = appFlowableRecordVo.getProcVars();
FlowableQuery flowableQuery = new FlowableQuery();
flowableQuery.setModelId(proDefId);
flowableQuery.setTaskDefKey(appFlowableRecordVo.getTaskDefKey());
flowableQuery.setMap(map);
ResultBean<List<Map<String,Object>>> resultBean = flowTaskFeign.yuyanTest(flowableQuery);
if(!resultBean.getData().isEmpty()){
List<Map<String,Object>> mapList = resultBean.getData();
mapList.forEach(f->{
AppFlowableRecordAndCommentVo a = new AppFlowableRecordAndCommentVo();
AppFlowableRecordVo app = new AppFlowableRecordVo();
app.setTaskName(f.get("nodeName").toString());
a.setFlowableRecordVo(app);
a.setState(3 + "");
list.add(a);
});
}
}
}
list.sort(Comparator.nullsLast(Comparator.comparing(AppFlowableRecordAndCommentVo::getTime,nullComparator)));
return rb.success().setData(list);
}

Loading…
Cancel
Save