|
|
@@ -33,6 +33,7 @@ import org.slf4j.Logger;
|
|
|
import org.slf4j.LoggerFactory;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.beans.factory.annotation.Value;
|
|
|
+import org.springframework.cache.annotation.Cacheable;
|
|
|
import org.springframework.scheduling.annotation.EnableAsync;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
|
@@ -87,13 +88,13 @@ public class OrderNewServiceImpl extends BaseMybatisDao<TOrderNewMapper> impleme
|
|
|
@Autowired
|
|
|
private TOrderMidMapper tOrderMidMapper;
|
|
|
@Autowired
|
|
|
- private TOrderRefundMapper tOrderRefundMapper;
|
|
|
+ private TOrderRefundMapper tOrderRefundMapper;
|
|
|
@Autowired
|
|
|
private TOrderBackMapper tOrderBackMapper;
|
|
|
@Autowired
|
|
|
private OrganizationContactBookMapper organizationContactBookMapper;
|
|
|
@Autowired
|
|
|
- private OrganizationManagementMapper organizationManagementMapper ;
|
|
|
+ private OrganizationManagementMapper organizationManagementMapper ;
|
|
|
@Autowired
|
|
|
private JDBCIdGenerator idGenerator;
|
|
|
@Autowired
|
|
|
@@ -136,26 +137,26 @@ public class OrderNewServiceImpl extends BaseMybatisDao<TOrderNewMapper> impleme
|
|
|
private PushOrderService pushOrderService;
|
|
|
@Autowired
|
|
|
private BusinessProjectMapper businessProjectMapper;
|
|
|
-
|
|
|
+
|
|
|
@Value(value = "${mobileRemindCodeTemplate}")
|
|
|
private String mobileRemindCodeTemplate = null;
|
|
|
@Value(value = "${upload.path}")
|
|
|
private String uploadPath = null;
|
|
|
-
|
|
|
+
|
|
|
@Value(value = "${accessKey}")
|
|
|
private String accessKey = null;
|
|
|
|
|
|
@Value(value = "${accessSecret}")
|
|
|
private String accessSecret = null;
|
|
|
-
|
|
|
+
|
|
|
Logger logger = LoggerFactory.getLogger(OrderNewServiceImpl.class);
|
|
|
|
|
|
-
|
|
|
@Override
|
|
|
public int createServiceOrder(String uid, Integer orderType) {
|
|
|
BigDecimal initial = new BigDecimal(0);
|
|
|
TOrderNew t=new TOrderNew();
|
|
|
- String orderNo=idGenerator.generateId().toString();
|
|
|
+ Date date = new Date();
|
|
|
+ String orderNo=idGenerator.generateId().toString();
|
|
|
t.setOrderNo(orderNo);
|
|
|
t.setOrderType(orderType);
|
|
|
t.setOrderStatus(OrderNewState.DQD.getCode());
|
|
|
@@ -170,8 +171,8 @@ public class OrderNewServiceImpl extends BaseMybatisDao<TOrderNewMapper> impleme
|
|
|
t.setSalesmanId(TokenManager.getAdminId());
|
|
|
t.setCreater(TokenManager.getAdminId()==null?"1":TokenManager.getAdminId());
|
|
|
t.setOrderDep(adminMapper.selectByPrimaryKey(TokenManager.getAdminId()).getDepartmentId());
|
|
|
- t.setCreateTime(new Date());
|
|
|
- t.setUpdateTime(new Date());
|
|
|
+ t.setCreateTime(date);
|
|
|
+ t.setUpdateTime(date);
|
|
|
t.setBuyerId(uid);
|
|
|
User u=userMapper.selectByPrimaryKey(uid);
|
|
|
if(u.getShareType()!=null&&u.getShareType()==2){
|
|
|
@@ -183,11 +184,9 @@ public class OrderNewServiceImpl extends BaseMybatisDao<TOrderNewMapper> impleme
|
|
|
te.setOrderNo(orderNo);
|
|
|
te.setServiceStatus(0);
|
|
|
tOrderExtendMapper.insertSelective(te);
|
|
|
- return tOrderNewMapper.insertSelective(t);
|
|
|
+ return tOrderNewMapper.insertSelective(t);
|
|
|
}
|
|
|
|
|
|
-
|
|
|
-
|
|
|
@Override
|
|
|
public int addOrderTask(TOrderTask t) {
|
|
|
TOrderNew order=tOrderNewMapper.selectByPrimaryKey(t.getOrderNo());
|
|
|
@@ -213,25 +212,23 @@ public class OrderNewServiceImpl extends BaseMybatisDao<TOrderNewMapper> impleme
|
|
|
}
|
|
|
|
|
|
public void checkOrder(TOrderNew order,TOrderTask t){
|
|
|
- if(order == null)
|
|
|
+ if(order == null)
|
|
|
throw new BusinessException(new Error(ErrorConstants.ORDER_NOT_EXIST, "" ,""));
|
|
|
- if(order.getDeleteSign() == ActiveState.ABOLISH.getCode())
|
|
|
+ if(order.getDeleteSign().equals(ActiveState.ABOLISH.getCode()) )
|
|
|
throw new BusinessException(new Error(ErrorConstants.ORDER_ALREADY_FREEZE, order.getOrderNo(),""));
|
|
|
- if(order.getDeleteSign() == ActiveState.LOCKING.getCode())
|
|
|
+ if(order.getDeleteSign().equals( ActiveState.LOCKING.getCode()))
|
|
|
throw new BusinessException(new Error(ErrorConstants.ORDER_ALREADY_REVOKE, order.getOrderNo(),""));
|
|
|
List<LockingReleaseBo> list=userLockReleaseMapper.checkTask(order.getBuyerId(),t.getCommodityId());
|
|
|
if (list.size()>0) {
|
|
|
for (LockingReleaseBo lockingReleaseBo : list) {
|
|
|
- System.out.println(lockingReleaseBo.getAid() +"======="+order.getSalesmanId());
|
|
|
if (!lockingReleaseBo.getAid().equals(order.getSalesmanId())) {
|
|
|
throw new BusinessException(new Error( "该业务已经被其他人锁定","该业务已经被其他人锁定"));
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
}
|
|
|
-
|
|
|
- }
|
|
|
|
|
|
+ }
|
|
|
|
|
|
@Override
|
|
|
public int updateOrderTask(TOrderTask t) {
|
|
|
@@ -280,11 +277,9 @@ public class OrderNewServiceImpl extends BaseMybatisDao<TOrderNewMapper> impleme
|
|
|
if (flag) {
|
|
|
patentNewService.updateCostReduction(t.getId());
|
|
|
}
|
|
|
- return i;
|
|
|
+ return i;
|
|
|
}
|
|
|
|
|
|
-
|
|
|
-
|
|
|
@Override
|
|
|
public int delectOrderTask(Integer id) {
|
|
|
//连带催款一起删除
|
|
|
@@ -292,8 +287,6 @@ public class OrderNewServiceImpl extends BaseMybatisDao<TOrderNewMapper> impleme
|
|
|
return tOrderTaskMapper.deleteByPrimaryKey(id);
|
|
|
}
|
|
|
|
|
|
-
|
|
|
-
|
|
|
@Override
|
|
|
public List<TOrderTaskBo> selectOrderTask(String orderNo) {
|
|
|
List<TOrderTaskBo> list=tOrderTaskMapper.selectOrderTask(orderNo);
|
|
|
@@ -314,10 +307,6 @@ public class OrderNewServiceImpl extends BaseMybatisDao<TOrderNewMapper> impleme
|
|
|
return list;
|
|
|
}
|
|
|
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
@Override
|
|
|
public int updateServiceOrder(TOrderNewWithBLOBs t, Integer isSubmit) {
|
|
|
TOrderNew t2=tOrderNewMapper.selectByPrimaryKey(t.getOrderNo());
|
|
|
@@ -387,7 +376,7 @@ public class OrderNewServiceImpl extends BaseMybatisDao<TOrderNewMapper> impleme
|
|
|
tOrderBackMapper.updateByOrderNoAndBackStatus(t.getOrderNo());
|
|
|
}
|
|
|
// 0 相等
|
|
|
- // -1 小于
|
|
|
+ // -1 小于
|
|
|
// 1 大于
|
|
|
//liquidation_status 清算状态 0-首付待付请,1-尾款待付清,2-已付请,3-部分退款,4-全部退款
|
|
|
//settlement_amount 已付 total_amount 总价格 first_amount首付
|
|
|
@@ -399,12 +388,11 @@ public class OrderNewServiceImpl extends BaseMybatisDao<TOrderNewMapper> impleme
|
|
|
} else if(t2.getSettlementAmount().compareTo(t.getFirstAmount()) < 0){//如果小于首付
|
|
|
t.setLiquidationStatus(LiquidationNewState.WAIT_PAY_FIRST_BALANCE.getCode());
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
}
|
|
|
return tOrderNewMapper.updateByPrimaryKeySelective(t);
|
|
|
}
|
|
|
|
|
|
-
|
|
|
private void updateOrderMid(TOrderNew t) {
|
|
|
TOrderMid tm=tOrderMidMapper.selectByOrderNo(t.getOrderNo());
|
|
|
Admin admin=adminMapper.selectFinanceAdminByOrderDep(t.getOrderDep());
|
|
|
@@ -429,10 +417,8 @@ public class OrderNewServiceImpl extends BaseMybatisDao<TOrderNewMapper> impleme
|
|
|
}else {
|
|
|
tOrderMidMapper.insertSelective(tm);
|
|
|
}
|
|
|
-
|
|
|
- }
|
|
|
-
|
|
|
|
|
|
+ }
|
|
|
|
|
|
/**
|
|
|
* 新建合同编号,优先获取闲置合同编号,否则按年份生成编号
|
|
|
@@ -454,7 +440,7 @@ public class OrderNewServiceImpl extends BaseMybatisDao<TOrderNewMapper> impleme
|
|
|
}else {
|
|
|
//根据前缀查询最大编号
|
|
|
String max=organizationManagementMapper.getMaxAbbreviation(dep.getAbbreviation()+"-");
|
|
|
-
|
|
|
+
|
|
|
String sno=null;
|
|
|
if (StringUtils.isBlank(max)||max.length()<13) {
|
|
|
String cn=""+dep.getAbbreviation()+"-"+y+"0001";
|
|
|
@@ -463,7 +449,7 @@ public class OrderNewServiceImpl extends BaseMybatisDao<TOrderNewMapper> impleme
|
|
|
}else {
|
|
|
int ty=Integer.parseInt(max.substring(max.indexOf("-")+1, max.length()-4));
|
|
|
int no=Integer.parseInt(max.substring(max.length()-4, max.length()));
|
|
|
-
|
|
|
+
|
|
|
//得出字符串
|
|
|
sno = countNo(dep.getAbbreviation(), sno, ty, no);
|
|
|
//迭代得出最后编码
|
|
|
@@ -477,9 +463,6 @@ public class OrderNewServiceImpl extends BaseMybatisDao<TOrderNewMapper> impleme
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
|
|
|
private String iterationNo(String sno ,Object mp, int ty, int no) {
|
|
|
if (tOrderNewMapper.checkContractNo(sno)>0) {
|
|
|
@@ -490,8 +473,6 @@ public class OrderNewServiceImpl extends BaseMybatisDao<TOrderNewMapper> impleme
|
|
|
return sno;
|
|
|
}
|
|
|
|
|
|
-
|
|
|
-
|
|
|
private String countNo(Object object, String sno, int ty, int no) {
|
|
|
no++;
|
|
|
if (no>0&&no<10) {
|
|
|
@@ -505,16 +486,13 @@ public class OrderNewServiceImpl extends BaseMybatisDao<TOrderNewMapper> impleme
|
|
|
}
|
|
|
return sno;
|
|
|
}
|
|
|
-
|
|
|
|
|
|
public void addOrderLog(TOrderLog tl, String reason) {
|
|
|
tl.setAid(TokenManager.getAdminId());
|
|
|
if(reason!=null)tl.setRemarks(reason);
|
|
|
tOrderLogMapper.insertSelective(tl);
|
|
|
-
|
|
|
- }
|
|
|
-
|
|
|
|
|
|
+ }
|
|
|
|
|
|
@Override
|
|
|
public TOrderNewBo getOrderNewDetail(String orderNo) {
|
|
|
@@ -524,8 +502,6 @@ public class OrderNewServiceImpl extends BaseMybatisDao<TOrderNewMapper> impleme
|
|
|
return tOrder;
|
|
|
}
|
|
|
|
|
|
-
|
|
|
-
|
|
|
@Override
|
|
|
public int createOrderDun(String orderDun,String orderNo) {
|
|
|
List<TOrderDun> l= JSON.parseArray(orderDun, TOrderDun.class);
|
|
|
@@ -543,7 +519,7 @@ public class OrderNewServiceImpl extends BaseMybatisDao<TOrderNewMapper> impleme
|
|
|
}else {
|
|
|
tOrderDunMapper.updateByPrimaryKeySelective(t);
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
}
|
|
|
}
|
|
|
boolean flag=true;
|
|
|
@@ -561,13 +537,11 @@ public class OrderNewServiceImpl extends BaseMybatisDao<TOrderNewMapper> impleme
|
|
|
}
|
|
|
flag=true;
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
}
|
|
|
return 1;
|
|
|
}
|
|
|
|
|
|
-
|
|
|
-
|
|
|
@SuppressWarnings("unchecked")
|
|
|
@Override
|
|
|
public Pagination<TOrderNewBo> orderNewList(String aid,String name, String orderNo, String starTime, String endTime,Integer specially,Integer approval,
|
|
|
@@ -611,8 +585,6 @@ public class OrderNewServiceImpl extends BaseMybatisDao<TOrderNewMapper> impleme
|
|
|
return p;
|
|
|
}
|
|
|
|
|
|
-
|
|
|
-
|
|
|
@Override
|
|
|
public int updateOrderNew(String orderNo, Integer orderStatus,String reason,Integer outsource, TOrderOutsource o) {
|
|
|
TOrderNew t= new TOrderNew();
|
|
|
@@ -637,9 +609,9 @@ public class OrderNewServiceImpl extends BaseMybatisDao<TOrderNewMapper> impleme
|
|
|
tl.setOrderNo(orderNo);
|
|
|
tl.setProcess(OrderLogProcess.FQWB.getCode());
|
|
|
addOrderLog(tl,reason);
|
|
|
-
|
|
|
+
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
type=NoticeStatus.ORDER_YES.getCode();
|
|
|
tl.setOrderNo(orderNo);
|
|
|
tl.setProcess(OrderLogProcess.SH.getCode());
|
|
|
@@ -670,14 +642,12 @@ public class OrderNewServiceImpl extends BaseMybatisDao<TOrderNewMapper> impleme
|
|
|
t.setOrderStatus(orderStatus);
|
|
|
tOrderNewMapper.updateByPrimaryKeySelective(t);
|
|
|
if (aids.isEmpty()) {
|
|
|
- throw new BusinessException(new Error( "邮件发送失败,对方设置邮箱错误","邮件发送失败,对方设置邮箱错误"));
|
|
|
+ throw new BusinessException(new Error( "邮件发送失败,对方设置邮箱错误","邮件发送失败,对方设置邮箱错误"));
|
|
|
}
|
|
|
pushGeneralSendNoticeAndEmail(aids, type,t2.getOrderNo(), TokenManager.getAdminId(),t2.getApproval());
|
|
|
- return 1;
|
|
|
+ return 1;
|
|
|
}
|
|
|
|
|
|
-
|
|
|
-
|
|
|
public void pushOrderDun(String orderNo) {
|
|
|
TOrderNew b=tOrderNewMapper.selectByPrimaryKey(orderNo);
|
|
|
if(b.getApproval()==0){
|
|
|
@@ -707,6 +677,14 @@ public class OrderNewServiceImpl extends BaseMybatisDao<TOrderNewMapper> impleme
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * NewProjectStatus.YXZ.getCode()
|
|
|
+ * @param orderNo 订单编号
|
|
|
+ * @param settlementAmount 已收金额
|
|
|
+ * @param date 日期
|
|
|
+ * @param o 订单催款类实对线
|
|
|
+ * @return
|
|
|
+ */
|
|
|
public TOrderMid pushOrderMidDun(String orderNo, BigDecimal settlementAmount, Date date, OutNewOrderDunBo o) {
|
|
|
TOrderMid tm=tOrderMidMapper.selectByOrderNo(orderNo);
|
|
|
tm.setOrderReceivables(tm.getOrderReceivables().add(o.getMoney()));
|
|
|
@@ -719,7 +697,6 @@ public class OrderNewServiceImpl extends BaseMybatisDao<TOrderNewMapper> impleme
|
|
|
return tm;
|
|
|
}
|
|
|
|
|
|
-
|
|
|
public void addNewDunNoticAndSendEmail(String orderNo, OutNewOrderDunBo o) {
|
|
|
AdminListBo a = adminMapper.getDeptNameByAid(TokenManager.getAdminId()==null?"1":TokenManager.getAdminId());
|
|
|
TOrderNewBo b = tOrderNewMapper.getSaleIdByOno(orderNo);
|
|
|
@@ -730,6 +707,7 @@ public class OrderNewServiceImpl extends BaseMybatisDao<TOrderNewMapper> impleme
|
|
|
throw new BusinessException(new Error("邮件发送错误。"));
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
public void addTimingTaskNewDunNoticAndSendEmail(TOrderNew t2, OutNewOrderDunBo o) {
|
|
|
AdminListBo a = adminMapper.getDeptNameByAid("1");
|
|
|
TOrderNewBo b = tOrderNewMapper.getSaleIdByOno(t2.getOrderNo());
|
|
|
@@ -740,8 +718,7 @@ public class OrderNewServiceImpl extends BaseMybatisDao<TOrderNewMapper> impleme
|
|
|
throw new BusinessException(new Error("邮件发送错误。"));
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
-
|
|
|
+
|
|
|
public void NewDunsendEmail(String orderNo,Integer dunId,AdminListBo a,TOrderNewBo b) throws UnsupportedEncodingException, MessagingException{
|
|
|
NewOrderDun ob=newOrderDunMapper.selectByPrimaryKey(dunId);
|
|
|
AdminListBo a2 = adminMapper.getDeptNameByAid(b.getSalesmanId());
|
|
|
@@ -759,7 +736,7 @@ public class OrderNewServiceImpl extends BaseMybatisDao<TOrderNewMapper> impleme
|
|
|
asyncUtils.patentSend(bo);
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
|
|
|
}
|
|
|
|
|
|
@@ -779,7 +756,6 @@ public class OrderNewServiceImpl extends BaseMybatisDao<TOrderNewMapper> impleme
|
|
|
tOrderBackMapper.insertSelective(ob);
|
|
|
}
|
|
|
|
|
|
-
|
|
|
@SuppressWarnings("unchecked")
|
|
|
@Override
|
|
|
public Pagination<outOrderDunListBo> dunOrderNewList(String name, String orderNo,String contractNo, String starTime, String endTime,
|
|
|
@@ -822,8 +798,6 @@ public class OrderNewServiceImpl extends BaseMybatisDao<TOrderNewMapper> impleme
|
|
|
return p;
|
|
|
}
|
|
|
|
|
|
-
|
|
|
-
|
|
|
@Override
|
|
|
public int createDunLog( String dunId, String dumTime, String remarks, String attUrl) {
|
|
|
TDunLog d=new TDunLog();
|
|
|
@@ -841,15 +815,11 @@ public class OrderNewServiceImpl extends BaseMybatisDao<TOrderNewMapper> impleme
|
|
|
return tDunLogMapper.insertSelective(d);
|
|
|
}
|
|
|
|
|
|
-
|
|
|
-
|
|
|
@Override
|
|
|
public List<TDunLogListBo> selectDunLogList(String dunId) {
|
|
|
return tDunLogMapper.selectByDunId(dunId);
|
|
|
}
|
|
|
|
|
|
-
|
|
|
-
|
|
|
@Override
|
|
|
public int addOrderRefund(TOrderRefundWithBLOBs t) {
|
|
|
TOrderNew order =checkDeleteSign(t.getOrderNo());
|
|
|
@@ -860,7 +830,7 @@ public class OrderNewServiceImpl extends BaseMybatisDao<TOrderNewMapper> impleme
|
|
|
//t.setAccept("1");
|
|
|
t.setAccept(order.getFinanceId());
|
|
|
t.setResult("");
|
|
|
- TOrderNew tOrder=new TOrderNew();
|
|
|
+ TOrderNew tOrder=new TOrderNew();
|
|
|
tOrder.setOrderNo(t.getOrderNo());
|
|
|
tOrder.setOrderStatus(OrderNewState.TDZ.getCode());
|
|
|
tOrderNewMapper.updateByPrimaryKeySelective(tOrder);
|
|
|
@@ -871,8 +841,6 @@ public class OrderNewServiceImpl extends BaseMybatisDao<TOrderNewMapper> impleme
|
|
|
return tOrderRefundMapper.insertSelective(t);
|
|
|
}
|
|
|
|
|
|
-
|
|
|
-
|
|
|
@Override
|
|
|
public int updateApprovalOrder(String orderNo,Integer confirm,String reason) {
|
|
|
TOrderNew t=new TOrderNew();
|
|
|
@@ -904,19 +872,15 @@ public class OrderNewServiceImpl extends BaseMybatisDao<TOrderNewMapper> impleme
|
|
|
addOrderLog(tl,reason);
|
|
|
pushGeneralSendNoticeAndEmail(aids, type,t2.getOrderNo(), TokenManager.getAdminId(),t2.getApproval());
|
|
|
//新增特批催款信息
|
|
|
-
|
|
|
+
|
|
|
return tOrderNewMapper.updateByPrimaryKeySelective(t);
|
|
|
}
|
|
|
|
|
|
-
|
|
|
-
|
|
|
@Override
|
|
|
public List<TOrderDun> selectOrderDun(String orderNo) {
|
|
|
return tOrderDunMapper.selectByOrderNoDunSubject(orderNo);
|
|
|
}
|
|
|
|
|
|
-
|
|
|
-
|
|
|
@Override
|
|
|
public boolean checkOrderMain(TOrderTask t) {
|
|
|
List<TOrderTaskBo> list=tOrderTaskMapper.selectOrderTask(t.getOrderNo());
|
|
|
@@ -935,8 +899,6 @@ public class OrderNewServiceImpl extends BaseMybatisDao<TOrderNewMapper> impleme
|
|
|
return false;
|
|
|
}
|
|
|
|
|
|
-
|
|
|
-
|
|
|
@Override
|
|
|
public boolean chekeOrderStatus(String orderNo) {
|
|
|
TOrderNew tOrder= tOrderNewMapper.selectByPrimaryKey(orderNo);
|
|
|
@@ -946,8 +908,6 @@ public class OrderNewServiceImpl extends BaseMybatisDao<TOrderNewMapper> impleme
|
|
|
return true;
|
|
|
}
|
|
|
|
|
|
-
|
|
|
-
|
|
|
@Override
|
|
|
public boolean chekeApprovalOrderStatus(String orderNo) {
|
|
|
TOrderNew tOrder= tOrderNewMapper.selectByPrimaryKey(orderNo);
|
|
|
@@ -959,8 +919,6 @@ public class OrderNewServiceImpl extends BaseMybatisDao<TOrderNewMapper> impleme
|
|
|
return false;
|
|
|
}
|
|
|
|
|
|
-
|
|
|
-
|
|
|
@Override
|
|
|
public int deleteOrderNew(String orderNo) {
|
|
|
TOrderNew t=tOrderNewMapper.selectByPrimaryKey(orderNo);
|
|
|
@@ -975,7 +933,6 @@ public class OrderNewServiceImpl extends BaseMybatisDao<TOrderNewMapper> impleme
|
|
|
return -1;
|
|
|
}
|
|
|
|
|
|
-
|
|
|
/**
|
|
|
* 将合同编号置为闲置编号
|
|
|
* @param orderNo
|
|
|
@@ -1013,7 +970,6 @@ public class OrderNewServiceImpl extends BaseMybatisDao<TOrderNewMapper> impleme
|
|
|
return false;
|
|
|
}
|
|
|
|
|
|
-
|
|
|
@SuppressWarnings("unchecked")
|
|
|
@Override
|
|
|
public Pagination<TOrderRefundBo> orderRefundList(String name, String orderNo, String starTime, String endTime, Integer specially,
|
|
|
@@ -1028,10 +984,8 @@ public class OrderNewServiceImpl extends BaseMybatisDao<TOrderNewMapper> impleme
|
|
|
if (StringUtils.isNotBlank(endTime)) params.put("endTime", endTime+" 23:59:59");
|
|
|
Pagination<TOrderRefundBo> p = (Pagination<TOrderRefundBo>)findPage("selectOrderRefundListByPage", "selectOrderRefundListCount", params, pageNo, pageSize);
|
|
|
return p;
|
|
|
-
|
|
|
- }
|
|
|
-
|
|
|
|
|
|
+ }
|
|
|
|
|
|
@Override
|
|
|
public boolean checkORderTask(String orderNo) {
|
|
|
@@ -1051,14 +1005,12 @@ public class OrderNewServiceImpl extends BaseMybatisDao<TOrderNewMapper> impleme
|
|
|
}else {
|
|
|
return false;
|
|
|
}
|
|
|
-
|
|
|
- }
|
|
|
-
|
|
|
|
|
|
+ }
|
|
|
|
|
|
/**
|
|
|
* 获取催款数据
|
|
|
- * @throws IOException
|
|
|
+ * @throws IOException
|
|
|
*/
|
|
|
@Override
|
|
|
public void exportOrderDunData(String name,String orderNo,String contractNo,String starTime,String endTime,Integer specially,String aid,String adminName,
|
|
|
@@ -1068,7 +1020,7 @@ public class OrderNewServiceImpl extends BaseMybatisDao<TOrderNewMapper> impleme
|
|
|
@SuppressWarnings("unchecked")
|
|
|
List<outOrderDunListBo> list=(List<outOrderDunListBo>) dunOrderNewList( name, orderNo, contractNo, starTime, endTime,specially,
|
|
|
aid, adminName, depId,newStatus, pageNo, pageSize).getList();
|
|
|
-
|
|
|
+
|
|
|
String[] comment = {"合同编号","订单编号","客户名称","订单负责人","订单部门","订单状态","签单金额","应收款","已收款","拨款比例","结算状态","未收款","项目状态","催收科目","催款状态","催款启动时间","签单时间"};
|
|
|
String fileName ="催款信息记录表" + new SimpleDateFormat("yyyy-MM-dd HH:mm").format(new Date()) + ".xls";
|
|
|
//type 0 变更
|
|
|
@@ -1107,20 +1059,20 @@ public class OrderNewServiceImpl extends BaseMybatisDao<TOrderNewMapper> impleme
|
|
|
}
|
|
|
}
|
|
|
//返回名称及参数
|
|
|
- response.addHeader("Content-Disposition", "attachment;filename=" + new String(fileName.getBytes(),"iso-8859-1"));
|
|
|
+ response.addHeader("Content-Disposition", "attachment;filename=" + new String(fileName.getBytes(),"iso-8859-1"));
|
|
|
response.setContentType("application/octet-stream;charset=utf-8");
|
|
|
// 返回数据流
|
|
|
- wb.write(out);
|
|
|
+ wb.write(out);
|
|
|
out.flush();
|
|
|
out.close();
|
|
|
} catch (Exception e) {
|
|
|
e.printStackTrace();
|
|
|
throw new BusinessException(new Error("表格生成错误。"));
|
|
|
}finally {
|
|
|
- out.flush();
|
|
|
- out.close();
|
|
|
+ out.flush();
|
|
|
+ out.close();
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
}
|
|
|
|
|
|
private String bigToString (BigDecimal o){
|
|
|
@@ -1130,8 +1082,6 @@ public class OrderNewServiceImpl extends BaseMybatisDao<TOrderNewMapper> impleme
|
|
|
}
|
|
|
}
|
|
|
|
|
|
-
|
|
|
-
|
|
|
@Override
|
|
|
public int updateOrderOver(String orderNo) {
|
|
|
TOrderNew t=tOrderNewMapper.selectByPrimaryKey(orderNo);
|
|
|
@@ -1149,22 +1099,18 @@ public class OrderNewServiceImpl extends BaseMybatisDao<TOrderNewMapper> impleme
|
|
|
t.setSettlementTime(new Date());
|
|
|
return tOrderNewMapper.updateByPrimaryKeySelective(t);
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
@Override
|
|
|
public OrderRefundDetailBo orderRefundDetail(String id) {
|
|
|
return tOrderNewMapper.orderRefundDetail(id);
|
|
|
}
|
|
|
|
|
|
-
|
|
|
-
|
|
|
@Override
|
|
|
public int updateOrderRefund(TOrderRefundWithBLOBs t) {
|
|
|
checkDeleteSign(t.getOrderNo());
|
|
|
return tOrderRefundMapper.updateByPrimaryKeySelective(t);
|
|
|
}
|
|
|
|
|
|
-
|
|
|
-
|
|
|
@Override
|
|
|
public int updatetechnicianBackOrder(String orderNo,String reason) {
|
|
|
TOrderNew t = checkDeleteSign(orderNo);
|
|
|
@@ -1181,30 +1127,22 @@ public class OrderNewServiceImpl extends BaseMybatisDao<TOrderNewMapper> impleme
|
|
|
return tOrderNewMapper.updateByPrimaryKeySelective(t);
|
|
|
}
|
|
|
|
|
|
-
|
|
|
-
|
|
|
private TOrderNew checkDeleteSign(String orderNo) {
|
|
|
TOrderNew t=tOrderNewMapper.selectByPrimaryKey(orderNo);
|
|
|
//if(t.getDeleteSign()==2) throw new BusinessException(new Error(ErrorConstants.ORDER_ALREADY_REVOKE, t.getOrderNo(),""));
|
|
|
return t;
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
@Override
|
|
|
public List<OrderDunTaskBo> selectAllOrderDun() {
|
|
|
return tOrderDunMapper.getTaskAllOrderDun();
|
|
|
}
|
|
|
|
|
|
-
|
|
|
-
|
|
|
@Override
|
|
|
public void updateOrderDun(TOrderDun tDun) {
|
|
|
tOrderDunMapper.updateByPrimaryKeySelective(tDun);
|
|
|
}
|
|
|
-
|
|
|
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
@Override
|
|
|
public void addNoticAndSendEmail(String orderNo,OrderDunTaskBo t,Integer type)
|
|
|
throws UnsupportedEncodingException, MessagingException {
|
|
|
@@ -1215,9 +1153,10 @@ public class OrderNewServiceImpl extends BaseMybatisDao<TOrderNewMapper> impleme
|
|
|
if (type==NoticeStatus.ORDER_APPROVA_NO.getCode()) id=TokenManager.getAdminId()==null?"1":TokenManager.getAdminId();
|
|
|
AdminListBo a = adminMapper.getDeptNameByAid(id);
|
|
|
sendEmail( t==null?null:t.getId(), a, b);
|
|
|
-
|
|
|
+
|
|
|
addNotic(type,a, b);
|
|
|
}
|
|
|
+
|
|
|
public void addNotic(Integer type,AdminListBo a,TOrderNewBo b) {
|
|
|
StringBuffer sb=new StringBuffer();
|
|
|
sb=sb.append(b.getUserName()).append(", 合同编号-").append(b.getContractNo())
|
|
|
@@ -1230,7 +1169,8 @@ public class OrderNewServiceImpl extends BaseMybatisDao<TOrderNewMapper> impleme
|
|
|
n.setReaded(0);//未读
|
|
|
asyncUtils.addNotice(n);
|
|
|
}
|
|
|
- public void sendEmail(String dunId,AdminListBo a,TOrderNewBo b) throws UnsupportedEncodingException, MessagingException{
|
|
|
+
|
|
|
+ public void sendEmail(String dunId,AdminListBo a,TOrderNewBo b){
|
|
|
LoggerUtils.debug(logger, "======================邮件信息发送===================");
|
|
|
String content = "<div>客户名称: "+ b.getUserName() +"</div><div>订单编号: " + b.getOrderNo() + "</div><div>合同编号: " + b.getContractNo() + "</div>";
|
|
|
String tite="订单驳回";
|
|
|
@@ -1249,7 +1189,6 @@ public class OrderNewServiceImpl extends BaseMybatisDao<TOrderNewMapper> impleme
|
|
|
LoggerUtils.debug(logger, "=========================================发送邮件成功");
|
|
|
}
|
|
|
|
|
|
-
|
|
|
@Override
|
|
|
public int updateFinance(String orderNo, String newFinance) {
|
|
|
String aid=TokenManager.getAdminId();
|
|
|
@@ -1264,10 +1203,6 @@ public class OrderNewServiceImpl extends BaseMybatisDao<TOrderNewMapper> impleme
|
|
|
return tOrderLogMapper.selectOrderByNo(orderNo);
|
|
|
}
|
|
|
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
public void pushGeneralSendNoticeAndEmail(List<String> alist, Integer type,String orderNo,String adminId,Integer approval) {
|
|
|
AdminListBo a = adminMapper.getDeptNameByAid(adminId);
|
|
|
String approvalType="";
|
|
|
@@ -1300,13 +1235,6 @@ public class OrderNewServiceImpl extends BaseMybatisDao<TOrderNewMapper> impleme
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
|
|
|
@Override
|
|
|
@Transactional
|
|
|
@@ -1358,7 +1286,7 @@ public class OrderNewServiceImpl extends BaseMybatisDao<TOrderNewMapper> impleme
|
|
|
|
|
|
/**
|
|
|
* 发起外包时,通过计算获取项目的成本,订单的成本
|
|
|
- *
|
|
|
+ *
|
|
|
* @param tid 项目编号
|
|
|
* @param type 0外包 1供应商
|
|
|
*/
|
|
|
@@ -1393,6 +1321,8 @@ public class OrderNewServiceImpl extends BaseMybatisDao<TOrderNewMapper> impleme
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
+ @Cacheable(cacheNames = "statisticsList#500",key = "'statisticsList:depId:'+#in.depId+'province:'+#in.province+" +
|
|
|
+ "'startCreate:'+#in.startCreate+'endCreate:'+#in.endCreate+'startSign:'+#in.startSign+'endSign:'+#in.endSign+'sort:'+#in.sort")
|
|
|
public List<outStatisticsList> statisticsList(InputStatistics in) {
|
|
|
if(in.getSort()==null)in.setSort(0);
|
|
|
if(in.getEndCreate()!=null)in.setEndCreate(in.getEndCreate()+" 23:59:59");
|
|
|
@@ -1401,6 +1331,8 @@ public class OrderNewServiceImpl extends BaseMybatisDao<TOrderNewMapper> impleme
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
+ @Cacheable(cacheNames = "provinceStatisticsList#500",key = "'statisticsList:depId:'+#in.depId+'province:'+#in.province+" +
|
|
|
+ "'startCreate:'+#in.startCreate+'endCreate:'+#in.endCreate+'startSign:'+#in.startSign+'endSign:'+#in.endSign+'sort:'+#in.sort")
|
|
|
public List<outProvinceStatisticsList> provinceStatisticsList(InputStatistics in) {
|
|
|
if(in.getSort()==null)in.setSort(0);
|
|
|
if(in.getEndCreate()!=null)in.setEndCreate(in.getEndCreate()+" 23:59:59");
|
|
|
@@ -1442,8 +1374,6 @@ public class OrderNewServiceImpl extends BaseMybatisDao<TOrderNewMapper> impleme
|
|
|
return p;
|
|
|
}
|
|
|
|
|
|
-
|
|
|
-
|
|
|
@Override
|
|
|
public boolean checkOfficialType(TOrderOutsource o) {
|
|
|
TOrderTaskDetailBo t=tOrderTaskMapper.getOrderTaskDetail(o.getTid().toString());
|
|
|
@@ -1457,18 +1387,4 @@ public class OrderNewServiceImpl extends BaseMybatisDao<TOrderNewMapper> impleme
|
|
|
}
|
|
|
return false;
|
|
|
}
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
}
|