|
|
@@ -247,38 +247,51 @@ public class OrderNewServiceImpl extends BaseMybatisDao<TOrderNewMapper> impleme
|
|
|
InputAddTask t2=new InputAddTask();
|
|
|
BeanUtils.copyProperties(t,t2);
|
|
|
if (bp.getProjectType().equals(NewProjectTypeEnum.HT.getCode())){
|
|
|
- //会员项目替换
|
|
|
- List<BusinessProjectBo> additionalDeductionList = businessProjectMapper.selectByFirstBName(null, 1);
|
|
|
- for (BusinessProjectBo e : additionalDeductionList) {
|
|
|
- if (!e.getId().equals(t.getCommodityId())) {
|
|
|
- t2.setCommodityId(e.getId());
|
|
|
- t2.setCommodityName(e.getBname());
|
|
|
- t2.setMain(0);
|
|
|
- t2.setCommodityPrice(new BigDecimal(0));
|
|
|
- t2.setId(null);
|
|
|
- addTTaskMember(t2);
|
|
|
- addTaskMid(t2);
|
|
|
- }
|
|
|
+ //先新增子项会员
|
|
|
+ addSonProject(t);
|
|
|
+ //会员项目替换
|
|
|
+ addFinanceOrTechnology(t2,1);
|
|
|
|
|
|
- }
|
|
|
- }
|
|
|
- if (bp.getProjectType().equals(NewProjectTypeEnum.SIMPLE.getCode())){
|
|
|
- List<BusinessProjectBo> list = businessProjectMapper.selectByFirstBName("简单会员", 2);
|
|
|
- for (BusinessProjectBo e : list) {
|
|
|
- if(!e.getId().equals(t.getCommodityId())){
|
|
|
- t2.setCommodityId(e.getId());
|
|
|
- t2.setCommodityName(e.getBname());
|
|
|
- t2.setMain(0);
|
|
|
- t2.setCommodityPrice(new BigDecimal(0));
|
|
|
- t2.setId(null);
|
|
|
- addTTaskMember(t2);
|
|
|
- addTaskMid(t2);
|
|
|
- }
|
|
|
- }
|
|
|
}
|
|
|
return t;
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ *
|
|
|
+ * @param t2 项目情况
|
|
|
+ * @param type 1=标准会员,2=简单会员
|
|
|
+ */
|
|
|
+ private void addFinanceOrTechnology(InputAddTask t2, Integer type) {
|
|
|
+ List<BusinessProjectBo> additionalDeductionList = businessProjectMapper.selectByFirstBName(null, type);
|
|
|
+ for (BusinessProjectBo e : additionalDeductionList) {
|
|
|
+ if (!e.getId().equals(t2.getCommodityId())) {
|
|
|
+ t2.setCommodityId(e.getId());
|
|
|
+ t2.setCommodityName(e.getBname());
|
|
|
+ t2.setMain(0);
|
|
|
+ t2.setCommodityPrice(new BigDecimal(0));
|
|
|
+ t2.setId(null);
|
|
|
+ addTTaskMember(t2);
|
|
|
+ addTaskMid(t2);
|
|
|
+ addSonProject(t2);
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ private void addSonProject(InputAddTask t) {
|
|
|
+ List<InputAddTask> sonList = t.getSonList();
|
|
|
+ for (InputAddTask e : sonList) {
|
|
|
+ InputSonProject sonProject= new InputSonProject();
|
|
|
+ sonProject.setTid(t.getId());
|
|
|
+ sonProject.setServiceYear(t.getServiceYear());
|
|
|
+ sonProject.setTaskComment(t.getTaskComment());
|
|
|
+ sonProject.setHtMember(e.getHtMember());
|
|
|
+ sonProject.setAdditionalDeduction(e.getAdditionalDeduction());
|
|
|
+ sonProject.setRdAwardsubsidy(e.getRdAwardsubsidy());
|
|
|
+ orderProjectService.addMemberSonProject(sonProject);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
private void addTTaskMember(InputAddTask t) {
|
|
|
String str=tOrderTaskMapper.selectByidGetCname(t.getCommodityId());
|
|
|
t.setCname(str);
|