中扬CRM客户关系管理系统
Junjie
2023-11-10 578c84810e978be343ef93f214da91c27917eef1
src/main/java/com/zy/crm/manager/task/handler/CstmrCopyHandler.java
@@ -6,6 +6,7 @@
import com.zy.crm.manager.controller.CstmrController;
import com.zy.crm.manager.entity.Cstmr;
import com.zy.crm.manager.mapper.CstmrMapper;
import com.zy.crm.manager.service.CompanyMoneyService;
import com.zy.crm.manager.service.CstmrService;
import com.zy.crm.manager.task.AbstractHandler;
import com.zy.crm.manager.task.core.ReturnT;
@@ -32,25 +33,33 @@
    private CstmrController cstmrController;
    @Autowired
    private CstmrMapper cstmrMapper;
    @Autowired
    private CompanyMoneyService companyMoneyService;
    @Transactional
    public ReturnT<String> start() {
        try {
            Long hostId = 1L;
            if (false){
                Long hostId = 1L;
//            List<Cstmr> cstmrs = cstmrMapper.selectCopyList();
            List<Cstmr> cstmrs = new ArrayList<>();
            for (Cstmr cstmr33 : cstmrs){
                Cstmr cstmr13 = cstmrService.selectByName(hostId,cstmr33.getName());
                if (Cools.isEmpty(cstmr13)){
                    Cstmr cstmr23 = cstmrService.selectById(186);
                    Cstmr cstmr = new Cstmr(cstmr23);
                    cstmr.setName(cstmr33.getName());
                    cstmr.setUuid(cstmrService.getUuid(hostId));
                    cstmrService.insert(cstmr);
                List<Cstmr> cstmrs = new ArrayList<>();
                for (Cstmr cstmr33 : cstmrs){
                    Cstmr cstmr13 = cstmrService.selectByName(hostId,cstmr33.getName());
                    if (Cools.isEmpty(cstmr13)){
                        Cstmr cstmr23 = cstmrService.selectById(186);
                        Cstmr cstmr = new Cstmr(cstmr23);
                        cstmr.setName(cstmr33.getName());
                        cstmr.setUuid(cstmrService.getUuid(hostId));
                        cstmrService.insert(cstmr);
                    }
                }
            }
            if (true){
            }
        } catch (Exception e) {
            log.error("fail", e);