|
@@ -31,6 +31,7 @@ import com.goafanti.common.utils.StringUtils;
|
|
|
import groovy.transform.Synchronized;
|
|
import groovy.transform.Synchronized;
|
|
|
import org.slf4j.Logger;
|
|
import org.slf4j.Logger;
|
|
|
import org.slf4j.LoggerFactory;
|
|
import org.slf4j.LoggerFactory;
|
|
|
|
|
+import org.springframework.beans.BeanUtils;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.beans.factory.annotation.Value;
|
|
import org.springframework.beans.factory.annotation.Value;
|
|
|
import org.springframework.cache.annotation.Cacheable;
|
|
import org.springframework.cache.annotation.Cacheable;
|
|
@@ -194,10 +195,39 @@ public class OrderNewServiceImpl extends BaseMybatisDao<TOrderNewMapper> impleme
|
|
|
if(t.getCommodityPrice()!=null) {
|
|
if(t.getCommodityPrice()!=null) {
|
|
|
order.setTotalAmount(order.getTotalAmount());
|
|
order.setTotalAmount(order.getTotalAmount());
|
|
|
}
|
|
}
|
|
|
|
|
+ addTTaskMember(t, order);
|
|
|
|
|
+ //如果是会员添加同性质不同项目
|
|
|
|
|
+ BusinessProject bp=businessProjectMapper.selectByPrimaryKey(t.getCommodityId());
|
|
|
|
|
+ if (bp.getType()==ProjectType.HY.getCode()){
|
|
|
|
|
+ InputAddTask t2=new InputAddTask();
|
|
|
|
|
+ BeanUtils.copyProperties(t,t2);
|
|
|
|
|
+ //会员项目替换
|
|
|
|
|
+ if (t.getCommodityName().contains("财税")){
|
|
|
|
|
+ String t2Name=t.getCommodityName().replaceAll("财税","技术");
|
|
|
|
|
+ BusinessProject bp2=businessProjectMapper.selectByPrimaryBname(t2Name);
|
|
|
|
|
+ if (bp2==null)return t;
|
|
|
|
|
+ t2.setCommodityId(bp2.getId());
|
|
|
|
|
+ t2.setCommodityName(bp2.getBname());
|
|
|
|
|
+ }else if (t.getCommodityName().contains("技术")){
|
|
|
|
|
+ String t2Name=t.getCommodityName().replaceAll("技术","财税");
|
|
|
|
|
+ BusinessProject bp2=businessProjectMapper.selectByPrimaryBname(t2Name);
|
|
|
|
|
+ if (bp2==null)return t;
|
|
|
|
|
+ t2.setCommodityId(bp2.getId());
|
|
|
|
|
+ t2.setCommodityName(bp2.getBname());
|
|
|
|
|
+ }
|
|
|
|
|
+ t2.setMain(0);
|
|
|
|
|
+ t2.setCommodityPrice(new BigDecimal(0));
|
|
|
|
|
+ t2.setId(null);
|
|
|
|
|
+ addTTaskMember(t2, order);
|
|
|
|
|
+ }
|
|
|
|
|
+ return t;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ private void addTTaskMember(InputAddTask t, TOrderNew order) {
|
|
|
String str=tOrderTaskMapper.selectByidGetCname(t.getCommodityId());
|
|
String str=tOrderTaskMapper.selectByidGetCname(t.getCommodityId());
|
|
|
t.setCname(str);
|
|
t.setCname(str);
|
|
|
tOrderTaskMapper.insertSelective(t);
|
|
tOrderTaskMapper.insertSelective(t);
|
|
|
- if (t.getServiceLife()!=null||t.getServiceYear()!=null||t.getYearSum()!=null||t.getContractTerm()!=null){
|
|
|
|
|
|
|
+ if (t.getServiceLife()!=null|| t.getServiceYear()!=null|| t.getYearSum()!=null|| t.getContractTerm()!=null){
|
|
|
TTaskMember ttm=new TTaskMember();
|
|
TTaskMember ttm=new TTaskMember();
|
|
|
ttm.setTid(t.getId());
|
|
ttm.setTid(t.getId());
|
|
|
if(t.getServiceLife()!=null)ttm.setServiceLife(t.getServiceLife());
|
|
if(t.getServiceLife()!=null)ttm.setServiceLife(t.getServiceLife());
|
|
@@ -206,9 +236,9 @@ public class OrderNewServiceImpl extends BaseMybatisDao<TOrderNewMapper> impleme
|
|
|
if(t.getContractTerm()!=null)ttm.setContractTerm(t.getContractTerm());
|
|
if(t.getContractTerm()!=null)ttm.setContractTerm(t.getContractTerm());
|
|
|
tTaskMemberMapper.insertSelective(ttm);
|
|
tTaskMemberMapper.insertSelective(ttm);
|
|
|
}
|
|
}
|
|
|
- addTaskMid(t.getId(),t.getCommodityId(), order.getOrderNo());
|
|
|
|
|
- return t;
|
|
|
|
|
|
|
+ addTaskMid(t.getId(), t.getCommodityId(), order.getOrderNo());
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
@Override
|
|
@Override
|
|
|
public int addTaskMid(Integer id,String commodityId, String orderNo) {
|
|
public int addTaskMid(Integer id,String commodityId, String orderNo) {
|
|
|
TTaskMid tm=new TTaskMid();
|
|
TTaskMid tm=new TTaskMid();
|