|
|
@@ -421,8 +421,9 @@ public class OrderNewServiceImpl extends BaseMybatisDao<TOrderNewMapper> impleme
|
|
|
contactBook.setMobile(t.getContactMobile());
|
|
|
organizationContactBookMapper.insertSelective(contactBook);
|
|
|
}
|
|
|
+ Admin admin = adminMapper.selectByPrimaryKey(TokenManager.getAdminId());
|
|
|
if (StringUtils.isBlank(t.getOrderDep())) {
|
|
|
- t.setOrderDep(adminMapper.selectByPrimaryKey(TokenManager.getAdminId()).getDepartmentId());
|
|
|
+ t.setOrderDep(admin.getDepartmentId());
|
|
|
}
|
|
|
if (isSubmit==1) {//订单提交
|
|
|
if(t2.getProcessStatus()<ProcessStatus.YPYXGLY.getCode()) {
|
|
|
@@ -431,8 +432,18 @@ public class OrderNewServiceImpl extends BaseMybatisDao<TOrderNewMapper> impleme
|
|
|
}else {
|
|
|
t.setOrderStatus(OrderNewState.QDSHTG.getCode());
|
|
|
}
|
|
|
- if (t2.getApproval()==ApprovalNewState.BH.getCode()){
|
|
|
- t.setApproval(ApprovalNewState.DSH.getCode());
|
|
|
+ //特批逻辑处理
|
|
|
+ if (t2.getApproval()==ApprovalNewState.ZCDSH.getCode()){
|
|
|
+ if (admin.getId().equals("734092ad-6564-4021-b7ab-aab5af3a1537")){
|
|
|
+ t.setApproval(ApprovalNewState.DSZDSH.getCode());
|
|
|
+ }else {
|
|
|
+ t.setApproval(ApprovalNewState.ZCDSH.getCode());
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if (t2.getApproval()==ApprovalNewState.ZCBH.getCode()){
|
|
|
+ t.setApproval(ApprovalNewState.ZCDSH.getCode());
|
|
|
+ }else if (t2.getApproval()==ApprovalNewState.DSZBH.getCode()){
|
|
|
+ t.setApproval(ApprovalNewState.DSZDSH.getCode());
|
|
|
}
|
|
|
//生成流转
|
|
|
TOrderLog tl=new TOrderLog();
|
|
|
@@ -460,7 +471,8 @@ public class OrderNewServiceImpl extends BaseMybatisDao<TOrderNewMapper> impleme
|
|
|
pushGeneralSendNoticeAndEmail(aids, type,order, TokenManager.getAdminId(),t.getApproval());
|
|
|
|
|
|
}
|
|
|
- if (t2.getApproval().equals(ApprovalNewState.BH.getCode()) ||
|
|
|
+ if (t2.getApproval().equals(ApprovalNewState.ZCBH.getCode()) ||
|
|
|
+ t2.getApproval().equals(ApprovalNewState.DSZBH.getCode()) ||
|
|
|
t2.getOrderStatus().equals(OrderNewState.QDSHJJ.getCode()) ||
|
|
|
t2.getOrderStatus().equals(OrderNewState.YBH.getCode())) {
|
|
|
t.setCreateTime(new Date());
|
|
|
@@ -675,9 +687,16 @@ public class OrderNewServiceImpl extends BaseMybatisDao<TOrderNewMapper> impleme
|
|
|
@Override
|
|
|
public Pagination<TOrderNewBo> orderNewList(InputOrderNewListBo in) {
|
|
|
Map<String, Object> params = new HashMap<>();
|
|
|
- if (in.getSpecially()!=null&&(in.getSpecially()==0||in.getSpecially()==1||in.getSpecially()==2||in.getSpecially()==4||in.getSpecially()==5||in.getSpecially()==7)) {
|
|
|
+ Pagination<TOrderNewBo> x = addParams(in, params);
|
|
|
+ if (x != null) return x;
|
|
|
+ Pagination<TOrderNewBo> p = (Pagination<TOrderNewBo>)findPage("selectOrderNewListByPage", "selectOrderNewListCount", params, in.getPageNo(), in.getPageSize());
|
|
|
+ return p;
|
|
|
+ }
|
|
|
+
|
|
|
+ private Pagination<TOrderNewBo> addParams(InputOrderNewListBo in, Map<String, Object> params) {
|
|
|
+ if (in.getSpecially()!=null&&(in.getSpecially()==0|| in.getSpecially()==1|| in.getSpecially()==2|| in.getSpecially()==4|| in.getSpecially()==5|| in.getSpecially()==7)) {
|
|
|
//0 个人 1 营销员管理 2 驳回 3 特批 4 咨询师管理 5部门订单查询
|
|
|
- if (in.getSpecially()!=3&&in.getSpecially()!=4) {
|
|
|
+ if (in.getSpecially()!=3&& in.getSpecially()!=4) {
|
|
|
if (in.getAid() ==null){
|
|
|
params.put("aid", TokenManager.getAdminId()==null?"1":TokenManager.getAdminId());
|
|
|
}else{
|
|
|
@@ -686,7 +705,7 @@ public class OrderNewServiceImpl extends BaseMybatisDao<TOrderNewMapper> impleme
|
|
|
}
|
|
|
//(咨询师管理列表 0 未分配 1部分 2全部)
|
|
|
if(in.getSpecially()==4) {
|
|
|
- params.put("distribution",in.getDistribution());
|
|
|
+ params.put("distribution", in.getDistribution());
|
|
|
}
|
|
|
}else if(in.getSpecially()==8){
|
|
|
if (StringUtils.isNotBlank(in.getUid())) {
|
|
|
@@ -697,12 +716,16 @@ public class OrderNewServiceImpl extends BaseMybatisDao<TOrderNewMapper> impleme
|
|
|
params.put("aid", in.getAid());
|
|
|
}
|
|
|
}
|
|
|
- params.put("specially",in.getSpecially());
|
|
|
+ if (in.getSpecially()==3){
|
|
|
+ if (TokenManager.hasRole(AFTConstants.CED))params.put("manageType",0);
|
|
|
+ else if (TokenManager.hasRole(AFTConstants.APPROVAL_DECISION_AUDITOR))params.put("manageType",1);
|
|
|
+ }
|
|
|
+ params.put("specially", in.getSpecially());
|
|
|
if (StringUtils.isNotBlank(in.getName())) {
|
|
|
params.put("name", in.getName());
|
|
|
}
|
|
|
// 计算出所有本部门及所属部门的ID
|
|
|
- if(in.getSpecially()==1||in.getSpecially()==5) {
|
|
|
+ if(in.getSpecially()==1|| in.getSpecially()==5) {
|
|
|
List<String>departmentList=new ArrayList<>();
|
|
|
if (in.getDeps()!=null){
|
|
|
departmentList=departmentService.selectSubDeps(in.getDeps());
|
|
|
@@ -721,39 +744,38 @@ public class OrderNewServiceImpl extends BaseMybatisDao<TOrderNewMapper> impleme
|
|
|
if (StringUtils.isNotBlank(in.getContractNo())) {
|
|
|
params.put("contractNo", in.getContractNo());
|
|
|
}
|
|
|
- if (null!=in.getLiquidationStatus()) {
|
|
|
+ if (null!= in.getLiquidationStatus()) {
|
|
|
params.put("liquidationStatus", in.getLiquidationStatus());
|
|
|
}
|
|
|
- if (null !=in.getApproval()) {
|
|
|
- params.put("approval", in.getApproval());
|
|
|
- }
|
|
|
- if(null != in.getAmountStatus()) {
|
|
|
- params.put("amountStatus", in.getAmountStatus());
|
|
|
- }
|
|
|
- if (StringUtils.isNotBlank(in.getOrderNo())) {
|
|
|
- params.put("orderNo", in.getOrderNo());
|
|
|
- }
|
|
|
- if (StringUtils.isNotBlank(in.getStarTime())) {
|
|
|
- params.put("starTime", in.getStarTime());
|
|
|
- }
|
|
|
- if (StringUtils.isNotBlank(in.getEndTime())) {
|
|
|
- params.put("endTime", in.getEndTime()+" 23:59:59");
|
|
|
- }
|
|
|
- if (StringUtils.isNotBlank(in.getContractStart())) {
|
|
|
- params.put("contractStart", in.getContractStart());
|
|
|
- }
|
|
|
- if (StringUtils.isNotBlank(in.getContractEnd())) {
|
|
|
- params.put("contractEnd", in.getContractEnd()+" 23:59:59");
|
|
|
- }
|
|
|
- if(null != in.getProjectType()) {
|
|
|
- params.put("projectType",in.getProjectType());
|
|
|
- }
|
|
|
- if(null != in.getProcessStatus()) {
|
|
|
- params.put("processStatus",in.getProcessStatus());
|
|
|
- }
|
|
|
+ if (null != in.getApproval()) {
|
|
|
+ params.put("approval", in.getApproval());
|
|
|
+ }
|
|
|
+ if(null != in.getAmountStatus()) {
|
|
|
+ params.put("amountStatus", in.getAmountStatus());
|
|
|
+ }
|
|
|
+ if (StringUtils.isNotBlank(in.getOrderNo())) {
|
|
|
+ params.put("orderNo", in.getOrderNo());
|
|
|
+ }
|
|
|
+ if (StringUtils.isNotBlank(in.getStarTime())) {
|
|
|
+ params.put("starTime", in.getStarTime());
|
|
|
+ }
|
|
|
+ if (StringUtils.isNotBlank(in.getEndTime())) {
|
|
|
+ params.put("endTime", in.getEndTime()+" 23:59:59");
|
|
|
+ }
|
|
|
+ if (StringUtils.isNotBlank(in.getContractStart())) {
|
|
|
+ params.put("contractStart", in.getContractStart());
|
|
|
+ }
|
|
|
+ if (StringUtils.isNotBlank(in.getContractEnd())) {
|
|
|
+ params.put("contractEnd", in.getContractEnd()+" 23:59:59");
|
|
|
+ }
|
|
|
+ if(null != in.getProjectType()) {
|
|
|
+ params.put("projectType", in.getProjectType());
|
|
|
+ }
|
|
|
+ if(null != in.getProcessStatus()) {
|
|
|
+ params.put("processStatus", in.getProcessStatus());
|
|
|
+ }
|
|
|
params.put("outsource", in.getOutsource());
|
|
|
- Pagination<TOrderNewBo> p = (Pagination<TOrderNewBo>)findPage("selectOrderNewListByPage", "selectOrderNewListCount", params, in.getPageNo(), in.getPageSize());
|
|
|
- return p;
|
|
|
+ return null;
|
|
|
}
|
|
|
|
|
|
|
|
|
@@ -1184,8 +1206,10 @@ public class OrderNewServiceImpl extends BaseMybatisDao<TOrderNewMapper> impleme
|
|
|
Integer type=null;
|
|
|
TOrderLog tl=new TOrderLog();
|
|
|
tl.setOrderNo(orderNo);
|
|
|
+
|
|
|
if (confirm==2) {
|
|
|
- t.setApproval(2);
|
|
|
+ if (t2.getApproval()==ApprovalNewState.ZCDSH.getCode())t.setApproval(ApprovalNewState.ZCTG.getCode());
|
|
|
+ else if (t2.getApproval()==ApprovalNewState.DSZDSH.getCode())t.setApproval(ApprovalNewState.DSZTG.getCode());
|
|
|
t.setProcessStatus(ProcessStatus.YPZXSGLY.getCode());
|
|
|
OrganizationListOut oo=departmentMapper.selectAllById(t2.getOrderDep());
|
|
|
t.setFinanceId(oo.getFinanceId());
|
|
|
@@ -1195,7 +1219,8 @@ public class OrderNewServiceImpl extends BaseMybatisDao<TOrderNewMapper> impleme
|
|
|
type=NoticeStatus.ORDER_APPROVA_YES.getCode();
|
|
|
tl.setProcess(OrderLogProcess.TP.getCode());
|
|
|
} else {
|
|
|
- t.setApproval(3);
|
|
|
+ if (t2.getApproval()==ApprovalNewState.ZCDSH.getCode())t.setApproval(ApprovalNewState.ZCBH.getCode());
|
|
|
+ else if (t2.getApproval()==ApprovalNewState.DSZDSH.getCode())t.setApproval(ApprovalNewState.DSZBH.getCode());
|
|
|
t.setOrderStatus(OrderNewState.YBH.getCode());
|
|
|
t.setProcessStatus(ProcessStatus.YPYXY.getCode());
|
|
|
addBackOrder(orderNo, reason);
|
|
|
@@ -1207,7 +1232,6 @@ public class OrderNewServiceImpl extends BaseMybatisDao<TOrderNewMapper> impleme
|
|
|
TOrderNewBo order = tOrderNewMapper.getSaleIdByOno(orderNo);
|
|
|
pushGeneralSendNoticeAndEmail(aids, type,order, TokenManager.getAdminId(),t2.getApproval());
|
|
|
//新增特批催款信息
|
|
|
-
|
|
|
return tOrderNewMapper.updateByPrimaryKeySelective(t);
|
|
|
}
|
|
|
|