|
@@ -7,14 +7,8 @@ import com.huiju.estateagents.base.BaseController;
|
7
|
7
|
import com.huiju.estateagents.base.ResponseBean;
|
8
|
8
|
import com.huiju.estateagents.common.CommConstant;
|
9
|
9
|
import com.huiju.estateagents.common.StringUtils;
|
10
|
|
-import com.huiju.estateagents.sample.entity.TaContact;
|
11
|
|
-import com.huiju.estateagents.sample.entity.TaH5Demand;
|
12
|
|
-import com.huiju.estateagents.sample.entity.TaH5Sample;
|
13
|
|
-import com.huiju.estateagents.sample.entity.TaSampleContact;
|
14
|
|
-import com.huiju.estateagents.sample.service.ITaContactService;
|
15
|
|
-import com.huiju.estateagents.sample.service.ITaH5DemandService;
|
16
|
|
-import com.huiju.estateagents.sample.service.ITaH5SampleService;
|
17
|
|
-import com.huiju.estateagents.sample.service.ITaSampleContactService;
|
|
10
|
+import com.huiju.estateagents.sample.entity.*;
|
|
11
|
+import com.huiju.estateagents.sample.service.*;
|
18
|
12
|
import org.slf4j.Logger;
|
19
|
13
|
import org.slf4j.LoggerFactory;
|
20
|
14
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
@@ -52,6 +46,9 @@ public class TaH5SampleController extends BaseController {
|
52
|
46
|
@Autowired
|
53
|
47
|
public ITaH5DemandService iTaH5DemandService;
|
54
|
48
|
|
|
49
|
+ @Autowired
|
|
50
|
+ public ITaNoticeService taNoticeService;
|
|
51
|
+
|
55
|
52
|
/**
|
56
|
53
|
* 分页查询列表
|
57
|
54
|
*
|
|
@@ -359,6 +356,28 @@ public class TaH5SampleController extends BaseController {
|
359
|
356
|
taSampleContact.setSampleId(taH5Sample.getSampleId());
|
360
|
357
|
iTaSampleContactService.save(taSampleContact);
|
361
|
358
|
});
|
|
359
|
+ //更新需求单中的样例名
|
|
360
|
+ QueryWrapper<TaH5Demand> taH5DemandQueryWrapper = new QueryWrapper<>();
|
|
361
|
+ taH5DemandQueryWrapper.eq("sample_id",id);
|
|
362
|
+ List<TaH5Demand> demandList = iTaH5DemandService.list(taH5DemandQueryWrapper);
|
|
363
|
+ if (demandList.size() > 0){
|
|
364
|
+ demandList.forEach(e -> {
|
|
365
|
+ e.setSampleName(taH5Sample.getSampleName());
|
|
366
|
+ });
|
|
367
|
+ iTaH5DemandService.updateBatchById(demandList);
|
|
368
|
+ }
|
|
369
|
+ //更新通知中的样例名
|
|
370
|
+ QueryWrapper<TaNotice> taNoticeQueryWrapper = new QueryWrapper<>();
|
|
371
|
+ taNoticeQueryWrapper.eq("target_id",id);
|
|
372
|
+ taNoticeQueryWrapper.eq("target_type",CommConstant.NOTICE_TYPE_H5);
|
|
373
|
+ List<TaNotice> noticeList = taNoticeService.list(taNoticeQueryWrapper);
|
|
374
|
+ if (noticeList.size() > 0){
|
|
375
|
+ noticeList.forEach(e -> {
|
|
376
|
+ e.setTargetName(taH5Sample.getSampleName());
|
|
377
|
+ });
|
|
378
|
+ taNoticeService.updateBatchById(noticeList);
|
|
379
|
+ }
|
|
380
|
+
|
362
|
381
|
responseBean.addSuccess(taH5Sample);
|
363
|
382
|
} else {
|
364
|
383
|
responseBean.addError("fail");
|