bug
This commit is contained in:
parent
80538f8796
commit
515aa14e26
@ -98,8 +98,8 @@ public class PsCompanyInfoController extends BaseController {
|
||||
@SaCheckPermission("business:companyInfo:list")
|
||||
@Log(title = "停止代账" )
|
||||
@GetMapping("/applyTerminationService")
|
||||
public R<Void> terminationService(Long serviceCompanyId) {
|
||||
psCompanyInfoService.terminationService(serviceCompanyId);
|
||||
public R<Void> terminationService(Long serviceCompanyId, String desc) {
|
||||
psCompanyInfoService.terminationService(serviceCompanyId, desc);
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
|
@ -4,6 +4,7 @@ import cn.dev33.satoken.annotation.SaCheckPermission;
|
||||
import com.pusong.business.domain.bo.AppointBo;
|
||||
import com.pusong.business.domain.bo.MediaCompanySaveBo;
|
||||
import com.pusong.business.domain.bo.PsTaskQueryBo;
|
||||
import com.pusong.business.domain.bo.ResetAppointBo;
|
||||
import com.pusong.business.domain.vo.PsTaskAppointVo;
|
||||
import com.pusong.business.domain.vo.PsTaskMainVo;
|
||||
import com.pusong.business.domain.vo.TaskPlanVo;
|
||||
@ -147,17 +148,14 @@ public class PsTaskController extends BaseController {
|
||||
|
||||
/**
|
||||
* 任务改派
|
||||
* @param id 任务委派表id
|
||||
* @param executorId 任务新的执行者id
|
||||
* @return
|
||||
*/
|
||||
@Log(title = "任务改派")
|
||||
@SaCheckPermission("business:task:list")
|
||||
@GetMapping("/reset")
|
||||
@PostMapping("/reset")
|
||||
@RepeatSubmit()
|
||||
public R<Void> taskReset(@NotNull Long id, @NotNull String executorIdStr) {
|
||||
String[] executorIds = executorIdStr.split(",");
|
||||
psTaskMainService.taskReset(id, executorIds);
|
||||
public R<Void> taskReset(@Validated @RequestBody ResetAppointBo appointBo) {
|
||||
psTaskMainService.taskReset(appointBo.getId(), appointBo.getExecutorId());
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
|
@ -0,0 +1,22 @@
|
||||
package com.pusong.business.domain.bo;
|
||||
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Data
|
||||
@EqualsAndHashCode
|
||||
public class ResetAppointBo {
|
||||
/**
|
||||
* 任务主表id
|
||||
*/
|
||||
@NotNull
|
||||
private Long id;
|
||||
/**
|
||||
* 执行者用户id
|
||||
*/
|
||||
@NotNull
|
||||
private List<Long> executorId;
|
||||
}
|
@ -269,5 +269,5 @@ public class PsCompanyInfoVo implements Serializable {
|
||||
*/
|
||||
private String contractCode;
|
||||
|
||||
|
||||
private PsApproverRecordVo psApproverRecordVo;
|
||||
}
|
||||
|
@ -112,7 +112,7 @@ public class PsContractInfoVo implements Serializable {
|
||||
private String customScene;
|
||||
|
||||
/**
|
||||
* 是否代账
|
||||
* 是否代账 1是 2否
|
||||
*/
|
||||
private String isProxy;
|
||||
/**
|
||||
|
@ -1,12 +1,8 @@
|
||||
package com.pusong.business.domain.vo;
|
||||
|
||||
import java.util.Date;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.pusong.business.domain.PsTaskAppoint;
|
||||
import com.pusong.business.domain.PsTaskMain;
|
||||
import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
|
||||
import com.pusong.common.excel.annotation.ExcelDictFormat;
|
||||
import com.pusong.common.excel.convert.ExcelDictConvert;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.pusong.business.domain.PsTaskMain;
|
||||
import com.pusong.common.translation.annotation.Translation;
|
||||
import com.pusong.common.translation.constant.TransConstant;
|
||||
import io.github.linpeilie.annotations.AutoMapper;
|
||||
@ -166,5 +162,10 @@ public class PsTaskMainVo implements Serializable {
|
||||
private Long serviceCompanyId;
|
||||
|
||||
private List<PsTaskAppointVo> psTaskAppointVoList;
|
||||
|
||||
/**
|
||||
* 是否代账
|
||||
*/
|
||||
private String isProxy;
|
||||
}
|
||||
|
||||
|
@ -1,10 +1,8 @@
|
||||
package com.pusong.business.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.pusong.business.domain.bo.PsCompanyFollowBo;
|
||||
import com.pusong.business.domain.bo.PsCompanyInfoBo;
|
||||
import com.pusong.business.domain.bo.PsCompanyQueryBo;
|
||||
import com.pusong.business.domain.vo.PsApproverRecordVo;
|
||||
import com.pusong.business.domain.vo.PsCompanyInfoVo;
|
||||
import com.pusong.common.mybatis.core.page.PageQuery;
|
||||
import com.pusong.common.mybatis.core.page.TableDataInfo;
|
||||
@ -99,5 +97,5 @@ public interface IPsCompanyInfoService {
|
||||
List<PsCompanyInfoVo> getServiceCompany(String controctCode);
|
||||
|
||||
List<PsCompanyInfoVo> getServiceCompany(List<String> controctCodes);
|
||||
void terminationService(Long serviceCompanyId);
|
||||
void terminationService(Long serviceCompanyId, String desc);
|
||||
}
|
||||
|
@ -122,7 +122,7 @@ public interface IPsTaskService {
|
||||
* @param id 任务委派表id
|
||||
* @param executorId 任务新的执行者id
|
||||
*/
|
||||
void taskReset(Long id, String[] executorId);
|
||||
void taskReset(Long id, List<Long> executorId);
|
||||
/**
|
||||
* 免费工单任务作废
|
||||
* @param id 任务主表id
|
||||
|
@ -110,7 +110,7 @@ public abstract class ApproverAbstractServiceImpl implements ApproverService {
|
||||
|
||||
if (ApproverTypeEnum.PAY.getCode().equals( bo.getBusinessType()) || ApproverTypeEnum.RETURN.getCode().equals( bo.getBusinessType()) ){
|
||||
if (bo.getPay() == null){
|
||||
bo.setPay("1");
|
||||
bo.setPay("0");
|
||||
}
|
||||
}
|
||||
Page<PsApproverRecordVo> res = recordMapper.selectPageApproverList(pageQuery.build(), lqw, bo.getPay());
|
||||
|
@ -1,20 +1,35 @@
|
||||
package com.pusong.business.service.approver.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.pusong.business.domain.PsApproverRecord;
|
||||
import com.pusong.business.domain.bo.PsApproverRecordBo;
|
||||
import com.pusong.business.domain.bo.PsCompanyInfoBo;
|
||||
import com.pusong.business.domain.vo.PsApproverRecordVo;
|
||||
import com.pusong.business.domain.vo.PsCompanyInfoVo;
|
||||
import com.pusong.business.domain.vo.PsContractPayVo;
|
||||
import com.pusong.business.enums.ApproverStatusEnum;
|
||||
import com.pusong.business.enums.ApproverStepEnum;
|
||||
import com.pusong.business.enums.ApproverTypeEnum;
|
||||
import com.pusong.business.enums.PayStatusEnum;
|
||||
import com.pusong.business.mapper.PsApproverRecordMapper;
|
||||
import com.pusong.business.mapper.PsTaskAppointMapper;
|
||||
import com.pusong.business.mapper.PsTaskMainMapper;
|
||||
import com.pusong.business.service.IPsCompanyInfoService;
|
||||
import com.pusong.business.service.IPsContractInfoService;
|
||||
import com.pusong.common.core.utils.DateUtils;
|
||||
import com.pusong.common.core.utils.StringUtils;
|
||||
import com.pusong.common.mybatis.core.page.PageQuery;
|
||||
import jakarta.annotation.Resource;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 免费工单审批
|
||||
*/
|
||||
@ -61,6 +76,38 @@ public class StopAccountServiceImpl extends ApproverAbstractServiceImpl {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public Page<PsApproverRecordVo> queryList(PsApproverRecordBo bo, PageQuery pageQuery){
|
||||
QueryWrapper<PsApproverRecord> lqw = Wrappers.<PsApproverRecord>query()
|
||||
.eq(StringUtils.isNotBlank(bo.getBusinessType()),"app.business_type", approverType())
|
||||
.eq(bo.getId() != null,"app.id",bo.getId())
|
||||
.eq("app.del_flag","0")
|
||||
.eq(StringUtils.isNotBlank(bo.getApproverStatus()),"app.approver_status", bo.getApproverStatus())
|
||||
.like(StringUtils.isNotBlank(bo.getCustomerName()),"cus.custom_name", bo.getCustomerName())
|
||||
.like(StringUtils.isNotBlank(bo.getCompanyName()),"com.company_name", bo.getCompanyName())
|
||||
//销售经理姓名
|
||||
.exists(StringUtils.isNotBlank(bo.getCustomManagerName()),"select 1 from sys_user su where su.user_id = info.custom_manager and su.nick_name like '%"+bo.getCustomManagerName()+"%'")
|
||||
.eq(StringUtils.isNotBlank(bo.getBusinessId()),"app.business_id", bo.getBusinessId())
|
||||
.orderByAsc("app.approver_status").orderByDesc("app.apply_date");
|
||||
Page<PsApproverRecordVo> res = recordMapper.selectPageFreeApproverList(pageQuery.build(), lqw);
|
||||
if(CollectionUtils.isNotEmpty(res.getRecords())){
|
||||
res.getRecords().forEach(item->{
|
||||
if (item.getContractAmount() != null)
|
||||
item.setResidualMoney(item.getContractAmount().subtract(item.getPayMoney()));
|
||||
//装填回款周期
|
||||
List<PsContractPayVo> payList = queryListByContractCode(item.getContractCode(),"1", PayStatusEnum.SUCCESS);
|
||||
if(CollectionUtils.isNotEmpty(payList)){
|
||||
item.setPeriod(DateUtils.calWorkDate(payList.get(0).getPayDate(),payList.get(payList.size()-1).getPayDate()));
|
||||
}
|
||||
|
||||
//装填服务公司信息
|
||||
PsCompanyInfoVo psCompanyInfoVo = companyInfoService.queryById(Long.valueOf(item.getBusinessId()));
|
||||
if (psCompanyInfoVo != null){
|
||||
item.setServicePsCompanyInfoVo(Arrays.asList(psCompanyInfoVo));
|
||||
}
|
||||
});
|
||||
}
|
||||
return res;
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -10,7 +10,6 @@ import com.pusong.business.domain.bo.PsApproverRecordBo;
|
||||
import com.pusong.business.domain.vo.PsApproverRecordVo;
|
||||
import com.pusong.business.enums.ApproverStatusEnum;
|
||||
import com.pusong.business.enums.ApproverStepEnum;
|
||||
import com.pusong.business.enums.ApproverTypeEnum;
|
||||
import com.pusong.business.mapper.PsApproverRecordMapper;
|
||||
import com.pusong.business.service.IPsApproverRecordService;
|
||||
import com.pusong.business.service.approver.ApproverContainer;
|
||||
@ -125,12 +124,13 @@ public class PsApproverRecordServiceImpl implements IPsApproverRecordService {
|
||||
info.setApproverDate(new Date());
|
||||
info.setApproverDesc(desc);
|
||||
baseMapper.updateById(info);
|
||||
if(StringUtils.equals(info.getBusinessType(),ApproverTypeEnum.PAY.getCode())||
|
||||
StringUtils.equals(info.getBusinessType(),ApproverTypeEnum.ROLBACK.getCode())||
|
||||
StringUtils.equals(info.getBusinessType(),ApproverTypeEnum.TASKFINISH.getCode())){
|
||||
return info.getContractCode();
|
||||
}
|
||||
}
|
||||
// if(StringUtils.equals(info.getBusinessType(), ApproverTypeEnum.PAY.getCode())||
|
||||
// StringUtils.equals(info.getBusinessType(),ApproverTypeEnum.ROLBACK.getCode())||
|
||||
// StringUtils.equals(info.getBusinessType(),ApproverTypeEnum.TASKFINISH.getCode())){
|
||||
//
|
||||
// }
|
||||
// return ids;
|
||||
return null;
|
||||
}
|
||||
|
||||
|
@ -335,7 +335,7 @@ public class PsCompanyInfoServiceImpl implements IPsCompanyInfoService {
|
||||
List<PsCompanyInfoVo> list = baseMapper.selectServiceCompanyList(wq);
|
||||
for (PsCompanyInfoVo psCompanyInfoVo : list) {
|
||||
for (PsContractBusinessVo psContractBusinessVo : psCompanyInfoVo.getBusinessVoList()) {
|
||||
if ("1".equals(psContractBusinessVo.getIsProxy())){
|
||||
if (psContractBusinessVo.getIsProxy() != null){
|
||||
psCompanyInfoVo.setStartServiceDate(psContractBusinessVo.getStartDate());
|
||||
psCompanyInfoVo.setEndServiceDate(psContractBusinessVo.getEndDate());
|
||||
psCompanyInfoVo.setIsOld(psContractBusinessVo.getIsOld());
|
||||
@ -359,7 +359,7 @@ public class PsCompanyInfoServiceImpl implements IPsCompanyInfoService {
|
||||
List<PsCompanyInfoVo> list = baseMapper.selectServiceCompanyList(wq);
|
||||
for (PsCompanyInfoVo psCompanyInfoVo : list) {
|
||||
for (PsContractBusinessVo psContractBusinessVo : psCompanyInfoVo.getBusinessVoList()) {
|
||||
if ("1".equals(psContractBusinessVo.getIsProxy())){
|
||||
if (psContractBusinessVo.getIsProxy() != null){
|
||||
psCompanyInfoVo.setStartServiceDate(psContractBusinessVo.getStartDate());
|
||||
psCompanyInfoVo.setEndServiceDate(psContractBusinessVo.getEndDate());
|
||||
psCompanyInfoVo.setIsOld(psContractBusinessVo.getIsOld());
|
||||
@ -376,9 +376,9 @@ public class PsCompanyInfoServiceImpl implements IPsCompanyInfoService {
|
||||
*
|
||||
* @param serviceCompanyId
|
||||
*/
|
||||
public void terminationService(Long serviceCompanyId) {
|
||||
public void terminationService(Long serviceCompanyId, String desc) {
|
||||
//发起审批
|
||||
ApproverService service = container.getService(ApproverTypeEnum.STOPACCOUNT.getCode());
|
||||
service.apply(serviceCompanyId + "", "",null, ApproverStepEnum.INIT.getCode());
|
||||
service.apply(serviceCompanyId + "", "", desc, ApproverStepEnum.INIT.getCode());
|
||||
}
|
||||
}
|
||||
|
@ -418,6 +418,16 @@ public class PsContractInfoServiceImpl implements IPsContractInfoService {
|
||||
updateCompany.add(companyInfoBo);
|
||||
oldCompanyMap.remove(companyInfoBo.getId());
|
||||
}
|
||||
for (PsCompanyInfoBo companyInfoBo : updateBo.getServiceCompanyInfoList()) {
|
||||
for (PsContractBusinessBo psContractBusinessBo : companyInfoBo.getBusinessList()) {
|
||||
if (psContractBusinessBo.getBusinessType().equals("2")) {
|
||||
psContractBusinessBo.setStartDate(companyInfoBo.getStartServiceDate());
|
||||
psContractBusinessBo.setEndDate(companyInfoBo.getEndServiceDate());
|
||||
psContractBusinessBo.setIsOld(companyInfoBo.getIsOld());
|
||||
psContractBusinessBo.setIsProxy(companyInfoBo.getIsProxy());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
for (PsCompanyInfoBo psCompanyInfoBo : updateCompany) {
|
||||
//服务公司信息修改、、服务项目修改
|
||||
@ -955,6 +965,12 @@ public class PsContractInfoServiceImpl implements IPsContractInfoService {
|
||||
}
|
||||
for (PsContractInfoVo vo : vos) {
|
||||
vo.setPsCompanySerivceVo(psCompanyInfoVoMap.get(vo.getContractCode()));
|
||||
|
||||
// for (PsCompanyInfoVo psCompanyInfoVo : vo.getPsCompanySerivceVo()) {
|
||||
// if (psCompanyInfoVo.getIsProxy() != null){
|
||||
// vo.setIsProxy(psCompanyInfoVo.getIsProxy());
|
||||
// }
|
||||
// }
|
||||
}
|
||||
|
||||
for (PsContractInfoVo vo : vos) {
|
||||
@ -978,6 +994,12 @@ public class PsContractInfoServiceImpl implements IPsContractInfoService {
|
||||
int num = DateUtils.differentDaysByMillisecond(new Date(), vo.getEndServiceDate());
|
||||
vo.setEndNum(Math.max(num, 0));
|
||||
}
|
||||
|
||||
if (!vo.isTaskNoFinish() && vo.getContractStatus().equals(ContractStatusEnum.CREATE.getCode())){
|
||||
vo.setTaskNoFinish(true);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
@ -164,6 +164,7 @@ public class PsTaskServiceImpl implements IPsTaskService {
|
||||
String ex = bo.getExecutor();
|
||||
bo.setExecutor(null);
|
||||
QueryWrapper<PsTaskMain> lqw = buildQueryWrapper(bo);
|
||||
lqw.ne(StringUtils.isBlank(bo.getTaskStatus()), "main.task_status", TaskStatusEnum.CANCEL.getCode());
|
||||
lqw.exists(StringUtils.isNotBlank(ex), "select 1 from sys_user su where appo.executor = su.user_id and su.nick_name like '%" + ex + "%'");
|
||||
lqw.eq("appo.appoint_type",bo.getAppointType());
|
||||
lqw.eq(id != null,"appo.id",id);
|
||||
@ -436,14 +437,14 @@ public class PsTaskServiceImpl implements IPsTaskService {
|
||||
* @param id 任务委派表id
|
||||
* @param executorId 任务新的执行者id
|
||||
*/
|
||||
public void taskReset(Long id, String[] executorIds){
|
||||
public void taskReset(Long id, List<Long> executorIds){
|
||||
QueryWrapper<PsTaskAppoint> lqw = new QueryWrapper<>();
|
||||
lqw.eq("task_id", id);
|
||||
List<PsTaskAppoint> appoints = appointMapper.selectList(lqw);
|
||||
if (appoints.isEmpty()){
|
||||
throw new ServiceException("当前未指派任何人, 任务状态无法改派");
|
||||
}
|
||||
Set<String> updateExecutorIdSet = new HashSet<>(Set.of(executorIds));
|
||||
Set<Long> updateExecutorIdSet = new HashSet<>(executorIds);
|
||||
// Map<Long, PsTaskAppoint> executorMap = appoints.stream().collect(Collectors.toMap(PsTaskAppoint::getExecutor, a -> a));
|
||||
List<Long> remove = new ArrayList<>();
|
||||
for (PsTaskAppoint existsTaskAppoint : appoints) {
|
||||
@ -465,13 +466,13 @@ public class PsTaskServiceImpl implements IPsTaskService {
|
||||
|
||||
|
||||
List<PsTaskAppoint> insertList = new ArrayList<>();
|
||||
for (String userIdStr : updateExecutorIdSet) {
|
||||
for (Long userIdStr : updateExecutorIdSet) {
|
||||
PsTaskAppoint psTaskAppoint = new PsTaskAppoint();
|
||||
psTaskAppoint.setAppointStatus(AppointStatusEnum.ING.getCode());
|
||||
psTaskAppoint.setAppointType(appoints.get(0).getAppointType());
|
||||
psTaskAppoint.setContractCode(appoints.get(0).getContractCode());
|
||||
psTaskAppoint.setTaskId(appoints.get(0).getTaskId());
|
||||
psTaskAppoint.setExecutor(Long.valueOf(userIdStr));
|
||||
psTaskAppoint.setExecutor(userIdStr);
|
||||
psTaskAppoint.setTaskContentDesc(appoints.get(0).getTaskContentDesc());
|
||||
insertList.add(psTaskAppoint);
|
||||
}
|
||||
@ -516,7 +517,7 @@ public class PsTaskServiceImpl implements IPsTaskService {
|
||||
lqw.eq("main.del_flag","0");
|
||||
|
||||
|
||||
lqw.ne(StringUtils.isBlank(bo.getTaskStatus()), "main.task_status", TaskStatusEnum.CANCEL.getCode());
|
||||
// lqw.ne(StringUtils.isBlank(bo.getTaskStatus()), "main.task_status", TaskStatusEnum.CANCEL.getCode());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getTaskStatus()),"main.task_status", bo.getTaskStatus());
|
||||
|
||||
if(bo.getType() == null){
|
||||
@ -542,7 +543,7 @@ public class PsTaskServiceImpl implements IPsTaskService {
|
||||
lqw.like(StringUtils.isNotBlank(bo.getCustomName()), "com.contact_person_name", bo.getCustomName());//客户姓名
|
||||
lqw.like(StringUtils.isNotBlank(bo.getCustomMobile()), "com.contact_person_phone", bo.getCustomMobile());//客户电话
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getCustomScene()), "con.custom_scene", bo.getCustomScene());//是否到达现场
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getIsProxy()), "con.is_proxy", bo.getIsProxy());//是否代账
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getIsProxy()), "bus.is_proxy", bo.getIsProxy());//是否代账
|
||||
|
||||
|
||||
//服务项目编码集合
|
||||
|
@ -55,10 +55,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
left join ps_company_info com on info.company_id = com.id
|
||||
left join ps_custom_info cus on cus.id = info.custom_id
|
||||
<if test="pay != null">
|
||||
<if test="pay == 1">
|
||||
<if test="pay == 0">
|
||||
inner join ps_contract_pay pay on pay.id = app.business_id
|
||||
</if>
|
||||
<if test="pay != 1">
|
||||
<if test="pay != 0">
|
||||
inner join ps_contract_pay pay on pay.id = app.business_id and pay.pay_mode = ${pay}
|
||||
</if>
|
||||
</if>
|
||||
|
@ -12,6 +12,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
</collection>
|
||||
<collection columnPrefix="fu_" property="followUsers" ofType="com.pusong.system.domain.vo.SysUserVo" >
|
||||
</collection>
|
||||
<collection columnPrefix="app_" property="psApproverRecordVo" ofType="com.pusong.business.domain.vo.PsApproverRecordVo" >
|
||||
</collection>
|
||||
|
||||
<!-- <collection column="company_id" property="psContractBusinessVos"-->
|
||||
<!-- select="com.pusong.business.mapper.PsContractBusinessMapper.selectTuoGuanBusinessListByCompanyId" fetchType="eager"-->
|
||||
@ -77,12 +79,23 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
cus.custom_mobile,
|
||||
cusi.custom_name custom_introducer,
|
||||
usr.user_id fu_user_id,
|
||||
usr.nick_name fu_nick_name
|
||||
usr.nick_name fu_nick_name,
|
||||
app1.id app_id,
|
||||
app1.apply_desc app_apply_desc,
|
||||
app1.approver_status app_approver_status
|
||||
from ps_company_info com
|
||||
left join ps_custom_info cus on com.custom_id = cus.id
|
||||
left join ps_custom_info cusi on cus.custom_introducer = cusi.id
|
||||
left join ps_company_follow cf on com.id = cf.company_id
|
||||
left join sys_user usr on cf.user_id = usr.user_id
|
||||
left join (
|
||||
SELECT business_id, max(apply_date) max_apply_date
|
||||
FROM ps_approver_record
|
||||
where business_type = 'stopAccount'
|
||||
group by business_id
|
||||
-- order by apply_date limit 1
|
||||
) app on app.business_id = CAST(com.id AS CHAR)
|
||||
left join ps_approver_record app1 on app1.apply_date = app.max_apply_date and app1.business_id = app.business_id
|
||||
${ew.getCustomSqlSegment}
|
||||
</select>
|
||||
|
||||
|
@ -31,7 +31,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
us.nick_name custom_manager_name,
|
||||
(select ptm.invoice from ps_task_main ptm where ptm.task_type = '3' and ptm.contract_code = info.contract_code and ptm.task_status = 30 limit 0,1)
|
||||
as invoice_ossid,
|
||||
(select 1 from ps_task_main where contract_code = info.contract_code and task_status != '30' limit 1) task_no_finish
|
||||
(select 1 from ps_task_main where contract_code = info.contract_code and task_status != '30' and task_status != '50' limit 1) task_no_finish
|
||||
from ps_contract_info info
|
||||
left join ps_company_info com on info.company_id = com.id
|
||||
left join ps_custom_info cus on info.custom_id = cus.id
|
||||
|
@ -37,20 +37,26 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
con.contract_amount con_contract_amount,
|
||||
con.custom_scene con_custom_scene,
|
||||
con.sign_desc con_sign_desc,
|
||||
con.is_old con_is_old,
|
||||
con.roll_back_pdf con_roll_back_pdf,
|
||||
scom.id scom_id,
|
||||
scom.company_adress scom_company_adress,
|
||||
scom.company_name scom_company_name,
|
||||
scom.legal_person_name scom_legal_person_name,
|
||||
scom.legal_person_idcard scom_legal_person_idcard,
|
||||
scom.legal_person_phone scom_legal_person_phone,
|
||||
scom.contact_person_name scom_contact_person_name,
|
||||
scom.contact_person_phone scom_contact_person_phone,
|
||||
scom.customer_num scom_customer_num,
|
||||
scom.customer_cert scom_customer_cert,
|
||||
com.id com_id,
|
||||
com.company_adress scom_company_adress,
|
||||
com.company_name scom_company_name,
|
||||
com.legal_person_name scom_legal_person_name,
|
||||
com.legal_person_idcard scom_legal_person_idcard,
|
||||
com.legal_person_phone scom_legal_person_phone,
|
||||
com.contact_person_name scom_contact_person_name,
|
||||
com.contact_person_phone scom_contact_person_phone,
|
||||
com.customer_num scom_customer_num,
|
||||
com.customer_cert scom_customer_cert,
|
||||
com.company_name com_company_name,
|
||||
usr.nick_name scom_custom_manager_name,
|
||||
cus.id cus_id,
|
||||
cus.custom_name cus_custom_name ,
|
||||
cus.custom_mobile cus_custom_mobile,
|
||||
cus.custom_manager cus_custom_manager,
|
||||
usr.nick_name cus_custom_manager_name,
|
||||
|
||||
(select pta.id from ps_task_appoint pta where pta.task_id=main.id and pta.appoint_type=1 and pta.appoint_status != '50' and pta.del_flag = '0' order by id desc limit 0,1) as inAppo,
|
||||
(select pta.id from ps_task_appoint pta where pta.task_id=main.id and pta.appoint_type=2 and pta.appoint_status != '50' and pta.del_flag = '0' order by id desc limit 0,1) as outAppo,
|
||||
@ -61,12 +67,16 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
) > 0 THEN '半款' ELSE '全款' END) as pay_stauts_desc,
|
||||
-- (select GROUP_CONCAT(appoint.executor SEPARATOR ',') from ps_task_appoint appoint where appoint.task_id = main.id and appoint.appoint_status != '50' and appoint.del_flag = '0') as executors,
|
||||
-- (select GROUP_CONCAT(appoint.task_desc SEPARATOR ',') from ps_task_appoint appoint where appoint.task_id = main.id and appoint.appoint_status != '50' and appoint.del_flag = '0') as taskDesc,
|
||||
(select GROUP_CONCAT(business.business_type SEPARATOR ',') from ps_contract_business business where business.contract_code = con.contract_code and business.company_id = main.service_company_id and business.del_flag = '0') as business_type_name
|
||||
(select GROUP_CONCAT(business.business_type SEPARATOR ',') from ps_contract_business business where business.contract_code = con.contract_code and business.company_id = main.service_company_id and business.del_flag = '0') as business_type_name,
|
||||
(select 1 from ps_contract_business business2 where business2.contract_code = con.contract_code and business2.company_id = main.service_company_id and business2.del_flag = '0' and business2.is_proxy = '1' limit 1) as scom_is_proxy
|
||||
from ps_task_main main
|
||||
left join ps_contract_info con on main.contract_code = con.contract_code
|
||||
left join ps_company_info com on main.service_company_id = com.id
|
||||
left join ps_custom_info cus on com.custom_id = cus.id
|
||||
left join ps_company_info scom on main.service_company_id = scom.id
|
||||
left join ps_company_info com on main.company_id = com.id
|
||||
left join ps_custom_info cus on main.custom_id = cus.id
|
||||
left join sys_user usr on cus.custom_manager = usr.user_id
|
||||
left join ps_contract_business bus on bus.contract_code = con.contract_code and bus.company_id = main.service_company_id and bus.del_flag = '0'
|
||||
|
||||
</sql>
|
||||
<select id="queryTaskPageList" resultMap="taskMainResult">
|
||||
<include refid="queryTask"/>
|
||||
@ -123,7 +133,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
left join ps_task_main main on appo.task_id = main.id and appo.appoint_status != '50'
|
||||
left join ps_contract_info con on main.contract_code = con.contract_code
|
||||
left join ps_company_info com on main.service_company_id = com.id
|
||||
left join ps_custom_info cus on com.custom_id = cus.id
|
||||
left join ps_custom_info cus on main.custom_id = cus.id
|
||||
left join sys_user usr on cus.custom_manager = usr.user_id
|
||||
-- left join ps_task_appoint appoint on appoint.task_id = main.id and appoint.appoint_status != '50' and appoint.del_flag = '0'
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user