| | |
| | | package com.ltkj.hosp.service.impl; |
| | | |
| | | import cn.hutool.core.date.DateTime; |
| | | import cn.hutool.core.date.DateUtil; |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.ltkj.common.core.domain.AjaxResult; |
| | | import com.ltkj.common.core.domain.entity.SysUser; |
| | | import com.ltkj.common.core.redis.RedisCache; |
| | | import com.ltkj.common.utils.SecurityUtils; |
| | | import com.ltkj.common.utils.StringUtils; |
| | | import com.ltkj.hosp.domain.*; |
| | | import com.ltkj.hosp.service.*; |
| | | import com.ltkj.hosp.vodomain.AddNewReservationConfirm; |
| | | import com.ltkj.hosp.vodomain.QjDomainVo; |
| | | import com.ltkj.mall.mallOrderUtils.TjConstants; |
| | | import org.bouncycastle.util.io.pem.PemObject; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.scheduling.annotation.Async; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.math.BigDecimal; |
| | | import java.math.RoundingMode; |
| | | import java.nio.charset.StandardCharsets; |
| | | import java.util.*; |
| | | import java.util.concurrent.ExecutorService; |
| | | import java.util.concurrent.Executors; |
| | | import java.util.regex.Matcher; |
| | | import java.util.regex.Pattern; |
| | | import java.util.stream.Collectors; |
| | | |
| | | /** |
| | | * @Company: 西安路泰科技有限公司 |
| | | * @Author: zjh |
| | | * @Date: 2023/3/29 17:28 |
| | | */ |
| | | @Service |
| | | @Transactional |
| | | public class TjAsyncServiceImpl implements TjAsyncService { |
| | | @Resource |
| | | private ITjProjectService projectService; |
| | | @Resource |
| | | private ITjCustomerService tjCustomerService; |
| | | @Resource |
| | | private ITbTransitionService transitionService; |
| | | @Resource |
| | | private ITjOrderDetailService tjOrderDetailService; |
| | | @Resource |
| | | private ITjOrderRemarkService orderRemarkService; |
| | | @Resource |
| | | private ITjChargingStandardService chargingStandardService; |
| | | @Resource |
| | | private TjProConsumablesService proConsumablesService; |
| | | @Resource |
| | | private ITjConsumablesService consumablesService; |
| | | @Resource |
| | | private ITjDiscardInspectionService discardInspectionService; |
| | | @Resource |
| | | private ITjPackageService tjPackageService; |
| | | @Resource |
| | | private RedisCache redisCache; |
| | | @Resource |
| | | private ITjOrderService orderService; |
| | | @Resource |
| | | private IDictCompService compService; |
| | | @Resource |
| | | private ITjSamplingService samplingService; |
| | | @Resource |
| | | private ITjSamplingService tjSamplingService; |
| | | @Resource |
| | | private ITjPackageProjectService ppservice; |
| | | @Resource |
| | | private TjYqOrderService yqOrderService; |
| | | @Autowired |
| | | private ITjAskMedicalHistoryService tjAskMedicalHistoryService; |
| | | @Autowired |
| | | private ITjGroupingProService groupingProService; |
| | | |
| | | @Override |
| | | public void newSaveextracted(TjOrder tjOrder, TjCustomer tjCustomer, BigDecimal discount, SysUser sysUser, TjReservation tjReservation, TjFlowingWater tjFlowingWater) { |
| | | long l = System.currentTimeMillis(); |
| | | |
| | | LambdaQueryWrapper<TjAskMedicalHistory> wq=new LambdaQueryWrapper<>(); |
| | | wq.eq(TjAskMedicalHistory::getCusId,tjCustomer.getCusId()); |
| | | wq.isNull(TjAskMedicalHistory::getTjNum); |
| | | TjAskMedicalHistory history = tjAskMedicalHistoryService.getOne(wq); |
| | | if(null !=history){ |
| | | history.setTjNum(tjOrder.getTjNumber()); |
| | | tjAskMedicalHistoryService.updateById(history); |
| | | } |
| | | |
| | | List<TbTransition> tbTransitionList =null; |
| | | if (redisCache.hasKey(tjCustomer.getCusIdcard())) { |
| | | tbTransitionList = redisCache.getCacheList(tjCustomer.getCusIdcard()); |
| | | redisCache.deleteObject(tjCustomer.getCusIdcard()); |
| | | }else { |
| | | LambdaQueryWrapper<TbTransition> wqq = new LambdaQueryWrapper<>(); |
| | | wqq.eq(TbTransition::getCusId, tjCustomer.getCusIdcard()); |
| | | tbTransitionList = transitionService.list(wqq); |
| | | } |
| | | if (redisCache.hasKey(tjCustomer.getCusIdcard() + "cusId")) |
| | | redisCache.deleteObject(tjCustomer.getCusIdcard() + "cusId"); |
| | | if (null != tbTransitionList && tbTransitionList.size() > 0) { |
| | | |
| | | tjOrderDetailService.saveTjOrderDetailsByCusId(tjCustomer.getCusIdcard(),String.valueOf(tjOrder.getOrderId()),sysUser.getNickName(),String.valueOf(sysUser.getUserId())); |
| | | |
| | | //修改每项的原价现价 |
| | | for (TbTransition transition : tbTransitionList) { |
| | | transition.setOrdPrice(transition.getNowPrice()); |
| | | transition.setNowPrice(transition.getNowPrice().multiply(discount)); |
| | | transitionService.updateById(transition); |
| | | } |
| | | } |
| | | LambdaQueryWrapper<TjOrderDetail> wrapper1 = new LambdaQueryWrapper<>(); |
| | | wrapper1.eq(TjOrderDetail::getOrderId, tjOrder.getOrderId()); |
| | | List<TjOrderDetail> list = tjOrderDetailService.list(wrapper1); |
| | | if (list != null && list.size()>0) { |
| | | for (TjOrderDetail tjOrderDetail : list) { |
| | | TjProject tjProject = projectService.getById(tjOrderDetail.getProId()); |
| | | if(tjProject==null){ |
| | | continue; |
| | | } |
| | | tjOrderDetail.setProject(tjProject); |
| | | if (tjProject.getProParentId() == 0) { |
| | | TjOrderRemark tjOrderRemark = new TjOrderRemark(); |
| | | tjOrderRemark.setProId(tjProject.getProId()); |
| | | tjOrderRemark.setProName(tjProject.getProName()); |
| | | tjOrderRemark.setDeptId(tjProject.getDeptId()); |
| | | tjOrderRemark.setTjNumber(tjOrder.getTjNumber()); |
| | | tjOrderRemark.setCreateBy(sysUser.getNickName()); |
| | | tjOrderRemark.setCreateTime(new Date()); |
| | | tjOrderRemark.setUpdateBy(sysUser.getNickName()); |
| | | tjOrderRemark.setUpdateTime(new Date()); |
| | | tjOrderRemark.setCreateId(String.valueOf(sysUser.getUserId())); |
| | | tjOrderRemark.setUpdateId(String.valueOf(sysUser.getUserId())); |
| | | orderRemarkService.save(tjOrderRemark); |
| | | } |
| | | if ("1".equals(tjOrder.getTjType())) { |
| | | if (null != tjReservation && tjReservation.getPayType() == 1) { |
| | | tjOrderDetail.setFlowingWaterId(String.valueOf(tjFlowingWater.getTjSerialNumber())); |
| | | } |
| | | } |
| | | if(tjFlowingWater.getPayStasus()==1){ |
| | | tjOrderDetail.setFlowingWaterId(String.valueOf(tjFlowingWater.getTjSerialNumber())); |
| | | } |
| | | tjOrderDetailService.updateById(tjOrderDetail); |
| | | } |
| | | } |
| | | System.out.println("这段代码时间"+(l-System.currentTimeMillis())); |
| | | } |
| | | |
| | | @Override |
| | | @Async("async") |
| | | public void ttextracted(TjOrder tjOrder, TjCustomer tjCustomer,SysUser sysUser, TjReservation tjReservation, TjFlowingWater tjFlowingWater) { |
| | | |
| | | tjAskMedicalHistoryService.updateTjAskMedicalHistoryByCusId(tjOrder.getTjNumber(),sysUser.getNickName(),String.valueOf(sysUser.getUserId()), String.valueOf(tjCustomer.getCusId())); |
| | | |
| | | boolean b = tjOrderDetailService.saveTjOrderDetailsByCusId(tjCustomer.getCusIdcard(), String.valueOf(tjOrder.getOrderId()), sysUser.getNickName(), String.valueOf(sysUser.getUserId())); |
| | | if (!b){ |
| | | List<TjGroupingPro> proList = groupingProService.list(new LambdaQueryWrapper<TjGroupingPro>().eq(TjGroupingPro::getGroupingId,tjOrder.getGroupId())); |
| | | if(null !=proList && proList.size()>0){ |
| | | for (TjGroupingPro groupingPro : proList) { |
| | | TjOrderDetail detail = new TjOrderDetail(); |
| | | // if (null != transition.getPacId()) { |
| | | // detail.setProType(String.valueOf(transition.getPacId())); |
| | | //package com.ltkj.hosp.service.impl; |
| | | // |
| | | //import cn.hutool.core.date.DateTime; |
| | | //import cn.hutool.core.date.DateUtil; |
| | | //import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | //import com.ltkj.common.core.domain.AjaxResult; |
| | | //import com.ltkj.common.core.domain.entity.SysUser; |
| | | //import com.ltkj.common.core.redis.RedisCache; |
| | | //import com.ltkj.common.utils.SecurityUtils; |
| | | //import com.ltkj.common.utils.StringUtils; |
| | | //import com.ltkj.hosp.domain.*; |
| | | //import com.ltkj.hosp.service.*; |
| | | //import com.ltkj.hosp.vodomain.AddNewReservationConfirm; |
| | | //import com.ltkj.hosp.vodomain.QjDomainVo; |
| | | //import com.ltkj.mall.mallOrderUtils.TjConstants; |
| | | //import org.bouncycastle.util.io.pem.PemObject; |
| | | //import org.springframework.beans.factory.annotation.Autowired; |
| | | //import org.springframework.scheduling.annotation.Async; |
| | | //import org.springframework.stereotype.Service; |
| | | //import org.springframework.transaction.annotation.Transactional; |
| | | // |
| | | //import javax.annotation.Resource; |
| | | //import java.math.BigDecimal; |
| | | //import java.math.RoundingMode; |
| | | //import java.nio.charset.StandardCharsets; |
| | | //import java.util.*; |
| | | //import java.util.concurrent.ExecutorService; |
| | | //import java.util.concurrent.Executors; |
| | | //import java.util.regex.Matcher; |
| | | //import java.util.regex.Pattern; |
| | | //import java.util.stream.Collectors; |
| | | // |
| | | ///** |
| | | // * @Company: 西安路泰科技有限公司 |
| | | // * @Author: zjh |
| | | // * @Date: 2023/3/29 17:28 |
| | | // */ |
| | | //@Service |
| | | //@Transactional |
| | | //public class TjAsyncServiceImpl implements TjAsyncService { |
| | | // @Resource |
| | | // private ITjProjectService projectService; |
| | | // @Resource |
| | | // private ITjCustomerService tjCustomerService; |
| | | // @Resource |
| | | // private ITbTransitionService transitionService; |
| | | // @Resource |
| | | // private ITjOrderDetailService tjOrderDetailService; |
| | | // @Resource |
| | | // private ITjOrderRemarkService orderRemarkService; |
| | | // @Resource |
| | | // private ITjChargingStandardService chargingStandardService; |
| | | // @Resource |
| | | // private TjProConsumablesService proConsumablesService; |
| | | // @Resource |
| | | // private ITjConsumablesService consumablesService; |
| | | // @Resource |
| | | // private ITjDiscardInspectionService discardInspectionService; |
| | | // @Resource |
| | | // private ITjPackageService tjPackageService; |
| | | // @Resource |
| | | // private RedisCache redisCache; |
| | | // @Resource |
| | | // private ITjOrderService orderService; |
| | | // @Resource |
| | | // private IDictCompService compService; |
| | | // @Resource |
| | | // private ITjSamplingService samplingService; |
| | | // @Resource |
| | | // private ITjSamplingService tjSamplingService; |
| | | // @Resource |
| | | // private ITjPackageProjectService ppservice; |
| | | // @Resource |
| | | // private TjYqOrderService yqOrderService; |
| | | // @Autowired |
| | | // private ITjAskMedicalHistoryService tjAskMedicalHistoryService; |
| | | // @Autowired |
| | | // private ITjGroupingProService groupingProService; |
| | | // @Resource |
| | | // private ITjStandardService tjStandardService; |
| | | // @Resource |
| | | // private ITjAdviceService tjAdviceService; |
| | | // |
| | | // |
| | | // @Override |
| | | // public void newSaveextracted(TjOrder tjOrder, TjCustomer tjCustomer, BigDecimal discount, SysUser sysUser, TjReservation tjReservation, TjFlowingWater tjFlowingWater) { |
| | | // long l = System.currentTimeMillis(); |
| | | // |
| | | // LambdaQueryWrapper<TjAskMedicalHistory> wq=new LambdaQueryWrapper<>(); |
| | | // wq.eq(TjAskMedicalHistory::getCusId,tjCustomer.getCusId()); |
| | | // wq.isNull(TjAskMedicalHistory::getTjNum); |
| | | // TjAskMedicalHistory history = tjAskMedicalHistoryService.getOne(wq); |
| | | // if(null !=history){ |
| | | // history.setTjNum(tjOrder.getTjNumber()); |
| | | // tjAskMedicalHistoryService.updateById(history); |
| | | // } |
| | | TjProject tjProject = projectService.selectTjProjectByProId(Long.valueOf(groupingPro.getProId())); |
| | | detail.setIsSampling(String.valueOf(tjProject.getIsSampling())); |
| | | detail.setOrderId(tjOrder.getOrderId()); |
| | | detail.setProId(Long.valueOf(groupingPro.getProId())); |
| | | detail.setTjStatus(0L); |
| | | detail.setCreateBy(sysUser.getNickName()); |
| | | detail.setCreateTime(new Date()); |
| | | detail.setUpdateBy(sysUser.getNickName()); |
| | | detail.setUpdateTime(new Date()); |
| | | detail.setCreateId(String.valueOf(sysUser.getUserId())); |
| | | detail.setUpdateId(String.valueOf(sysUser.getUserId())); |
| | | tjOrderDetailService.save(detail); |
| | | } |
| | | List<String> list = proList.stream().map(TjGroupingPro::getProId).collect(Collectors.toList()); |
| | | List<TjProject> projectList = projectService.list(new LambdaQueryWrapper<TjProject>().in(TjProject::getProParentId, list)); |
| | | for (TjProject project : projectList) { |
| | | TjOrderDetail detail = new TjOrderDetail(); |
| | | detail.setOrderId(tjOrder.getOrderId()); |
| | | detail.setProId(project.getProId()); |
| | | detail.setTjStatus(0L); |
| | | detail.setCreateBy(sysUser.getNickName()); |
| | | detail.setCreateTime(new Date()); |
| | | detail.setUpdateBy(sysUser.getNickName()); |
| | | detail.setUpdateTime(new Date()); |
| | | detail.setCreateId(String.valueOf(sysUser.getUserId())); |
| | | detail.setUpdateId(String.valueOf(sysUser.getUserId())); |
| | | //获取该项目的默认值赋值给结果 |
| | | if(null !=project.getProDefault()){ |
| | | detail.setProResult(project.getProDefault()); |
| | | }else { |
| | | detail.setProResult(null); |
| | | } |
| | | detail.setIsSampling(String.valueOf(project.getIsSampling())); |
| | | |
| | | tjOrderDetailService.save(detail); |
| | | } |
| | | } |
| | | } |
| | | |
| | | //添加remark表数据 |
| | | orderRemarkService.saveTjOrderRemarkByOrderId(tjOrder.getTjNumber(),sysUser.getNickName(),String.valueOf(sysUser.getUserId()), String.valueOf(tjOrder.getOrderId())); |
| | | |
| | | //判断是否交钱 |
| | | if ("1".equals(tjOrder.getTjType())) { |
| | | if (null != tjReservation && tjReservation.getPayType() == 1) { |
| | | tjOrderDetailService.updateTjOrderDetailsByOrderId(String.valueOf(tjOrder.getOrderId()), |
| | | sysUser.getNickName(), String.valueOf(sysUser.getUserId()),String.valueOf(tjFlowingWater.getTjSerialNumber())); |
| | | } |
| | | } |
| | | if (tjFlowingWater.getPayStasus() == 1) { |
| | | tjOrderDetailService.updateTjOrderDetailsByOrderId(String.valueOf(tjOrder.getOrderId()), |
| | | sysUser.getNickName(), String.valueOf(sysUser.getUserId()),String.valueOf(tjFlowingWater.getTjSerialNumber())); |
| | | } |
| | | |
| | | // List<TjOrderDetail> list = tjOrderDetailService.getTjOrderDetailsByOrderId(String.valueOf(tjOrder.getOrderId())); |
| | | // if (list != null) { |
| | | // |
| | | // List<TbTransition> tbTransitionList =null; |
| | | // if (redisCache.hasKey(tjCustomer.getCusIdcard())) { |
| | | // tbTransitionList = redisCache.getCacheList(tjCustomer.getCusIdcard()); |
| | | // redisCache.deleteObject(tjCustomer.getCusIdcard()); |
| | | // }else { |
| | | // LambdaQueryWrapper<TbTransition> wqq = new LambdaQueryWrapper<>(); |
| | | // wqq.eq(TbTransition::getCusId, tjCustomer.getCusIdcard()); |
| | | // tbTransitionList = transitionService.list(wqq); |
| | | // } |
| | | // if (redisCache.hasKey(tjCustomer.getCusIdcard() + "cusId")) |
| | | // redisCache.deleteObject(tjCustomer.getCusIdcard() + "cusId"); |
| | | // if (null != tbTransitionList && tbTransitionList.size() > 0) { |
| | | // |
| | | // tjOrderDetailService.saveTjOrderDetailsByCusId(tjCustomer.getCusIdcard(),String.valueOf(tjOrder.getOrderId()),sysUser.getNickName(),String.valueOf(sysUser.getUserId())); |
| | | // |
| | | // //修改每项的原价现价 |
| | | // for (TbTransition transition : tbTransitionList) { |
| | | // transition.setOrdPrice(transition.getNowPrice()); |
| | | // transition.setNowPrice(transition.getNowPrice().multiply(discount)); |
| | | // transitionService.updateById(transition); |
| | | // } |
| | | // } |
| | | // LambdaQueryWrapper<TjOrderDetail> wrapper1 = new LambdaQueryWrapper<>(); |
| | | // wrapper1.eq(TjOrderDetail::getOrderId, tjOrder.getOrderId()); |
| | | // List<TjOrderDetail> list = tjOrderDetailService.list(wrapper1); |
| | | // if (list != null && list.size()>0) { |
| | | // for (TjOrderDetail tjOrderDetail : list) { |
| | | // TjProject tjProject = projectService.getById(tjOrderDetail.getProId()); |
| | | // if(tjProject==null){ |
| | |
| | | // tjOrderDetailService.updateById(tjOrderDetail); |
| | | // } |
| | | // } |
| | | } |
| | | |
| | | @Override |
| | | @Async("async") |
| | | public void collectFees(TjOrder order, List<TjConsumables> list2, List<TbTransition> tbTransitionList, SysUser sysUser, String discount) { |
| | | orderRemarkService.deletedOrderRemarkByTjNum(order.getTjNumber()); |
| | | for (TbTransition transition : tbTransitionList) { |
| | | transition.setNowPrice(transition.getOrdPrice().multiply(BigDecimal.valueOf(Double.parseDouble(discount)).divide(BigDecimal.valueOf(10)))); |
| | | transitionService.updateById(transition); |
| | | TjProject tjProject = projectService.selectTjProjectByProId(transition.getProId()); |
| | | //子项 |
| | | if (null != tjProject) { |
| | | TjChargingStandard tjChargingStandard = new TjChargingStandard(); |
| | | tjChargingStandard.setTjNum(order.getTjNumber()); |
| | | tjChargingStandard.setProId(transition.getProId()); |
| | | tjChargingStandard.setPrice(transition.getNowPrice()); |
| | | tjChargingStandard.setProName(tjProject.getProName()); |
| | | tjChargingStandard.setCreateBy(sysUser.getNickName()); |
| | | tjChargingStandard.setCreateTime(new Date()); |
| | | tjChargingStandard.setUpdateBy(sysUser.getNickName()); |
| | | tjChargingStandard.setUpdateTime(new Date()); |
| | | tjChargingStandard.setCreateId(String.valueOf(sysUser.getUserId())); |
| | | tjChargingStandard.setUpdateId(String.valueOf(sysUser.getUserId())); |
| | | chargingStandardService.save(tjChargingStandard); |
| | | } |
| | | } |
| | | |
| | | //父项 |
| | | ArrayList<TbTransition> collect1 = tbTransitionList.stream().collect(Collectors.collectingAndThen(Collectors.toCollection(() -> new TreeSet<>(Comparator.comparing(TbTransition::getParentProId))), ArrayList::new)); |
| | | List<Long> parentProIds = collect1.stream().map(TbTransition::getParentProId).collect(Collectors.toList()); |
| | | if (parentProIds.size() > 0) { |
| | | for (Long parentProId : parentProIds) { |
| | | TjProject parentProject = projectService.selectTjProjectByProId(parentProId); |
| | | if (null != parentProject) { |
| | | LambdaQueryWrapper<TjProConsumables> wqqq = new LambdaQueryWrapper<>(); |
| | | wqqq.eq(TjProConsumables::getProId, parentProject.getProId()); |
| | | List<TjProConsumables> proConsumables = proConsumablesService.list(wqqq); |
| | | if (null != proConsumables && proConsumables.size() > 0) { |
| | | for (TjProConsumables tjProConsumables : proConsumables) { |
| | | TjConsumables tjConsumables = consumablesService.selectTjConsumablesById(tjProConsumables.getConsumablesId()); |
| | | list2.add(tjConsumables); |
| | | } |
| | | } |
| | | TjOrderRemark tjOrderRemark=new TjOrderRemark(); |
| | | tjOrderRemark.setProId(parentProId); |
| | | tjOrderRemark.setProName(parentProject.getProName()); |
| | | tjOrderRemark.setDeptId(parentProject.getDeptId()); |
| | | tjOrderRemark.setTjNumber(order.getTjNumber()); |
| | | tjOrderRemark.setCreateBy(sysUser.getNickName()); |
| | | tjOrderRemark.setCreateTime(new Date()); |
| | | tjOrderRemark.setUpdateBy(sysUser.getNickName()); |
| | | tjOrderRemark.setUpdateTime(new Date()); |
| | | tjOrderRemark.setCreateId(String.valueOf(sysUser.getUserId())); |
| | | tjOrderRemark.setUpdateId(String.valueOf(sysUser.getUserId())); |
| | | orderRemarkService.save(tjOrderRemark); |
| | | } |
| | | } |
| | | } |
| | | |
| | | ArrayList<TjConsumables> collect = list2.stream().collect(Collectors.collectingAndThen(Collectors.toCollection(() -> new TreeSet<>(Comparator.comparing(TjConsumables::getId))), ArrayList::new)); |
| | | for (TjConsumables tjConsumables : collect) { |
| | | TjChargingStandard tjChargingStandard = new TjChargingStandard(); |
| | | tjChargingStandard.setTjNum(order.getTjNumber()); |
| | | tjChargingStandard.setConsumablesId(tjConsumables.getId()); |
| | | tjChargingStandard.setPrice(tjConsumables.getPrice()); |
| | | tjChargingStandard.setProName(tjConsumables.getMakings()); |
| | | tjChargingStandard.setConsumablesName(tjConsumables.getMakings()); |
| | | tjChargingStandard.setCompany(tjConsumables.getSpecifications()); |
| | | tjChargingStandard.setCreateBy(sysUser.getNickName()); |
| | | tjChargingStandard.setCreateTime(new Date()); |
| | | tjChargingStandard.setUpdateBy(sysUser.getNickName()); |
| | | tjChargingStandard.setUpdateTime(new Date()); |
| | | tjChargingStandard.setCreateId(String.valueOf(sysUser.getUserId())); |
| | | tjChargingStandard.setUpdateId(String.valueOf(sysUser.getUserId())); |
| | | chargingStandardService.save(tjChargingStandard); |
| | | } |
| | | |
| | | LambdaQueryWrapper<TjOrderDetail> wq = new LambdaQueryWrapper<>(); |
| | | wq.eq(TjOrderDetail::getOrderId,order.getOrderId()); |
| | | wq.isNotNull(TjOrderDetail::getFlowingWaterId); |
| | | wq.eq(TjOrderDetail::getIsSampling,0); |
| | | List<TjOrderDetail> detailList = tjOrderDetailService.list(wq); |
| | | if(null !=detailList && detailList.size()>0){ |
| | | String format = DateUtil.format(new Date(), "yyMMddHHmmssSSS"); |
| | | for (TjOrderDetail detail : detailList) { |
| | | TjSampling sampling=new TjSampling(); |
| | | if(null==projectService.getById(detail.getProId())) continue; |
| | | Long proParentId = projectService.getById(detail.getProId()).getProParentId(); |
| | | if(null !=proParentId && proParentId ==0){ |
| | | sampling.setSpecimenType(projectService.getById(detail.getProId()).getSpecimenType()); |
| | | }else { |
| | | sampling.setSpecimenType(projectService.getById(projectService.getById(detail.getProId()).getProParentId()).getSpecimenType()); |
| | | } |
| | | sampling.setSamplingNumber(format); |
| | | sampling.setTjNum(order.getTjNumber()); |
| | | sampling.setCusId(String.valueOf(order.getUserId())); |
| | | if (tjCustomerService.getById(String.valueOf(order.getUserId()))!=null) { |
| | | sampling.setCusName(tjCustomerService.getById(String.valueOf(order.getUserId())).getCusName()); |
| | | } |
| | | sampling.setApplicationTime(new Date()); |
| | | sampling.setTjTime(order.getCreateTime()); |
| | | sampling.setProId(String.valueOf(detail.getProId())); |
| | | sampling.setProName(projectService.getById(detail.getProId()).getProName()); |
| | | sampling.setCreateBy(sysUser.getNickName()); |
| | | sampling.setCreateTime(new Date()); |
| | | sampling.setUpdateBy(sysUser.getNickName()); |
| | | sampling.setUpdateTime(new Date()); |
| | | sampling.setCreateId(String.valueOf(sysUser.getUserId())); |
| | | sampling.setUpdateId(String.valueOf(sysUser.getUserId())); |
| | | samplingService.save(sampling); |
| | | } |
| | | } |
| | | } |
| | | |
| | | @Override |
| | | @Async("async") |
| | | public void abandonCheck(String tjNumber, TjOrder tjOrder, List<TjOrderDetail> list, SysUser sysUser) { |
| | | for (TjOrderDetail tjOrderDetail : list) { |
| | | LambdaQueryWrapper<TjProject> wq1 = new LambdaQueryWrapper<>(); |
| | | wq1.eq(TjProject::getProId, tjOrderDetail.getProId()); |
| | | TjProject one = projectService.getOne(wq1); |
| | | if (one != null) { |
| | | if (one.getProParentId() != 0) { |
| | | tjOrderDetail.setTjStatus(2L); |
| | | tjOrderDetail.setProResult("弃检"); |
| | | tjOrderDetail.setUpdateTime(new DateTime()); |
| | | tjOrderDetailService.updateById(tjOrderDetail); |
| | | } else { |
| | | tjOrderDetail.setTjStatus(1L); |
| | | tjOrderDetail.setUpdateTime(new DateTime()); |
| | | tjOrderDetailService.updateById(tjOrderDetail); |
| | | } |
| | | //给弃检表添加记录 |
| | | TjDiscardInspection td = new TjDiscardInspection(); |
| | | td.setProId(String.valueOf(one.getProId())); |
| | | td.setProName(one.getProName()); |
| | | td.setCusId(String.valueOf(tjOrder.getUserId())); |
| | | td.setCusName((tjCustomerService.getById(tjOrder.getUserId())).getCusName()); |
| | | td.setRegistrationTime(tjOrder.getCreateTime()); |
| | | td.setTjNum(tjNumber); |
| | | td.setCreateBy(sysUser.getNickName()); |
| | | td.setCreateTime(new DateTime()); |
| | | td.setUpdateBy(sysUser.getNickName()); |
| | | td.setUpdateTime(new DateTime()); |
| | | td.setCreateId(String.valueOf(sysUser.getUserId())); |
| | | td.setUpdateId(String.valueOf(sysUser.getUserId())); |
| | | discardInspectionService.save(td); |
| | | } |
| | | } |
| | | } |
| | | |
| | | @Override |
| | | @Async("async") |
| | | public void updateOrdeltile(List<TjOrderDetail> tjOrderDetailList, SysUser sysUser, TjOrder order) { |
| | | for (TjOrderDetail detail : tjOrderDetailList) { |
| | | detail.setTjStatus(1L); |
| | | LambdaQueryWrapper<TjStandard> wq0 = new LambdaQueryWrapper<>(); |
| | | wq0.eq(TjStandard::getProId, detail.getProId()); |
| | | detail.setUpdateBy(sysUser.getNickName()); |
| | | detail.setUpdateTime(new Date()); |
| | | detail.setCreateId(String.valueOf(sysUser.getUserId())); |
| | | detail.setUpdateId(String.valueOf(sysUser.getUserId())); |
| | | tjOrderDetailService.updateById(detail); |
| | | } |
| | | } |
| | | |
| | | @Override |
| | | @Async("async") |
| | | public void iundividualCharges(TjFlowingWater tjFlowingWater, TjOrder order, TjCustomer customer, SysUser sysUser) { |
| | | List<TjConsumables> list2 = new ArrayList<>(); |
| | | String[] tjProIds = tjFlowingWater.getTjProIds(); |
| | | for (String tjProId : tjProIds) { |
| | | TjProject project = projectService.selectTjProjectByProId(Long.valueOf(tjProId)); |
| | | TjOrderRemark tjOrderRemark=new TjOrderRemark(); |
| | | tjOrderRemark.setProId(Long.valueOf(tjProId)); |
| | | tjOrderRemark.setProName(project.getProName()); |
| | | tjOrderRemark.setDeptId(project.getDeptId()); |
| | | tjOrderRemark.setTjNumber(order.getTjNumber()); |
| | | tjOrderRemark.setCreateBy(sysUser.getNickName()); |
| | | tjOrderRemark.setCreateTime(new Date()); |
| | | tjOrderRemark.setUpdateBy(sysUser.getNickName()); |
| | | tjOrderRemark.setUpdateTime(new Date()); |
| | | tjOrderRemark.setCreateId(String.valueOf(sysUser.getUserId())); |
| | | tjOrderRemark.setUpdateId(String.valueOf(sysUser.getUserId())); |
| | | orderRemarkService.save(tjOrderRemark); |
| | | List<Long> proIds = projectService.getTjProjectListBySoneId(tjProId).stream().map(TjProject::getProId).collect(Collectors.toList()); |
| | | TjOrderDetail detail = new TjOrderDetail(); |
| | | detail.setTjStatus(0L); |
| | | detail.setOrderId(tjFlowingWater.getOrderId()); |
| | | detail.setFlowingWaterId(String.valueOf(tjFlowingWater.getTjSerialNumber())); |
| | | detail.setProId(Long.valueOf(tjProId)); |
| | | detail.setIsAddition("Y"); |
| | | detail.setCreateBy(sysUser.getNickName()); |
| | | detail.setCreateTime(new Date()); |
| | | detail.setUpdateBy(sysUser.getNickName()); |
| | | detail.setUpdateTime(new Date()); |
| | | detail.setCreateId(String.valueOf(sysUser.getUserId())); |
| | | detail.setUpdateId(String.valueOf(sysUser.getUserId())); |
| | | tjOrderDetailService.save(detail); |
| | | for (Long proId : proIds) { |
| | | TjOrderDetail detail1 = new TjOrderDetail(); |
| | | detail1.setTjStatus(0L); |
| | | detail1.setOrderId(tjFlowingWater.getOrderId()); |
| | | detail1.setFlowingWaterId(String.valueOf(tjFlowingWater.getTjSerialNumber())); |
| | | detail1.setProId(proId); |
| | | detail1.setIsAddition("Y"); |
| | | detail.setCreateBy(sysUser.getNickName()); |
| | | detail.setCreateTime(new Date()); |
| | | detail.setUpdateBy(sysUser.getNickName()); |
| | | detail.setUpdateTime(new Date()); |
| | | detail.setCreateId(String.valueOf(sysUser.getUserId())); |
| | | detail.setUpdateId(String.valueOf(sysUser.getUserId())); |
| | | tjOrderDetailService.save(detail1); |
| | | } |
| | | LambdaQueryWrapper<TbTransition> wqq = new LambdaQueryWrapper<>(); |
| | | wqq.eq(TbTransition::getCusId, customer.getCusIdcard()); |
| | | wqq.in(TbTransition::getProId, proIds); |
| | | List<TbTransition> tbTransitionList = transitionService.list(wqq); |
| | | if (null != tbTransitionList && tbTransitionList.size() > 0) { |
| | | for (TbTransition transition : tbTransitionList) { |
| | | transition.setNowPrice(transition.getOrdPrice().multiply(BigDecimal.valueOf(Double.parseDouble(tjFlowingWater.getDiscount())).divide(BigDecimal.valueOf(10)))); |
| | | transitionService.updateById(transition); |
| | | TjProject tjProject = projectService.selectTjProjectByProId(transition.getProId()); |
| | | //子项 |
| | | if (null != tjProject) { |
| | | TjChargingStandard tjChargingStandard = new TjChargingStandard(); |
| | | tjChargingStandard.setTjNum(order.getTjNumber()); |
| | | tjChargingStandard.setProId(transition.getProId()); |
| | | tjChargingStandard.setPrice(transition.getNowPrice()); |
| | | tjChargingStandard.setProName(tjProject.getProName()); |
| | | tjChargingStandard.setCreateBy(sysUser.getNickName()); |
| | | tjChargingStandard.setCreateTime(new Date()); |
| | | tjChargingStandard.setUpdateBy(sysUser.getNickName()); |
| | | tjChargingStandard.setUpdateTime(new Date()); |
| | | tjChargingStandard.setCreateId(String.valueOf(sysUser.getUserId())); |
| | | tjChargingStandard.setUpdateId(String.valueOf(sysUser.getUserId())); |
| | | chargingStandardService.save(tjChargingStandard); |
| | | } |
| | | } |
| | | //父项 |
| | | TjProject parentProject = projectService.getById(tjProId); |
| | | if (null != parentProject) { |
| | | LambdaQueryWrapper<TjProConsumables> wqqq = new LambdaQueryWrapper<>(); |
| | | wqqq.eq(TjProConsumables::getProId, parentProject.getProId()); |
| | | List<TjProConsumables> proConsumables = proConsumablesService.list(wqqq); |
| | | if (null != proConsumables && proConsumables.size() > 0) { |
| | | for (TjProConsumables tjProConsumables : proConsumables) { |
| | | TjConsumables tjConsumables = consumablesService.selectTjConsumablesById(tjProConsumables.getConsumablesId()); |
| | | list2.add(tjConsumables); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } |
| | | //父项耗材 |
| | | ArrayList<TjConsumables> collect = list2.stream().collect(Collectors.collectingAndThen(Collectors.toCollection(() -> new TreeSet<>(Comparator.comparing(TjConsumables::getId))), ArrayList::new)); |
| | | for (TjConsumables tjConsumables : collect) { |
| | | TjChargingStandard tjChargingStandard = new TjChargingStandard(); |
| | | tjChargingStandard.setTjNum(order.getTjNumber()); |
| | | tjChargingStandard.setConsumablesId(tjConsumables.getId()); |
| | | tjChargingStandard.setPrice(tjConsumables.getPrice()); |
| | | tjChargingStandard.setProName(tjConsumables.getMakings()); |
| | | tjChargingStandard.setConsumablesName(tjConsumables.getMakings()); |
| | | tjChargingStandard.setCompany(tjConsumables.getSpecifications()); |
| | | tjChargingStandard.setCreateBy(sysUser.getNickName()); |
| | | tjChargingStandard.setCreateTime(new Date()); |
| | | tjChargingStandard.setUpdateBy(sysUser.getNickName()); |
| | | tjChargingStandard.setUpdateTime(new Date()); |
| | | tjChargingStandard.setCreateId(String.valueOf(sysUser.getUserId())); |
| | | tjChargingStandard.setUpdateId(String.valueOf(sysUser.getUserId())); |
| | | chargingStandardService.save(tjChargingStandard); |
| | | } |
| | | } |
| | | |
| | | @Override |
| | | @Async("async") |
| | | public void dockerSetCustomerLisByRedis(List<Long> ksproList, String ksId) { |
| | | List<TjCustomer> yjAjaxResult = getYjAjaxResult(ksproList); |
| | | List<TjCustomer> wjAjaxResult = getWjAjaxResult(ksproList); |
| | | redisCache.setCacheMapValue(ksId + "ks", "wj",wjAjaxResult); |
| | | redisCache.setCacheMapValue(ksId + "ks", "yj",yjAjaxResult); |
| | | } |
| | | |
| | | @Override |
| | | @Async("async") |
| | | public void checkSetCustomerLisByRedis(String config) { |
| | | List<TjCustomer> wsResult = getWsResult(config); |
| | | List<TjCustomer> ysResult = getYsResult(config); |
| | | redisCache.setCacheMapValue("check", "ws",wsResult); |
| | | redisCache.setCacheMapValue("check", "ys",ysResult); |
| | | } |
| | | |
| | | @Override |
| | | @Async("async") |
| | | public void wCScheckSetCustomerLisByRedis( List<TjOrder> orderList) { |
| | | List<TjCustomer> customerList = new ArrayList<>(); |
| | | if(null !=orderList && orderList.size()>0){ |
| | | for (TjOrder tjOrder : orderList) { |
| | | if (null != tjOrder) { |
| | | TjCustomer customer = tjCustomerService.selectTjCustomerByCusId(tjOrder.getUserId()); |
| | | if (customer == null) { |
| | | continue; |
| | | } |
| | | customer.setCusName(hideCusName(customer.getCusName())); |
| | | customer.setCusPhone(hidePhoneNum(customer.getCusPhone())); |
| | | customer.setCusIdcard(hideIdCardNum(customer.getCusIdcard())); |
| | | customer.setTjNumber(tjOrder.getTjNumber()); |
| | | customer.setTjStatus(Long.valueOf(tjOrder.getCheckStatus())); |
| | | customer.setOrderId(tjOrder.getOrderId()); |
| | | customer.setTjTime(tjOrder.getCreateTime()); |
| | | customer.setFinishTime(tjOrder.getFinishTime()); |
| | | customer.setConfirmStatus(String.valueOf(tjOrder.getStatus())); |
| | | if (tjOrder.getFirmId() == null) { |
| | | customer.setTjCompName("无"); |
| | | } else { |
| | | DictComp byId = compService.selectDictCompByDrugManufacturerId(tjOrder.getFirmId()); |
| | | if (byId != null) { |
| | | customer.setTjCompName(byId.getCnName()); |
| | | } |
| | | } |
| | | customerList.add(customer); |
| | | } |
| | | } |
| | | } |
| | | redisCache.setCacheMapValue("cScheck", "ws",customerList); |
| | | } |
| | | |
| | | @Override |
| | | @Async("async") |
| | | public void yCScheckSetCustomerLisByRedis( List<TjOrder> orderList) { |
| | | List<TjCustomer> customerList = new ArrayList<>(); |
| | | if(null !=orderList && orderList.size()>0){ |
| | | for (TjOrder tjOrder : orderList) { |
| | | if (null != tjOrder) { |
| | | TjCustomer customer = tjCustomerService.selectTjCustomerByCusId(tjOrder.getUserId()); |
| | | if (customer == null) { |
| | | continue; |
| | | } |
| | | customer.setCusName(hideCusName(customer.getCusName())); |
| | | customer.setCusPhone(hidePhoneNum(customer.getCusPhone())); |
| | | customer.setCusIdcard(hideIdCardNum(customer.getCusIdcard())); |
| | | customer.setTjNumber(tjOrder.getTjNumber()); |
| | | customer.setTjStatus(Long.valueOf(tjOrder.getCheckStatus())); |
| | | customer.setOrderId(tjOrder.getOrderId()); |
| | | customer.setTjTime(tjOrder.getCreateTime()); |
| | | customer.setFinishTime(tjOrder.getFinishTime()); |
| | | customer.setConfirmStatus(String.valueOf(tjOrder.getStatus())); |
| | | if (tjOrder.getFirmId() == null) { |
| | | customer.setTjCompName("无"); |
| | | } else { |
| | | DictComp byId = compService.selectDictCompByDrugManufacturerId(tjOrder.getFirmId()); |
| | | if (byId != null) { |
| | | customer.setTjCompName(byId.getCnName()); |
| | | } |
| | | } |
| | | customerList.add(customer); |
| | | } |
| | | } |
| | | } |
| | | redisCache.setCacheMapValue("cScheck", "ys",customerList); |
| | | } |
| | | |
| | | |
| | | @Override |
| | | @Async("async") |
| | | public void tjRefund(List<TjProject> refundPros, String tjNum) { |
| | | for (TjProject refundPro : refundPros) { |
| | | LambdaQueryWrapper<TjProject> wq0 = new LambdaQueryWrapper<>(); |
| | | wq0.eq(TjProject::getProParentId, refundPro.getProId()); |
| | | List<Long> collect = projectService.list(wq0).stream().map(TjProject::getProId).collect(Collectors.toList()); |
| | | LambdaQueryWrapper<TjSampling>wq1=new LambdaQueryWrapper<>(); |
| | | wq1.eq(TjSampling::getTjNum,tjNum); |
| | | wq1.in(TjSampling::getProId,collect); |
| | | List<TjSampling> list = samplingService.list(wq1); |
| | | if(null !=list && list.size()>0) samplingService.removeByIds(list.stream().map(TjSampling::getId).collect(Collectors.toList())); |
| | | LambdaQueryWrapper<TjSampling>wq2=new LambdaQueryWrapper<>(); |
| | | wq2.eq(TjSampling::getTjNum,tjNum); |
| | | wq2.eq(TjSampling::getProId,refundPro.getProId()); |
| | | samplingService.remove(wq2); |
| | | } |
| | | } |
| | | |
| | | @Override |
| | | @Async("async") |
| | | public void saveSampling() { |
| | | redisCache.setCacheMapValue("sampling", "yqs",getYWqsResult(0)); |
| | | redisCache.setCacheMapValue("sampling", "wqs",getYWqsResult(1)); |
| | | } |
| | | |
| | | @Override |
| | | @Async("async") |
| | | public void tjGoutAsync(List<QjDomainVo> domainVos,SysUser sysUser,Set<String> list) { |
| | | for (QjDomainVo domainVo : domainVos) { |
| | | TjOrderRemark remark = orderRemarkService.getById(domainVo.getRemarkId()); |
| | | TjOrder order = orderService.getOrderByTjNum(domainVo.getTjNumber()); |
| | | //给弃检表添加记录 |
| | | if(domainVo.getType().equals(2)){ |
| | | TjDiscardInspection td = new TjDiscardInspection(); |
| | | td.setProId(String.valueOf(remark.getProId())); |
| | | td.setProName(projectService.selectTjProjectByProId(remark.getProId()).getProName()); |
| | | td.setCusId(String.valueOf(order.getUserId())); |
| | | td.setCusName((tjCustomerService.getById(order.getUserId())).getCusName()); |
| | | td.setRegistrationTime(order.getCreateTime()); |
| | | td.setTjNum(domainVo.getTjNumber()); |
| | | td.setCreateBy(sysUser.getNickName()); |
| | | td.setCreateTime(new DateTime()); |
| | | td.setUpdateBy(sysUser.getNickName()); |
| | | td.setUpdateTime(new DateTime()); |
| | | td.setCreateId(String.valueOf(sysUser.getUserId())); |
| | | td.setUpdateId(String.valueOf(sysUser.getUserId())); |
| | | discardInspectionService.save(td); |
| | | } |
| | | |
| | | LambdaQueryWrapper<TjProject>wq1=new LambdaQueryWrapper<>(); |
| | | wq1.eq(TjProject::getProParentId,remark.getProId()); |
| | | List<TjProject> projectList = projectService.list(wq1); |
| | | if(null !=projectList && projectList.size()>0){ |
| | | List<Long> collect = projectList.stream().map(TjProject::getProId).collect(Collectors.toList()); |
| | | LambdaQueryWrapper<TjOrderDetail>wq2=new LambdaQueryWrapper<>(); |
| | | wq2.eq(TjOrderDetail::getOrderId,order.getOrderId()); |
| | | wq2.in(TjOrderDetail::getProId,collect); |
| | | List<TjOrderDetail> detailList = tjOrderDetailService.list(wq2); |
| | | if(null !=detailList && detailList.size()>0){ |
| | | for (TjOrderDetail detail : detailList) { |
| | | detail.setTjStatus(Long.valueOf(remark.getType())); |
| | | if(null !=remark.getRemark()) detail.setRemark(domainVo.getRemark()); |
| | | if(null !=remark.getYqDeadline()) detail.setYqDeadline(remark.getYqDeadline()); |
| | | tjOrderDetailService.updateById(detail); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | if (list.size() > 0) { |
| | | for (String s : list) { |
| | | TjOrder tjOrder = orderService.getOrderByTjNum(s); |
| | | if (null != tjOrder) { |
| | | tjOrder.setStatus(TjConstants.TJ_DELAY); |
| | | tjOrder.setFinishTime(null); |
| | | tjOrder.setUpdateBy(sysUser.getNickName()); |
| | | tjOrder.setUpdateTime(new DateTime()); |
| | | tjOrder.setUpdateId(String.valueOf(sysUser.getUserId())); |
| | | orderService.updateById(tjOrder); |
| | | TjCustomer customer = tjCustomerService.selectTjCustomerByCusId(tjOrder.getUserId()); |
| | | TjYqOrder yqOrder=new TjYqOrder(); |
| | | yqOrder.setTjNum(s); |
| | | yqOrder.setCusName(customer.getCusName()); |
| | | yqOrder.setSex(String.valueOf(customer.getCusSex())); |
| | | yqOrder.setAge(customer.getAge()); |
| | | yqOrder.setPhone(customer.getCusPhone()); |
| | | yqOrder.setYqTime(new Date()); |
| | | yqOrder.setOrderTime(tjOrder.getCreateTime()); |
| | | yqOrder.setProIds(orderRemarkService.getTjOrderRemarkProIdList(s)); |
| | | yqOrder.setEmilSend("0"); |
| | | yqOrder.setMsgSend("0"); |
| | | yqOrder.setCreateBy(sysUser.getNickName()); |
| | | yqOrder.setCreateTime(new DateTime()); |
| | | yqOrder.setUpdateBy(sysUser.getNickName()); |
| | | yqOrder.setUpdateTime(new DateTime()); |
| | | yqOrder.setCreateId(String.valueOf(sysUser.getUserId())); |
| | | yqOrder.setUpdateId(String.valueOf(sysUser.getUserId())); |
| | | yqOrderService.save(yqOrder); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | @Override |
| | | @Async("async") |
| | | public void addRedisTransitionPac(String cusId, Long pacId, List<TjPackageProject> ppList) { |
| | | for (TjPackageProject tjPackageProject : ppList) { |
| | | TjProject project = projectService.getById(tjPackageProject.getProId()); |
| | | if (null != project) { |
| | | BigDecimal divide = tjPackageProject.getPriceNow().divide(project.getProPrice(),5,RoundingMode.DOWN); |
| | | LambdaQueryWrapper<TjProject> wq2 = new LambdaQueryWrapper<>(); |
| | | wq2.eq(TjProject::getProParentId, project.getProId()); |
| | | List<TjProject> tjProSonList = projectService.list(wq2); |
| | | if (null != tjProSonList && tjProSonList.size() > 0) { |
| | | for (TjProject tjProject : tjProSonList) { |
| | | TbTransition tbTransition = new TbTransition(); |
| | | tbTransition.setCusId(cusId); |
| | | tbTransition.setPacId(pacId); |
| | | |
| | | if (null != tjPackageProject.getPriceNow() && divide.compareTo(BigDecimal.valueOf(0)) > 0) { |
| | | tbTransition.setNowPrice(tjProject.getProPrice().multiply(divide).setScale(2,RoundingMode.HALF_DOWN)); |
| | | tbTransition.setOrdPrice(tjProject.getProPrice().multiply(divide).setScale(2,RoundingMode.HALF_DOWN)); |
| | | } else { |
| | | tbTransition.setNowPrice(BigDecimal.valueOf(0.00)); |
| | | tbTransition.setOrdPrice(BigDecimal.valueOf(0.00)); |
| | | } |
| | | tbTransition.setParentProId(project.getProId()); |
| | | tbTransition.setParentProName(project.getProName()); |
| | | tbTransition.setProId(tjProject.getProId()); |
| | | tbTransition.setProName(tjProject.getProName()); |
| | | tbTransition.setPacName(tjPackageService.getById(tbTransition.getPacId()).getPacName()); |
| | | tbTransition.setCreateTime(new Date()); |
| | | tbTransition.setProType(tjProject.getProType()); |
| | | tbTransition.setProCheckMethod(tjProject.getProCheckMethod()); |
| | | transitionService.save(tbTransition); |
| | | } |
| | | |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | @Override |
| | | @Async("async") |
| | | public void saveRedisTransitionByPacId(String cusId, Long pacId,List<Long> proIds) { |
| | | if(null != pacId){ |
| | | transitionService.saveRedisTransitionByPacId(cusId,pacId); |
| | | } |
| | | if(null != proIds && proIds.size() > 0){ |
| | | saveRedisTransitionByProId(cusId,proIds); |
| | | } |
| | | } |
| | | |
| | | @Override |
| | | @Async("async") |
| | | public void addRedisTransitionPro(String cusId, List<Long> proIds) { |
| | | for (Long proId : proIds) { |
| | | if (null != transitionService.getTbTransitionListByCusIdAndPacIdAndProId(cusId, String.valueOf(proId)) && transitionService.getTbTransitionListByCusIdAndPacIdAndProId(cusId, String.valueOf(proId)).size() > 0) { |
| | | continue; |
| | | } |
| | | TjProject project = projectService.getById(proId); |
| | | if (null != project) { |
| | | LambdaQueryWrapper<TjProject> wq1 = new LambdaQueryWrapper<>(); |
| | | wq1.eq(TjProject::getProParentId, project.getProId()); |
| | | List<TjProject> tjProSonList = projectService.list(wq1); |
| | | if (null != tjProSonList && tjProSonList.size() > 0) { |
| | | for (TjProject tjProject : tjProSonList) { |
| | | List<TbTransition> transitionss = transitionService.getTbTransitionListByCusIdAndPacIdAndProId(cusId, String.valueOf(tjProject.getProId())); |
| | | if (null != transitionss && transitionss.size() > 0) { |
| | | continue; |
| | | } |
| | | TbTransition tbTransition = new TbTransition(); |
| | | tbTransition.setCusId(cusId); |
| | | tbTransition.setPacId(null); |
| | | if (null != tjProject.getProPrice()) { |
| | | tbTransition.setOrdPrice(tjProject.getProPrice()); |
| | | tbTransition.setNowPrice(tjProject.getProPrice()); |
| | | } else { |
| | | tbTransition.setOrdPrice(BigDecimal.valueOf(0.00)); |
| | | tbTransition.setNowPrice(BigDecimal.valueOf(0.00)); |
| | | } |
| | | tbTransition.setParentProId(proId); |
| | | tbTransition.setParentProName(project.getProName()); |
| | | tbTransition.setProId(tjProject.getProId()); |
| | | tbTransition.setProName(tjProject.getProName()); |
| | | tbTransition.setCreateTime(new Date()); |
| | | tbTransition.setProType(tjProject.getProType()); |
| | | tbTransition.setProCheckMethod(tjProject.getProCheckMethod()); |
| | | transitionService.save(tbTransition); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | @Override |
| | | @Async("async") |
| | | public void getTjPackageList() { |
| | | |
| | | //男人 |
| | | getTjPackageListsByMan(tjPackageService.getTjPackageListByMan()); |
| | | |
| | | //女人 |
| | | getTjPackageListByWoMan(tjPackageService.getTjPackageListByWoMan()); |
| | | |
| | | //未知 |
| | | getTjPackageListByManAndWoMan(tjPackageService.list(new LambdaQueryWrapper<TjPackage>().eq(TjPackage::getPacStatus,0))); |
| | | } |
| | | |
| | | @Override |
| | | @Async("async") |
| | | public void addNewReservationConfirm(List<TjReservation> rightList ) { |
| | | if(null !=rightList && rightList.size()>0){ |
| | | for (TjReservation reservation : rightList) { |
| | | transitionService.deletedTbTransitionByCusId(reservation.getIdCard()); |
| | | List<AddNewReservationConfirm> confirmList = groupingProService.getAddNewReservationConfirm(reservation.getGroupingId()); |
| | | if (null !=confirmList && confirmList.size()>0){ |
| | | for (AddNewReservationConfirm confirm : confirmList) { |
| | | List<TbTransition> transitionss = transitionService.getTbTransitionListByCusIdAndPacIdAndProId(reservation.getIdCard(),confirm.getPid()); |
| | | if (null != transitionss && transitionss.size() > 0) { |
| | | continue; |
| | | } |
| | | TbTransition tbTransition = new TbTransition(); |
| | | tbTransition.setCusId(reservation.getIdCard()); |
| | | tbTransition.setPacId(null); |
| | | if (null != confirm.getProPrice()) { |
| | | tbTransition.setOrdPrice(confirm.getProPrice()); |
| | | tbTransition.setNowPrice(confirm.getProPrice().multiply(BigDecimal.valueOf(Long.parseLong(confirm.getLimits())).divide(BigDecimal.valueOf(10)))); |
| | | } else { |
| | | tbTransition.setOrdPrice(BigDecimal.valueOf(0.00)); |
| | | tbTransition.setNowPrice(BigDecimal.valueOf(0.00)); |
| | | } |
| | | tbTransition.setParentProId(Long.valueOf(confirm.getProId())); |
| | | tbTransition.setParentProName(confirm.getProName()); |
| | | tbTransition.setProId(Long.valueOf(confirm.getPid())); |
| | | tbTransition.setProName(confirm.getPname()); |
| | | tbTransition.setCreateTime(new Date()); |
| | | transitionService.save(tbTransition); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | @Override |
| | | @Async("async") |
| | | public void saveNewReservationConfirm(List<TjReservation> rightList) { |
| | | long l = System.currentTimeMillis(); |
| | | if(null !=rightList && rightList.size()>0){ |
| | | //创建线程池 |
| | | ExecutorService threadPool = Executors.newFixedThreadPool(rightList.size()); |
| | | for (TjReservation reservation : rightList) { |
| | | //删除之前的数据 |
| | | transitionService.deletedTbTransitionByCusId(reservation.getIdCard()); |
| | | //获取线程 |
| | | threadPool.execute(new Runnable() { |
| | | @Override |
| | | public void run() { |
| | | try { |
| | | transitionService.saveTemoTransitionByGroupingId(reservation.getIdCard(),reservation.getGroupingId()); |
| | | |
| | | threadPool.shutdown(); |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | } |
| | | } |
| | | }); |
| | | } |
| | | } |
| | | long ll = System.currentTimeMillis(); |
| | | |
| | | System.out.println("这段代码执行时间为"+ (ll-l)); |
| | | } |
| | | |
| | | private void getTjPackageListsByMan(List<TjPackage> tjPackageList) { |
| | | if (null != tjPackageList && tjPackageList.size() > 0) { |
| | | for (TjPackage aPackage : tjPackageList) { |
| | | List<TjProject> tjProjectList = new ArrayList<>(); |
| | | List<TjPackageProject> pplist = ppservice.getTjPackageProjectListByPacId(String.valueOf(aPackage.getPacId())); |
| | | StringBuilder allProName = new StringBuilder(); |
| | | String allSonName = null; |
| | | if (null != pplist) { |
| | | for (TjPackageProject packageProject : pplist) { |
| | | // StringBuilder allSonProName = new StringBuilder(); |
| | | TjProject tjProject = projectService.selectTjProjectByProId(packageProject.getProId()); |
| | | if (null != tjProject) { |
| | | allProName.append(tjProject.getProName()).append(";"); |
| | | // List<TjProject> projects = tjProjectService.getTjProjectListBySoneId(String.valueOf(packageProject.getProId())); |
| | | String name = projectService.appendTjProjectName(String.valueOf(packageProject.getProId())); |
| | | // for (TjProject project : projects) { |
| | | // allSonProName.append(project.getProName()).append(";"); |
| | | // allSonName.append(project.getProName()).append(";"); |
| | | // tjProject.setAllSonProName(allSonProName.toString()); |
| | | // System.out.println("这段代码时间"+(l-System.currentTimeMillis())); |
| | | // } |
| | | allSonName = name; |
| | | tjProject.setAllSonProName(name); |
| | | tjProjectList.add(tjProject); |
| | | // List<TjProConsumables> list = tjProConsumablesService.list(packageProject.getProId()); |
| | | // List<TjConsumables> list1 = new ArrayList<>(); |
| | | // for (TjProConsumables tjProConsumables : list) { |
| | | // list1.add(tjConsumablesService.selectTjConsumablesById(tjProConsumables.getConsumablesId())); |
| | | // |
| | | // @Override |
| | | // @Async("async") |
| | | // public void ttextracted(TjOrder tjOrder, TjCustomer tjCustomer,SysUser sysUser, TjReservation tjReservation, TjFlowingWater tjFlowingWater) { |
| | | // |
| | | // tjAskMedicalHistoryService.updateTjAskMedicalHistoryByCusId(tjOrder.getTjNumber(),sysUser.getNickName(),String.valueOf(sysUser.getUserId()), String.valueOf(tjCustomer.getCusId())); |
| | | // |
| | | // boolean b = tjOrderDetailService.saveTjOrderDetailsByCusId(tjCustomer.getCusIdcard(), String.valueOf(tjOrder.getOrderId()), sysUser.getNickName(), String.valueOf(sysUser.getUserId())); |
| | | // if (!b){ |
| | | // List<TjGroupingPro> proList = groupingProService.list(new LambdaQueryWrapper<TjGroupingPro>().eq(TjGroupingPro::getGroupingId,tjOrder.getGroupId())); |
| | | // if(null !=proList && proList.size()>0){ |
| | | // for (TjGroupingPro groupingPro : proList) { |
| | | // TjOrderDetail detail = new TjOrderDetail(); |
| | | //// if (null != transition.getPacId()) { |
| | | //// detail.setProType(String.valueOf(transition.getPacId())); |
| | | //// } |
| | | // TjProject tjProject = projectService.selectTjProjectByProId(Long.valueOf(groupingPro.getProId())); |
| | | // detail.setIsSampling(String.valueOf(tjProject.getIsSampling())); |
| | | // detail.setOrderId(tjOrder.getOrderId()); |
| | | // detail.setProId(Long.valueOf(groupingPro.getProId())); |
| | | // detail.setTjStatus(0L); |
| | | // detail.setCreateBy(sysUser.getNickName()); |
| | | // detail.setCreateTime(new Date()); |
| | | // detail.setUpdateBy(sysUser.getNickName()); |
| | | // detail.setUpdateTime(new Date()); |
| | | // detail.setCreateId(String.valueOf(sysUser.getUserId())); |
| | | // detail.setUpdateId(String.valueOf(sysUser.getUserId())); |
| | | // tjOrderDetailService.save(detail); |
| | | // } |
| | | List<TjConsumables> list1 = consumablesService.getTjConsumablesList(String.valueOf(packageProject.getProId())); |
| | | tjProject.setConsumablesList(list1); |
| | | } |
| | | } |
| | | } |
| | | aPackage.setTjProjectList(tjProjectList); |
| | | aPackage.setAllProName(allProName.toString()); |
| | | aPackage.setAllSonName(allSonName); |
| | | } |
| | | if(redisCache.hasKey("getTjPackageListBySex")){ |
| | | redisCache.deleteCacheMapValue("getTjPackageListBySex","getTjPackageListByMan"); |
| | | } |
| | | redisCache.setCacheMapValue("getTjPackageListBySex","getTjPackageListByMan",tjPackageList); |
| | | } |
| | | } |
| | | private void getTjPackageListByWoMan(List<TjPackage> tjPackageList) { |
| | | if (null != tjPackageList && tjPackageList.size() > 0) { |
| | | for (TjPackage aPackage : tjPackageList) { |
| | | List<TjProject> tjProjectList = new ArrayList<>(); |
| | | List<TjPackageProject> pplist = ppservice.getTjPackageProjectListByPacId(String.valueOf(aPackage.getPacId())); |
| | | StringBuilder allProName = new StringBuilder(); |
| | | String allSonName = null; |
| | | if (null != pplist) { |
| | | for (TjPackageProject packageProject : pplist) { |
| | | // StringBuilder allSonProName = new StringBuilder(); |
| | | TjProject tjProject = projectService.selectTjProjectByProId(packageProject.getProId()); |
| | | if (null != tjProject) { |
| | | allProName.append(tjProject.getProName()).append(";"); |
| | | // List<TjProject> projects = tjProjectService.getTjProjectListBySoneId(String.valueOf(packageProject.getProId())); |
| | | String name = projectService.appendTjProjectName(String.valueOf(packageProject.getProId())); |
| | | // for (TjProject project : projects) { |
| | | // allSonProName.append(project.getProName()).append(";"); |
| | | // allSonName.append(project.getProName()).append(";"); |
| | | // tjProject.setAllSonProName(allSonProName.toString()); |
| | | // List<String> list = proList.stream().map(TjGroupingPro::getProId).collect(Collectors.toList()); |
| | | // List<TjProject> projectList = projectService.list(new LambdaQueryWrapper<TjProject>().in(TjProject::getProParentId, list)); |
| | | // for (TjProject project : projectList) { |
| | | // TjOrderDetail detail = new TjOrderDetail(); |
| | | // detail.setOrderId(tjOrder.getOrderId()); |
| | | // detail.setProId(project.getProId()); |
| | | // detail.setTjStatus(0L); |
| | | // detail.setCreateBy(sysUser.getNickName()); |
| | | // detail.setCreateTime(new Date()); |
| | | // detail.setUpdateBy(sysUser.getNickName()); |
| | | // detail.setUpdateTime(new Date()); |
| | | // detail.setCreateId(String.valueOf(sysUser.getUserId())); |
| | | // detail.setUpdateId(String.valueOf(sysUser.getUserId())); |
| | | // //获取该项目的默认值赋值给结果 |
| | | // if(null !=project.getProDefault()){ |
| | | // detail.setProResult(project.getProDefault()); |
| | | // }else { |
| | | // detail.setProResult(null); |
| | | // } |
| | | allSonName = name; |
| | | tjProject.setAllSonProName(name); |
| | | tjProjectList.add(tjProject); |
| | | // List<TjProConsumables> list = tjProConsumablesService.list(packageProject.getProId()); |
| | | // List<TjConsumables> list1 = new ArrayList<>(); |
| | | // for (TjProConsumables tjProConsumables : list) { |
| | | // list1.add(tjConsumablesService.selectTjConsumablesById(tjProConsumables.getConsumablesId())); |
| | | // detail.setIsSampling(String.valueOf(project.getIsSampling())); |
| | | // |
| | | // tjOrderDetailService.save(detail); |
| | | // } |
| | | List<TjConsumables> list1 = consumablesService.getTjConsumablesList(String.valueOf(packageProject.getProId())); |
| | | tjProject.setConsumablesList(list1); |
| | | } |
| | | } |
| | | } |
| | | aPackage.setTjProjectList(tjProjectList); |
| | | aPackage.setAllProName(allProName.toString()); |
| | | aPackage.setAllSonName(allSonName); |
| | | } |
| | | if(redisCache.hasKey("getTjPackageListBySex")){ |
| | | redisCache.deleteCacheMapValue("getTjPackageListBySex","getTjPackageListByWoMan"); |
| | | } |
| | | redisCache.setCacheMapValue("getTjPackageListBySex","getTjPackageListByWoMan",tjPackageList); |
| | | } |
| | | } |
| | | private void getTjPackageListByManAndWoMan(List<TjPackage> tjPackageList) { |
| | | if (null != tjPackageList && tjPackageList.size() > 0) { |
| | | for (TjPackage aPackage : tjPackageList) { |
| | | List<TjProject> tjProjectList = new ArrayList<>(); |
| | | List<TjPackageProject> pplist = ppservice.getTjPackageProjectListByPacId(String.valueOf(aPackage.getPacId())); |
| | | StringBuilder allProName = new StringBuilder(); |
| | | String allSonName = null; |
| | | if (null != pplist) { |
| | | for (TjPackageProject packageProject : pplist) { |
| | | TjProject tjProject = projectService.selectTjProjectByProId(packageProject.getProId()); |
| | | if (null != tjProject) { |
| | | allProName.append(tjProject.getProName()).append(";"); |
| | | String name = projectService.appendTjProjectName(String.valueOf(packageProject.getProId())); |
| | | allSonName = name; |
| | | tjProject.setAllSonProName(name); |
| | | tjProjectList.add(tjProject); |
| | | List<TjConsumables> list1 = consumablesService.getTjConsumablesList(String.valueOf(packageProject.getProId())); |
| | | tjProject.setConsumablesList(list1); |
| | | } |
| | | } |
| | | } |
| | | aPackage.setTjProjectList(tjProjectList); |
| | | aPackage.setAllProName(allProName.toString()); |
| | | aPackage.setAllSonName(allSonName); |
| | | } |
| | | if(redisCache.hasKey("getTjPackageListBySex")){ |
| | | redisCache.deleteCacheMapValue("getTjPackageListBySex","getTjPackageListByManAndWoMan"); |
| | | } |
| | | redisCache.setCacheMapValue("getTjPackageListBySex","getTjPackageListByManAndWoMan",tjPackageList); |
| | | } |
| | | } |
| | | |
| | | |
| | | //已检 |
| | | public List<TjCustomer> getYjAjaxResult(List<Long> ksproList) { |
| | | List<TjCustomer> customerLis = new ArrayList<>(); |
| | | LambdaQueryWrapper<TjOrderDetail> wq1 = new LambdaQueryWrapper<>(); |
| | | wq1.eq(TjOrderDetail::getTjStatus, 1); |
| | | wq1.in(TjOrderDetail::getProId, ksproList); |
| | | wq1.isNotNull(TjOrderDetail::getFlowingWaterId); |
| | | wq1.orderByDesc(TjOrderDetail::getCreateTime); |
| | | List<TjOrderDetail> detailList = tjOrderDetailService.list(wq1); |
| | | if (null != detailList && detailList.size() > 0) { |
| | | //收集orderId并去重 |
| | | List<Long> orderIds = detailList.stream().collect(Collectors.collectingAndThen(Collectors.toCollection( |
| | | () -> new TreeSet<>(Comparator.comparing(TjOrderDetail::getOrderId)) |
| | | ), ArrayList::new)).stream().map(TjOrderDetail::getOrderId).collect(Collectors.toList()); |
| | | for (Long orderId : orderIds) { |
| | | if (null != orderId) { |
| | | TjOrder order = orderService.getById(orderId); |
| | | if(null ==order){ |
| | | continue; |
| | | } |
| | | LambdaQueryWrapper<TjOrderDetail> qww = new LambdaQueryWrapper<>(); |
| | | qww.eq(TjOrderDetail::getOrderId, order.getOrderId()); |
| | | qww.eq(TjOrderDetail::getTjStatus, 0); |
| | | qww.isNotNull(TjOrderDetail::getFlowingWaterId); |
| | | List<TjOrderDetail> lists = tjOrderDetailService.list(qww); |
| | | if (null != lists && lists.size() > 0) { |
| | | continue; |
| | | } |
| | | |
| | | TjCustomer customer = tjCustomerService.getById(order.getUserId()); |
| | | if (null != customer) { |
| | | customer.setCusName(hideCusName(customer.getCusName())); |
| | | customer.setCusPhone(hidePhoneNum(customer.getCusPhone())); |
| | | customer.setCusIdcard(hideIdCardNum(customer.getCusIdcard())); |
| | | if (order.getTjType().equals("1")) { |
| | | customer.setTjType("团体"); |
| | | } |
| | | if (order.getTjType().equals("2")) { |
| | | customer.setTjType("个人"); |
| | | } |
| | | customer.setTjTime(order.getCreateTime()); |
| | | customer.setTjNumber(order.getTjNumber()); |
| | | customer.setTjStatus(1L); |
| | | LambdaQueryWrapper<TjOrderRemark> wq = new LambdaQueryWrapper<>(); |
| | | wq.eq(TjOrderRemark::getTjNumber, order.getTjNumber()); |
| | | wq.in(TjOrderRemark::getType, 0,3); |
| | | List<TjOrderRemark> list = orderRemarkService.list(wq); |
| | | if (null != list && list.size() > 0) { |
| | | StringBuilder stringBuilder = new StringBuilder(); |
| | | for (TjOrderRemark remark : list) { |
| | | TjProject byId = projectService.getById(remark.getProId()); |
| | | stringBuilder.append(byId.getProName()).append(";"); |
| | | } |
| | | customer.setNotCheckeds(String.valueOf(stringBuilder)); |
| | | if(null ==customer.getNotCheckeds())customer.setNotCheckeds("全部已检"); |
| | | } |
| | | customerLis.add(customer); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | return customerLis; |
| | | } |
| | | |
| | | //未检 |
| | | public List<TjCustomer> getWjAjaxResult(List<Long> ksproList) { |
| | | List<TjCustomer> customerLis = new ArrayList<>(); |
| | | LambdaQueryWrapper<TjOrderDetail> wq1 = new LambdaQueryWrapper<>(); |
| | | wq1.eq(TjOrderDetail::getTjStatus, 0); |
| | | wq1.in(TjOrderDetail::getProId, ksproList); |
| | | wq1.isNotNull(TjOrderDetail::getFlowingWaterId); |
| | | wq1.orderByDesc(TjOrderDetail::getCreateTime); |
| | | List<TjOrderDetail> detailList = tjOrderDetailService.list(wq1); |
| | | if (null != detailList && detailList.size() > 0) { |
| | | //收集orderId并去重 |
| | | List<Long> orderIds = detailList.stream().collect(Collectors.collectingAndThen(Collectors.toCollection( |
| | | () -> new TreeSet<>(Comparator.comparing(TjOrderDetail::getOrderId)) |
| | | ), ArrayList::new)).stream().map(TjOrderDetail::getOrderId).collect(Collectors.toList()); |
| | | for (Long orderId : orderIds) { |
| | | if (null != orderId) { |
| | | TjOrder order = orderService.getById(orderId); |
| | | if(null ==order){ |
| | | continue; |
| | | } |
| | | TjCustomer customer = tjCustomerService.getById(order.getUserId()); |
| | | if (null != customer) { |
| | | customer.setCusName(hideCusName(customer.getCusName())); |
| | | customer.setCusPhone(hidePhoneNum(customer.getCusPhone())); |
| | | customer.setCusIdcard(hideIdCardNum(customer.getCusIdcard())); |
| | | |
| | | if (order.getTjType().equals("1")) { |
| | | customer.setTjType("团体"); |
| | | } |
| | | if (order.getTjType().equals("2")) { |
| | | customer.setTjType("个人"); |
| | | } |
| | | customer.setTjTime(order.getCreateTime()); |
| | | customer.setTjNumber(order.getTjNumber()); |
| | | customer.setTjStatus(0L); |
| | | LambdaQueryWrapper<TjOrderRemark> wq = new LambdaQueryWrapper<>(); |
| | | wq.eq(TjOrderRemark::getTjNumber, order.getTjNumber()); |
| | | wq.in(TjOrderRemark::getType, 0,3); |
| | | List<TjOrderRemark> list = orderRemarkService.list(wq); |
| | | if (null != list && list.size() > 0) { |
| | | StringBuilder stringBuilder = new StringBuilder(); |
| | | for (TjOrderRemark remark : list) { |
| | | TjProject byId = projectService.getById(remark.getProId()); |
| | | stringBuilder.append(byId.getProName()).append(";"); |
| | | } |
| | | customer.setNotCheckeds(String.valueOf(stringBuilder)); |
| | | if(null ==customer.getNotCheckeds())customer.setNotCheckeds("全部已检"); |
| | | } |
| | | customerLis.add(customer); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | return customerLis; |
| | | } |
| | | |
| | | //已审 |
| | | private List<TjCustomer> getYsResult(String config) { |
| | | List<TjOrder> orderList = null; |
| | | if("Y".equals(config)){ |
| | | orderList = orderService.getCsTjOrderList1(null,1,null,null,null); |
| | | }else { |
| | | orderList = orderService.getTjOrderList(null,1,null,null,null); |
| | | } |
| | | List<TjCustomer> customerList = new ArrayList<>(); |
| | | if(null !=orderList && orderList.size()>0){ |
| | | for (TjOrder tjOrder : orderList) { |
| | | if (null != tjOrder) { |
| | | TjCustomer customer = tjCustomerService.selectTjCustomerByCusId(tjOrder.getUserId()); |
| | | if (customer == null) { |
| | | continue; |
| | | } |
| | | customer.setCusName(hideCusName(customer.getCusName())); |
| | | customer.setCusPhone(hidePhoneNum(customer.getCusPhone())); |
| | | customer.setCusIdcard(hideIdCardNum(customer.getCusIdcard())); |
| | | customer.setTjNumber(tjOrder.getTjNumber()); |
| | | customer.setTjStatus(Long.valueOf(tjOrder.getCheckStatus())); |
| | | customer.setOrderId(tjOrder.getOrderId()); |
| | | customer.setTjTime(tjOrder.getCreateTime()); |
| | | customer.setFinishTime(tjOrder.getFinishTime()); |
| | | customer.setConfirmStatus(String.valueOf(tjOrder.getStatus())); |
| | | if (tjOrder.getFirmId() == null) { |
| | | customer.setTjCompName("无"); |
| | | } else { |
| | | DictComp byId = compService.selectDictCompByDrugManufacturerId(tjOrder.getFirmId()); |
| | | if (byId != null) { |
| | | customer.setTjCompName(byId.getCnName()); |
| | | } |
| | | } |
| | | customerList.add(customer); |
| | | } |
| | | } |
| | | } |
| | | return customerList; |
| | | } |
| | | |
| | | //未审 |
| | | private List<TjCustomer> getWsResult(String config) { |
| | | List<TjOrder> orderList = null; |
| | | if("Y".equals(config)){ |
| | | orderList = orderService.getCsTjOrderList1(null,0,null,null,null); |
| | | }else { |
| | | orderList = orderService.getTjOrderList(null,0,null,null,null); |
| | | } |
| | | List<TjCustomer> customerList = new ArrayList<>(); |
| | | if(null !=orderList && orderList.size()>0) { |
| | | for (TjOrder tjOrder : orderList) { |
| | | if (null != tjOrder) { |
| | | TjCustomer customer = tjCustomerService.selectTjCustomerByCusId(tjOrder.getUserId()); |
| | | if (customer == null) { |
| | | continue; |
| | | } |
| | | customer.setCusName(hideCusName(customer.getCusName())); |
| | | customer.setCusPhone(hidePhoneNum(customer.getCusPhone())); |
| | | customer.setCusIdcard(hideIdCardNum(customer.getCusIdcard())); |
| | | customer.setTjNumber(tjOrder.getTjNumber()); |
| | | customer.setTjStatus(Long.valueOf(tjOrder.getCheckStatus())); |
| | | customer.setOrderId(tjOrder.getOrderId()); |
| | | customer.setTjTime(tjOrder.getCreateTime()); |
| | | customer.setFinishTime(tjOrder.getFinishTime()); |
| | | customer.setConfirmStatus(String.valueOf(tjOrder.getStatus())); |
| | | if (tjOrder.getFirmId() == null) { |
| | | customer.setTjCompName("无"); |
| | | } else { |
| | | DictComp byId = compService.selectDictCompByDrugManufacturerId(tjOrder.getFirmId()); |
| | | if (byId != null) { |
| | | customer.setTjCompName(byId.getCnName()); |
| | | } |
| | | } |
| | | customerList.add(customer); |
| | | } |
| | | } |
| | | } |
| | | return customerList; |
| | | } |
| | | |
| | | //已签收/未签收 |
| | | private List<Map<String, Object>> getYWqsResult(int a) { |
| | | LambdaQueryWrapper<TjSampling>wq=new LambdaQueryWrapper<>(); |
| | | List<Map<String,Object>> arrayList=new ArrayList<>(); |
| | | wq.orderByDesc(TjSampling::getApplicationTime); |
| | | wq.eq(TjSampling::getIsSignFor,a); |
| | | List<TjSampling> list = tjSamplingService.list(wq); |
| | | if(null != list && list.size()>0 ){ |
| | | Map<String, List<TjSampling>> stringListMap = list.stream().collect(Collectors.groupingBy(TjSampling::getCusId)); |
| | | for (Map.Entry<String, List<TjSampling>> entry : stringListMap.entrySet()) { |
| | | Map<String,Object>map=new HashMap<>(); |
| | | TjCustomer customer = tjCustomerService.getById(entry.getKey()); |
| | | if (customer==null){ |
| | | continue; |
| | | } |
| | | customer.setCusName(hideCusName(customer.getCusName())); |
| | | customer.setCusPhone(hidePhoneNum(customer.getCusPhone())); |
| | | customer.setCusIdcard(hideIdCardNum(customer.getCusIdcard())); |
| | | customer.setTjNumber(entry.getValue().get(0).getTjNum()); |
| | | customer.setApplicationTime(entry.getValue().get(0).getApplicationTime()); |
| | | List<TjSampling> samplings = entry.getValue(); |
| | | if(null !=samplings && samplings.size()>0){ |
| | | List<TjSampling> projectList=new ArrayList<>(); |
| | | for (TjSampling sampling : samplings) { |
| | | TjProject project = projectService.getById(sampling.getProId()); |
| | | if(null !=project && project.getProParentId()==0){ |
| | | projectList.add(sampling); |
| | | } |
| | | } |
| | | map.put("list",projectList); |
| | | } |
| | | map.put("customer",customer); |
| | | arrayList.add(map); |
| | | } |
| | | } |
| | | return arrayList; |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 隐藏手机号 |
| | | * |
| | | * @param phoneNum |
| | | * @return |
| | | */ |
| | | public static String hidePhoneNum(String phoneNum){ |
| | | if(phoneNum.contains("*")){ |
| | | return phoneNum; |
| | | } |
| | | Pattern pattern = Pattern.compile("((13[0-9])|(14[5,7,9])|(15([0-3]|[5-9]))|(17[0,1,3,5,6,7,8])|(18[0-9])|(19[8|9]))\\d{8}"); |
| | | Matcher matcher = pattern.matcher(phoneNum); |
| | | StringBuffer sb = new StringBuffer(); |
| | | try { |
| | | while(matcher.find()) { |
| | | String phoneStr = matcher.group(); |
| | | phoneStr = phoneStr.substring(0, 3) + "****" + phoneStr.substring(7, phoneStr.length()); |
| | | matcher.appendReplacement(sb,phoneStr); |
| | | } |
| | | matcher.appendTail(sb); |
| | | } catch (Exception ex) { |
| | | ex.printStackTrace(); |
| | | } |
| | | return sb.toString(); |
| | | } |
| | | |
| | | /** |
| | | * 隐藏身份证号码 |
| | | * |
| | | * @param idCardNum |
| | | * @return |
| | | */ |
| | | public static String hideIdCardNum(String idCardNum){ |
| | | if(idCardNum.contains("*")){ |
| | | return idCardNum; |
| | | } |
| | | Pattern pattern = Pattern.compile("(\\d{6})(19|20)(\\d{2})(1[0-2]|0[1-9])(0[1-9]|[1-2][0-9]|3[0-1])(\\d{3})(\\d|X|x)"); |
| | | Matcher matcher = pattern.matcher(idCardNum); |
| | | StringBuffer sb = new StringBuffer(); |
| | | try { |
| | | while(matcher.find()) { |
| | | String idCardStr = matcher.group(); |
| | | int len=idCardStr.length(); |
| | | if(len>=9){ |
| | | idCardStr = idCardStr.replaceAll("(.{"+(len<12?3:6)+"})(.*)(.{4})", "$1" + "****" + "$3"); |
| | | } |
| | | matcher.appendReplacement(sb,idCardStr); |
| | | } |
| | | matcher.appendTail(sb); |
| | | } catch (Exception ex) { |
| | | ex.printStackTrace(); |
| | | } |
| | | return sb.toString(); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 隐藏用户姓名 |
| | | * |
| | | * @param cusName |
| | | * @return |
| | | */ |
| | | public static String hideCusName(String cusName){ |
| | | if(!cusName.contains("*")){ |
| | | String realname=null; |
| | | char[] r = cusName.toCharArray(); |
| | | if(r.length ==1){ |
| | | realname = cusName; |
| | | } |
| | | if(r.length == 2){ |
| | | realname = cusName.replaceFirst(cusName.substring(1),"*"); |
| | | } |
| | | if (r.length > 2) { |
| | | realname = cusName.replaceFirst(cusName.substring(1,r.length-1) ,"*"); |
| | | } |
| | | return realname; |
| | | } |
| | | return cusName; |
| | | } |
| | | |
| | | |
| | | //临时表添加单项 |
| | | public void saveRedisTransitionByProId(String cusId, List<Long> proIds) { |
| | | for (Long proId : proIds) { |
| | | if (null != transitionService.getTbTransitionListByCusIdAndPacIdAndProId(cusId, String.valueOf(proId)) && transitionService.getTbTransitionListByCusIdAndPacIdAndProId(cusId, String.valueOf(proId)).size() > 0) { |
| | | continue; |
| | | } |
| | | transitionService.saveRedisTransitionByProId(cusId,proId); |
| | | } |
| | | } |
| | | } |
| | | // } |
| | | // } |
| | | // |
| | | // //添加remark表数据 |
| | | // orderRemarkService.saveTjOrderRemarkByOrderId(tjOrder.getTjNumber(),sysUser.getNickName(),String.valueOf(sysUser.getUserId()), String.valueOf(tjOrder.getOrderId())); |
| | | // |
| | | // //判断是否交钱 |
| | | // if ("1".equals(tjOrder.getTjType())) { |
| | | // if (null != tjReservation && tjReservation.getPayType() == 1) { |
| | | // tjOrderDetailService.updateTjOrderDetailsByOrderId(String.valueOf(tjOrder.getOrderId()), |
| | | // sysUser.getNickName(), String.valueOf(sysUser.getUserId()),String.valueOf(tjFlowingWater.getTjSerialNumber())); |
| | | // } |
| | | // } |
| | | // if (tjFlowingWater.getPayStasus() == 1) { |
| | | // tjOrderDetailService.updateTjOrderDetailsByOrderId(String.valueOf(tjOrder.getOrderId()), |
| | | // sysUser.getNickName(), String.valueOf(sysUser.getUserId()),String.valueOf(tjFlowingWater.getTjSerialNumber())); |
| | | // } |
| | | // |
| | | //// List<TjOrderDetail> list = tjOrderDetailService.getTjOrderDetailsByOrderId(String.valueOf(tjOrder.getOrderId())); |
| | | //// if (list != null) { |
| | | //// for (TjOrderDetail tjOrderDetail : list) { |
| | | //// TjProject tjProject = projectService.getById(tjOrderDetail.getProId()); |
| | | //// if(tjProject==null){ |
| | | //// continue; |
| | | //// } |
| | | //// tjOrderDetail.setProject(tjProject); |
| | | //// if (tjProject.getProParentId() == 0) { |
| | | //// TjOrderRemark tjOrderRemark = new TjOrderRemark(); |
| | | //// tjOrderRemark.setProId(tjProject.getProId()); |
| | | //// tjOrderRemark.setProName(tjProject.getProName()); |
| | | //// tjOrderRemark.setDeptId(tjProject.getDeptId()); |
| | | //// tjOrderRemark.setTjNumber(tjOrder.getTjNumber()); |
| | | //// tjOrderRemark.setCreateBy(sysUser.getNickName()); |
| | | //// tjOrderRemark.setCreateTime(new Date()); |
| | | //// tjOrderRemark.setUpdateBy(sysUser.getNickName()); |
| | | //// tjOrderRemark.setUpdateTime(new Date()); |
| | | //// tjOrderRemark.setCreateId(String.valueOf(sysUser.getUserId())); |
| | | //// tjOrderRemark.setUpdateId(String.valueOf(sysUser.getUserId())); |
| | | //// orderRemarkService.save(tjOrderRemark); |
| | | //// } |
| | | //// if ("1".equals(tjOrder.getTjType())) { |
| | | //// if (null != tjReservation && tjReservation.getPayType() == 1) { |
| | | //// tjOrderDetail.setFlowingWaterId(String.valueOf(tjFlowingWater.getTjSerialNumber())); |
| | | //// } |
| | | //// } |
| | | //// if(tjFlowingWater.getPayStasus()==1){ |
| | | //// tjOrderDetail.setFlowingWaterId(String.valueOf(tjFlowingWater.getTjSerialNumber())); |
| | | //// } |
| | | //// tjOrderDetailService.updateById(tjOrderDetail); |
| | | //// } |
| | | //// } |
| | | // } |
| | | // |
| | | // @Override |
| | | // @Async("async") |
| | | // public void collectFees(TjOrder order, List<TjConsumables> list2, List<TbTransition> tbTransitionList, SysUser sysUser, String discount) { |
| | | // orderRemarkService.deletedOrderRemarkByTjNum(order.getTjNumber()); |
| | | // for (TbTransition transition : tbTransitionList) { |
| | | // transition.setNowPrice(transition.getOrdPrice().multiply(BigDecimal.valueOf(Double.parseDouble(discount)).divide(BigDecimal.valueOf(10)))); |
| | | // transitionService.updateById(transition); |
| | | // TjProject tjProject = projectService.selectTjProjectByProId(transition.getProId()); |
| | | // //子项 |
| | | // if (null != tjProject) { |
| | | // TjChargingStandard tjChargingStandard = new TjChargingStandard(); |
| | | // tjChargingStandard.setTjNum(order.getTjNumber()); |
| | | // tjChargingStandard.setProId(transition.getProId()); |
| | | // tjChargingStandard.setPrice(transition.getNowPrice()); |
| | | // tjChargingStandard.setProName(tjProject.getProName()); |
| | | // tjChargingStandard.setCreateBy(sysUser.getNickName()); |
| | | // tjChargingStandard.setCreateTime(new Date()); |
| | | // tjChargingStandard.setUpdateBy(sysUser.getNickName()); |
| | | // tjChargingStandard.setUpdateTime(new Date()); |
| | | // tjChargingStandard.setCreateId(String.valueOf(sysUser.getUserId())); |
| | | // tjChargingStandard.setUpdateId(String.valueOf(sysUser.getUserId())); |
| | | // chargingStandardService.save(tjChargingStandard); |
| | | // } |
| | | // } |
| | | // |
| | | // //父项 |
| | | // ArrayList<TbTransition> collect1 = tbTransitionList.stream().collect(Collectors.collectingAndThen(Collectors.toCollection(() -> new TreeSet<>(Comparator.comparing(TbTransition::getParentProId))), ArrayList::new)); |
| | | // List<Long> parentProIds = collect1.stream().map(TbTransition::getParentProId).collect(Collectors.toList()); |
| | | // if (parentProIds.size() > 0) { |
| | | // for (Long parentProId : parentProIds) { |
| | | // TjProject parentProject = projectService.selectTjProjectByProId(parentProId); |
| | | // if (null != parentProject) { |
| | | // LambdaQueryWrapper<TjProConsumables> wqqq = new LambdaQueryWrapper<>(); |
| | | // wqqq.eq(TjProConsumables::getProId, parentProject.getProId()); |
| | | // List<TjProConsumables> proConsumables = proConsumablesService.list(wqqq); |
| | | // if (null != proConsumables && proConsumables.size() > 0) { |
| | | // for (TjProConsumables tjProConsumables : proConsumables) { |
| | | // TjConsumables tjConsumables = consumablesService.selectTjConsumablesById(tjProConsumables.getConsumablesId()); |
| | | // list2.add(tjConsumables); |
| | | // } |
| | | // } |
| | | // TjOrderRemark tjOrderRemark=new TjOrderRemark(); |
| | | // tjOrderRemark.setProId(parentProId); |
| | | // tjOrderRemark.setProName(parentProject.getProName()); |
| | | // tjOrderRemark.setDeptId(parentProject.getDeptId()); |
| | | // tjOrderRemark.setTjNumber(order.getTjNumber()); |
| | | // tjOrderRemark.setCreateBy(sysUser.getNickName()); |
| | | // tjOrderRemark.setCreateTime(new Date()); |
| | | // tjOrderRemark.setUpdateBy(sysUser.getNickName()); |
| | | // tjOrderRemark.setUpdateTime(new Date()); |
| | | // tjOrderRemark.setCreateId(String.valueOf(sysUser.getUserId())); |
| | | // tjOrderRemark.setUpdateId(String.valueOf(sysUser.getUserId())); |
| | | // orderRemarkService.save(tjOrderRemark); |
| | | // } |
| | | // } |
| | | // } |
| | | // |
| | | // ArrayList<TjConsumables> collect = list2.stream().collect(Collectors.collectingAndThen(Collectors.toCollection(() -> new TreeSet<>(Comparator.comparing(TjConsumables::getId))), ArrayList::new)); |
| | | // for (TjConsumables tjConsumables : collect) { |
| | | // TjChargingStandard tjChargingStandard = new TjChargingStandard(); |
| | | // tjChargingStandard.setTjNum(order.getTjNumber()); |
| | | // tjChargingStandard.setConsumablesId(tjConsumables.getId()); |
| | | // tjChargingStandard.setPrice(tjConsumables.getPrice()); |
| | | // tjChargingStandard.setProName(tjConsumables.getMakings()); |
| | | // tjChargingStandard.setConsumablesName(tjConsumables.getMakings()); |
| | | // tjChargingStandard.setCompany(tjConsumables.getSpecifications()); |
| | | // tjChargingStandard.setCreateBy(sysUser.getNickName()); |
| | | // tjChargingStandard.setCreateTime(new Date()); |
| | | // tjChargingStandard.setUpdateBy(sysUser.getNickName()); |
| | | // tjChargingStandard.setUpdateTime(new Date()); |
| | | // tjChargingStandard.setCreateId(String.valueOf(sysUser.getUserId())); |
| | | // tjChargingStandard.setUpdateId(String.valueOf(sysUser.getUserId())); |
| | | // chargingStandardService.save(tjChargingStandard); |
| | | // } |
| | | // |
| | | // LambdaQueryWrapper<TjOrderDetail> wq = new LambdaQueryWrapper<>(); |
| | | // wq.eq(TjOrderDetail::getOrderId,order.getOrderId()); |
| | | // wq.isNotNull(TjOrderDetail::getFlowingWaterId); |
| | | // wq.eq(TjOrderDetail::getIsSampling,0); |
| | | // List<TjOrderDetail> detailList = tjOrderDetailService.list(wq); |
| | | // if(null !=detailList && detailList.size()>0){ |
| | | // String format = DateUtil.format(new Date(), "yyMMddHHmmssSSS"); |
| | | // for (TjOrderDetail detail : detailList) { |
| | | // TjSampling sampling=new TjSampling(); |
| | | // if(null==projectService.getById(detail.getProId())) continue; |
| | | // Long proParentId = projectService.getById(detail.getProId()).getProParentId(); |
| | | // if(null !=proParentId && proParentId ==0){ |
| | | // sampling.setSpecimenType(projectService.getById(detail.getProId()).getSpecimenType()); |
| | | // }else { |
| | | // sampling.setSpecimenType(projectService.getById(projectService.getById(detail.getProId()).getProParentId()).getSpecimenType()); |
| | | // } |
| | | // sampling.setSamplingNumber(format); |
| | | // sampling.setTjNum(order.getTjNumber()); |
| | | // sampling.setCusId(String.valueOf(order.getUserId())); |
| | | // if (tjCustomerService.getById(String.valueOf(order.getUserId()))!=null) { |
| | | // sampling.setCusName(tjCustomerService.getById(String.valueOf(order.getUserId())).getCusName()); |
| | | // } |
| | | // sampling.setApplicationTime(new Date()); |
| | | // sampling.setTjTime(order.getCreateTime()); |
| | | // sampling.setProId(String.valueOf(detail.getProId())); |
| | | // sampling.setProName(projectService.getById(detail.getProId()).getProName()); |
| | | // sampling.setCreateBy(sysUser.getNickName()); |
| | | // sampling.setCreateTime(new Date()); |
| | | // sampling.setUpdateBy(sysUser.getNickName()); |
| | | // sampling.setUpdateTime(new Date()); |
| | | // sampling.setCreateId(String.valueOf(sysUser.getUserId())); |
| | | // sampling.setUpdateId(String.valueOf(sysUser.getUserId())); |
| | | // samplingService.save(sampling); |
| | | // } |
| | | // } |
| | | // } |
| | | // |
| | | // @Override |
| | | // @Async("async") |
| | | // public void abandonCheck(String tjNumber, TjOrder tjOrder, List<TjOrderDetail> list, SysUser sysUser) { |
| | | // for (TjOrderDetail tjOrderDetail : list) { |
| | | // LambdaQueryWrapper<TjProject> wq1 = new LambdaQueryWrapper<>(); |
| | | // wq1.eq(TjProject::getProId, tjOrderDetail.getProId()); |
| | | // TjProject one = projectService.getOne(wq1); |
| | | // if (one != null) { |
| | | // if (one.getProParentId() != 0) { |
| | | // tjOrderDetail.setTjStatus(2L); |
| | | // tjOrderDetail.setProResult("弃检"); |
| | | // tjOrderDetail.setUpdateTime(new DateTime()); |
| | | // tjOrderDetailService.updateById(tjOrderDetail); |
| | | // } else { |
| | | // tjOrderDetail.setTjStatus(1L); |
| | | // tjOrderDetail.setUpdateTime(new DateTime()); |
| | | // tjOrderDetailService.updateById(tjOrderDetail); |
| | | // } |
| | | // //给弃检表添加记录 |
| | | // TjDiscardInspection td = new TjDiscardInspection(); |
| | | // td.setProId(String.valueOf(one.getProId())); |
| | | // td.setProName(one.getProName()); |
| | | // td.setCusId(String.valueOf(tjOrder.getUserId())); |
| | | // td.setCusName((tjCustomerService.getById(tjOrder.getUserId())).getCusName()); |
| | | // td.setRegistrationTime(tjOrder.getCreateTime()); |
| | | // td.setTjNum(tjNumber); |
| | | // td.setCreateBy(sysUser.getNickName()); |
| | | // td.setCreateTime(new DateTime()); |
| | | // td.setUpdateBy(sysUser.getNickName()); |
| | | // td.setUpdateTime(new DateTime()); |
| | | // td.setCreateId(String.valueOf(sysUser.getUserId())); |
| | | // td.setUpdateId(String.valueOf(sysUser.getUserId())); |
| | | // discardInspectionService.save(td); |
| | | // } |
| | | // } |
| | | // } |
| | | // |
| | | // @Override |
| | | // @Async("async") |
| | | // public void updateOrdeltile(List<TjOrderDetail> tjOrderDetailList, SysUser sysUser, TjOrder order) { |
| | | // for (TjOrderDetail detail : tjOrderDetailList) { |
| | | // detail.setTjStatus(1L); |
| | | // LambdaQueryWrapper<TjStandard> wq0 = new LambdaQueryWrapper<>(); |
| | | // wq0.eq(TjStandard::getProId, detail.getProId()); |
| | | // detail.setUpdateBy(sysUser.getNickName()); |
| | | // detail.setUpdateTime(new Date()); |
| | | // detail.setCreateId(String.valueOf(sysUser.getUserId())); |
| | | // detail.setUpdateId(String.valueOf(sysUser.getUserId())); |
| | | // tjOrderDetailService.updateById(detail); |
| | | // } |
| | | // } |
| | | // |
| | | // @Override |
| | | // @Async("async") |
| | | // public void iundividualCharges(TjFlowingWater tjFlowingWater, TjOrder order, TjCustomer customer, SysUser sysUser) { |
| | | // List<TjConsumables> list2 = new ArrayList<>(); |
| | | // String[] tjProIds = tjFlowingWater.getTjProIds(); |
| | | // for (String tjProId : tjProIds) { |
| | | // TjProject project = projectService.selectTjProjectByProId(Long.valueOf(tjProId)); |
| | | // TjOrderRemark tjOrderRemark=new TjOrderRemark(); |
| | | // tjOrderRemark.setProId(Long.valueOf(tjProId)); |
| | | // tjOrderRemark.setProName(project.getProName()); |
| | | // tjOrderRemark.setDeptId(project.getDeptId()); |
| | | // tjOrderRemark.setTjNumber(order.getTjNumber()); |
| | | // tjOrderRemark.setCreateBy(sysUser.getNickName()); |
| | | // tjOrderRemark.setCreateTime(new Date()); |
| | | // tjOrderRemark.setUpdateBy(sysUser.getNickName()); |
| | | // tjOrderRemark.setUpdateTime(new Date()); |
| | | // tjOrderRemark.setCreateId(String.valueOf(sysUser.getUserId())); |
| | | // tjOrderRemark.setUpdateId(String.valueOf(sysUser.getUserId())); |
| | | // orderRemarkService.save(tjOrderRemark); |
| | | // List<Long> proIds = projectService.getTjProjectListBySoneId(tjProId).stream().map(TjProject::getProId).collect(Collectors.toList()); |
| | | // TjOrderDetail detail = new TjOrderDetail(); |
| | | // detail.setTjStatus(0L); |
| | | // detail.setOrderId(tjFlowingWater.getOrderId()); |
| | | // detail.setFlowingWaterId(String.valueOf(tjFlowingWater.getTjSerialNumber())); |
| | | // detail.setProId(Long.valueOf(tjProId)); |
| | | // detail.setIsAddition("Y"); |
| | | // detail.setCreateBy(sysUser.getNickName()); |
| | | // detail.setCreateTime(new Date()); |
| | | // detail.setUpdateBy(sysUser.getNickName()); |
| | | // detail.setUpdateTime(new Date()); |
| | | // detail.setCreateId(String.valueOf(sysUser.getUserId())); |
| | | // detail.setUpdateId(String.valueOf(sysUser.getUserId())); |
| | | // tjOrderDetailService.save(detail); |
| | | // for (Long proId : proIds) { |
| | | // TjOrderDetail detail1 = new TjOrderDetail(); |
| | | // detail1.setTjStatus(0L); |
| | | // detail1.setOrderId(tjFlowingWater.getOrderId()); |
| | | // detail1.setFlowingWaterId(String.valueOf(tjFlowingWater.getTjSerialNumber())); |
| | | // detail1.setProId(proId); |
| | | // detail1.setIsAddition("Y"); |
| | | // detail.setCreateBy(sysUser.getNickName()); |
| | | // detail.setCreateTime(new Date()); |
| | | // detail.setUpdateBy(sysUser.getNickName()); |
| | | // detail.setUpdateTime(new Date()); |
| | | // detail.setCreateId(String.valueOf(sysUser.getUserId())); |
| | | // detail.setUpdateId(String.valueOf(sysUser.getUserId())); |
| | | // tjOrderDetailService.save(detail1); |
| | | // } |
| | | // LambdaQueryWrapper<TbTransition> wqq = new LambdaQueryWrapper<>(); |
| | | // wqq.eq(TbTransition::getCusId, customer.getCusIdcard()); |
| | | // wqq.in(TbTransition::getProId, proIds); |
| | | // List<TbTransition> tbTransitionList = transitionService.list(wqq); |
| | | // if (null != tbTransitionList && tbTransitionList.size() > 0) { |
| | | // for (TbTransition transition : tbTransitionList) { |
| | | // transition.setNowPrice(transition.getOrdPrice().multiply(BigDecimal.valueOf(Double.parseDouble(tjFlowingWater.getDiscount())).divide(BigDecimal.valueOf(10)))); |
| | | // transitionService.updateById(transition); |
| | | // TjProject tjProject = projectService.selectTjProjectByProId(transition.getProId()); |
| | | // //子项 |
| | | // if (null != tjProject) { |
| | | // TjChargingStandard tjChargingStandard = new TjChargingStandard(); |
| | | // tjChargingStandard.setTjNum(order.getTjNumber()); |
| | | // tjChargingStandard.setProId(transition.getProId()); |
| | | // tjChargingStandard.setPrice(transition.getNowPrice()); |
| | | // tjChargingStandard.setProName(tjProject.getProName()); |
| | | // tjChargingStandard.setCreateBy(sysUser.getNickName()); |
| | | // tjChargingStandard.setCreateTime(new Date()); |
| | | // tjChargingStandard.setUpdateBy(sysUser.getNickName()); |
| | | // tjChargingStandard.setUpdateTime(new Date()); |
| | | // tjChargingStandard.setCreateId(String.valueOf(sysUser.getUserId())); |
| | | // tjChargingStandard.setUpdateId(String.valueOf(sysUser.getUserId())); |
| | | // chargingStandardService.save(tjChargingStandard); |
| | | // } |
| | | // } |
| | | // //父项 |
| | | // TjProject parentProject = projectService.getById(tjProId); |
| | | // if (null != parentProject) { |
| | | // LambdaQueryWrapper<TjProConsumables> wqqq = new LambdaQueryWrapper<>(); |
| | | // wqqq.eq(TjProConsumables::getProId, parentProject.getProId()); |
| | | // List<TjProConsumables> proConsumables = proConsumablesService.list(wqqq); |
| | | // if (null != proConsumables && proConsumables.size() > 0) { |
| | | // for (TjProConsumables tjProConsumables : proConsumables) { |
| | | // TjConsumables tjConsumables = consumablesService.selectTjConsumablesById(tjProConsumables.getConsumablesId()); |
| | | // list2.add(tjConsumables); |
| | | // } |
| | | // } |
| | | // } |
| | | // } |
| | | // } |
| | | // //父项耗材 |
| | | // ArrayList<TjConsumables> collect = list2.stream().collect(Collectors.collectingAndThen(Collectors.toCollection(() -> new TreeSet<>(Comparator.comparing(TjConsumables::getId))), ArrayList::new)); |
| | | // for (TjConsumables tjConsumables : collect) { |
| | | // TjChargingStandard tjChargingStandard = new TjChargingStandard(); |
| | | // tjChargingStandard.setTjNum(order.getTjNumber()); |
| | | // tjChargingStandard.setConsumablesId(tjConsumables.getId()); |
| | | // tjChargingStandard.setPrice(tjConsumables.getPrice()); |
| | | // tjChargingStandard.setProName(tjConsumables.getMakings()); |
| | | // tjChargingStandard.setConsumablesName(tjConsumables.getMakings()); |
| | | // tjChargingStandard.setCompany(tjConsumables.getSpecifications()); |
| | | // tjChargingStandard.setCreateBy(sysUser.getNickName()); |
| | | // tjChargingStandard.setCreateTime(new Date()); |
| | | // tjChargingStandard.setUpdateBy(sysUser.getNickName()); |
| | | // tjChargingStandard.setUpdateTime(new Date()); |
| | | // tjChargingStandard.setCreateId(String.valueOf(sysUser.getUserId())); |
| | | // tjChargingStandard.setUpdateId(String.valueOf(sysUser.getUserId())); |
| | | // chargingStandardService.save(tjChargingStandard); |
| | | // } |
| | | // } |
| | | // |
| | | // @Override |
| | | // @Async("async") |
| | | // public void dockerSetCustomerLisByRedis(List<Long> ksproList, String ksId) { |
| | | // List<TjCustomer> yjAjaxResult = getYjAjaxResult(ksproList); |
| | | // List<TjCustomer> wjAjaxResult = getWjAjaxResult(ksproList); |
| | | // redisCache.setCacheMapValue(ksId + "ks", "wj",wjAjaxResult); |
| | | // redisCache.setCacheMapValue(ksId + "ks", "yj",yjAjaxResult); |
| | | // } |
| | | // |
| | | // @Override |
| | | // @Async("async") |
| | | // public void checkSetCustomerLisByRedis(String config) { |
| | | // List<TjCustomer> wsResult = getWsResult(config); |
| | | // List<TjCustomer> ysResult = getYsResult(config); |
| | | // redisCache.setCacheMapValue("check", "ws",wsResult); |
| | | // redisCache.setCacheMapValue("check", "ys",ysResult); |
| | | // //查询 |
| | | // } |
| | | // |
| | | // @Override |
| | | // @Async("async") |
| | | // public void wCScheckSetCustomerLisByRedis( List<TjOrder> orderList) { |
| | | // List<TjCustomer> customerList = new ArrayList<>(); |
| | | // if(null !=orderList && orderList.size()>0){ |
| | | // for (TjOrder tjOrder : orderList) { |
| | | // if (null != tjOrder) { |
| | | // TjCustomer customer = tjCustomerService.selectTjCustomerByCusId(tjOrder.getUserId()); |
| | | // if (customer == null) { |
| | | // continue; |
| | | // } |
| | | // customer.setCusName(hideCusName(customer.getCusName())); |
| | | // customer.setCusPhone(hidePhoneNum(customer.getCusPhone())); |
| | | // customer.setCusIdcard(hideIdCardNum(customer.getCusIdcard())); |
| | | // customer.setTjNumber(tjOrder.getTjNumber()); |
| | | // customer.setTjStatus(Long.valueOf(tjOrder.getCheckStatus())); |
| | | // customer.setOrderId(tjOrder.getOrderId()); |
| | | // customer.setTjTime(tjOrder.getCreateTime()); |
| | | // customer.setFinishTime(tjOrder.getFinishTime()); |
| | | // customer.setConfirmStatus(String.valueOf(tjOrder.getStatus())); |
| | | // if (tjOrder.getFirmId() == null) { |
| | | // customer.setTjCompName("无"); |
| | | // } else { |
| | | // DictComp byId = compService.selectDictCompByDrugManufacturerId(tjOrder.getFirmId()); |
| | | // if (byId != null) { |
| | | // customer.setTjCompName(byId.getCnName()); |
| | | // } |
| | | // } |
| | | // customerList.add(customer); |
| | | // } |
| | | // } |
| | | // } |
| | | // redisCache.setCacheMapValue("cScheck", "ws",customerList); |
| | | // } |
| | | // |
| | | // @Override |
| | | // @Async("async") |
| | | // public void yCScheckSetCustomerLisByRedis( List<TjOrder> orderList) { |
| | | // List<TjCustomer> customerList = new ArrayList<>(); |
| | | // if(null !=orderList && orderList.size()>0){ |
| | | // for (TjOrder tjOrder : orderList) { |
| | | // if (null != tjOrder) { |
| | | // TjCustomer customer = tjCustomerService.selectTjCustomerByCusId(tjOrder.getUserId()); |
| | | // if (customer == null) { |
| | | // continue; |
| | | // } |
| | | // customer.setCusName(hideCusName(customer.getCusName())); |
| | | // customer.setCusPhone(hidePhoneNum(customer.getCusPhone())); |
| | | // customer.setCusIdcard(hideIdCardNum(customer.getCusIdcard())); |
| | | // customer.setTjNumber(tjOrder.getTjNumber()); |
| | | // customer.setTjStatus(Long.valueOf(tjOrder.getCheckStatus())); |
| | | // customer.setOrderId(tjOrder.getOrderId()); |
| | | // customer.setTjTime(tjOrder.getCreateTime()); |
| | | // customer.setFinishTime(tjOrder.getFinishTime()); |
| | | // customer.setConfirmStatus(String.valueOf(tjOrder.getStatus())); |
| | | // if (tjOrder.getFirmId() == null) { |
| | | // customer.setTjCompName("无"); |
| | | // } else { |
| | | // DictComp byId = compService.selectDictCompByDrugManufacturerId(tjOrder.getFirmId()); |
| | | // if (byId != null) { |
| | | // customer.setTjCompName(byId.getCnName()); |
| | | // } |
| | | // } |
| | | // customerList.add(customer); |
| | | // } |
| | | // } |
| | | // } |
| | | // redisCache.setCacheMapValue("cScheck", "ys",customerList); |
| | | // } |
| | | // |
| | | // |
| | | // @Override |
| | | // @Async("async") |
| | | // public void tjRefund(List<TjProject> refundPros, String tjNum) { |
| | | // for (TjProject refundPro : refundPros) { |
| | | // LambdaQueryWrapper<TjProject> wq0 = new LambdaQueryWrapper<>(); |
| | | // wq0.eq(TjProject::getProParentId, refundPro.getProId()); |
| | | // List<Long> collect = projectService.list(wq0).stream().map(TjProject::getProId).collect(Collectors.toList()); |
| | | // LambdaQueryWrapper<TjSampling>wq1=new LambdaQueryWrapper<>(); |
| | | // wq1.eq(TjSampling::getTjNum,tjNum); |
| | | // wq1.in(TjSampling::getProId,collect); |
| | | // List<TjSampling> list = samplingService.list(wq1); |
| | | // if(null !=list && list.size()>0) samplingService.removeByIds(list.stream().map(TjSampling::getId).collect(Collectors.toList())); |
| | | // LambdaQueryWrapper<TjSampling>wq2=new LambdaQueryWrapper<>(); |
| | | // wq2.eq(TjSampling::getTjNum,tjNum); |
| | | // wq2.eq(TjSampling::getProId,refundPro.getProId()); |
| | | // samplingService.remove(wq2); |
| | | // } |
| | | // } |
| | | // |
| | | // @Override |
| | | // @Async("async") |
| | | // public void saveSampling() { |
| | | // redisCache.setCacheMapValue("sampling", "yqs",getYWqsResult(0)); |
| | | // redisCache.setCacheMapValue("sampling", "wqs",getYWqsResult(1)); |
| | | // } |
| | | // |
| | | // @Override |
| | | // @Async("async") |
| | | // public void tjGoutAsync(List<QjDomainVo> domainVos,SysUser sysUser,Set<String> list) { |
| | | // for (QjDomainVo domainVo : domainVos) { |
| | | // TjOrderRemark remark = orderRemarkService.getById(domainVo.getRemarkId()); |
| | | // TjOrder order = orderService.getOrderByTjNum(domainVo.getTjNumber()); |
| | | // //给弃检表添加记录 |
| | | // if(domainVo.getType().equals(2)){ |
| | | // TjDiscardInspection td = new TjDiscardInspection(); |
| | | // td.setProId(String.valueOf(remark.getProId())); |
| | | // td.setProName(projectService.selectTjProjectByProId(remark.getProId()).getProName()); |
| | | // td.setCusId(String.valueOf(order.getUserId())); |
| | | // td.setCusName((tjCustomerService.getById(order.getUserId())).getCusName()); |
| | | // td.setRegistrationTime(order.getCreateTime()); |
| | | // td.setTjNum(domainVo.getTjNumber()); |
| | | // td.setCreateBy(sysUser.getNickName()); |
| | | // td.setCreateTime(new DateTime()); |
| | | // td.setUpdateBy(sysUser.getNickName()); |
| | | // td.setUpdateTime(new DateTime()); |
| | | // td.setCreateId(String.valueOf(sysUser.getUserId())); |
| | | // td.setUpdateId(String.valueOf(sysUser.getUserId())); |
| | | // discardInspectionService.save(td); |
| | | // } |
| | | // |
| | | // LambdaQueryWrapper<TjProject>wq1=new LambdaQueryWrapper<>(); |
| | | // wq1.eq(TjProject::getProParentId,remark.getProId()); |
| | | // List<TjProject> projectList = projectService.list(wq1); |
| | | // if(null !=projectList && projectList.size()>0){ |
| | | // List<Long> collect = projectList.stream().map(TjProject::getProId).collect(Collectors.toList()); |
| | | // LambdaQueryWrapper<TjOrderDetail>wq2=new LambdaQueryWrapper<>(); |
| | | // wq2.eq(TjOrderDetail::getOrderId,order.getOrderId()); |
| | | // wq2.in(TjOrderDetail::getProId,collect); |
| | | // List<TjOrderDetail> detailList = tjOrderDetailService.list(wq2); |
| | | // if(null !=detailList && detailList.size()>0){ |
| | | // for (TjOrderDetail detail : detailList) { |
| | | // detail.setTjStatus(Long.valueOf(remark.getType())); |
| | | // if(null !=remark.getRemark()) detail.setRemark(domainVo.getRemark()); |
| | | // if(null !=remark.getYqDeadline()) detail.setYqDeadline(remark.getYqDeadline()); |
| | | // tjOrderDetailService.updateById(detail); |
| | | // } |
| | | // } |
| | | // } |
| | | // } |
| | | // if (list.size() > 0) { |
| | | // for (String s : list) { |
| | | // TjOrder tjOrder = orderService.getOrderByTjNum(s); |
| | | // if (null != tjOrder) { |
| | | // tjOrder.setStatus(TjConstants.TJ_DELAY); |
| | | // tjOrder.setFinishTime(null); |
| | | // tjOrder.setUpdateBy(sysUser.getNickName()); |
| | | // tjOrder.setUpdateTime(new DateTime()); |
| | | // tjOrder.setUpdateId(String.valueOf(sysUser.getUserId())); |
| | | // orderService.updateById(tjOrder); |
| | | // TjCustomer customer = tjCustomerService.selectTjCustomerByCusId(tjOrder.getUserId()); |
| | | // TjYqOrder yqOrder=new TjYqOrder(); |
| | | // yqOrder.setTjNum(s); |
| | | // yqOrder.setCusName(customer.getCusName()); |
| | | // yqOrder.setSex(String.valueOf(customer.getCusSex())); |
| | | // yqOrder.setAge(customer.getAge()); |
| | | // yqOrder.setPhone(customer.getCusPhone()); |
| | | // yqOrder.setYqTime(new Date()); |
| | | // yqOrder.setOrderTime(tjOrder.getCreateTime()); |
| | | // yqOrder.setProIds(orderRemarkService.getTjOrderRemarkProIdList(s)); |
| | | // yqOrder.setEmilSend("0"); |
| | | // yqOrder.setMsgSend("0"); |
| | | // yqOrder.setCreateBy(sysUser.getNickName()); |
| | | // yqOrder.setCreateTime(new DateTime()); |
| | | // yqOrder.setUpdateBy(sysUser.getNickName()); |
| | | // yqOrder.setUpdateTime(new DateTime()); |
| | | // yqOrder.setCreateId(String.valueOf(sysUser.getUserId())); |
| | | // yqOrder.setUpdateId(String.valueOf(sysUser.getUserId())); |
| | | // yqOrderService.save(yqOrder); |
| | | // } |
| | | // } |
| | | // } |
| | | // } |
| | | // |
| | | // @Override |
| | | // @Async("async") |
| | | // public void addRedisTransitionPac(String cusId, Long pacId, List<TjPackageProject> ppList) { |
| | | // for (TjPackageProject tjPackageProject : ppList) { |
| | | // TjProject project = projectService.getById(tjPackageProject.getProId()); |
| | | // if (null != project) { |
| | | // BigDecimal divide = tjPackageProject.getPriceNow().divide(project.getProPrice(),5,RoundingMode.DOWN); |
| | | // LambdaQueryWrapper<TjProject> wq2 = new LambdaQueryWrapper<>(); |
| | | // wq2.eq(TjProject::getProParentId, project.getProId()); |
| | | // List<TjProject> tjProSonList = projectService.list(wq2); |
| | | // if (null != tjProSonList && tjProSonList.size() > 0) { |
| | | // for (TjProject tjProject : tjProSonList) { |
| | | // TbTransition tbTransition = new TbTransition(); |
| | | // tbTransition.setCusId(cusId); |
| | | // tbTransition.setPacId(pacId); |
| | | // |
| | | // if (null != tjPackageProject.getPriceNow() && divide.compareTo(BigDecimal.valueOf(0)) > 0) { |
| | | // tbTransition.setNowPrice(tjProject.getProPrice().multiply(divide).setScale(2,RoundingMode.HALF_DOWN)); |
| | | // tbTransition.setOrdPrice(tjProject.getProPrice().multiply(divide).setScale(2,RoundingMode.HALF_DOWN)); |
| | | // } else { |
| | | // tbTransition.setNowPrice(BigDecimal.valueOf(0.00)); |
| | | // tbTransition.setOrdPrice(BigDecimal.valueOf(0.00)); |
| | | // } |
| | | // tbTransition.setParentProId(project.getProId()); |
| | | // tbTransition.setParentProName(project.getProName()); |
| | | // tbTransition.setProId(tjProject.getProId()); |
| | | // tbTransition.setProName(tjProject.getProName()); |
| | | // tbTransition.setPacName(tjPackageService.getById(tbTransition.getPacId()).getPacName()); |
| | | // tbTransition.setCreateTime(new Date()); |
| | | // tbTransition.setProType(tjProject.getProType()); |
| | | // tbTransition.setProCheckMethod(tjProject.getProCheckMethod()); |
| | | // transitionService.save(tbTransition); |
| | | // } |
| | | // |
| | | // } |
| | | // } |
| | | // } |
| | | // } |
| | | // |
| | | // @Override |
| | | // @Async("async") |
| | | // public void saveRedisTransitionByPacId(String cusId, Long pacId,List<Long> proIds) { |
| | | // if(null != pacId){ |
| | | // transitionService.saveRedisTransitionByPacId(cusId,pacId); |
| | | // } |
| | | // if(null != proIds && proIds.size() > 0){ |
| | | // saveRedisTransitionByProId(cusId,proIds); |
| | | // } |
| | | // } |
| | | // |
| | | // @Override |
| | | // @Async("async") |
| | | // public void addRedisTransitionPro(String cusId, List<Long> proIds) { |
| | | // for (Long proId : proIds) { |
| | | // if (null != transitionService.getTbTransitionListByCusIdAndPacIdAndProId(cusId, String.valueOf(proId)) && transitionService.getTbTransitionListByCusIdAndPacIdAndProId(cusId, String.valueOf(proId)).size() > 0) { |
| | | // continue; |
| | | // } |
| | | // TjProject project = projectService.getById(proId); |
| | | // if (null != project) { |
| | | // LambdaQueryWrapper<TjProject> wq1 = new LambdaQueryWrapper<>(); |
| | | // wq1.eq(TjProject::getProParentId, project.getProId()); |
| | | // List<TjProject> tjProSonList = projectService.list(wq1); |
| | | // if (null != tjProSonList && tjProSonList.size() > 0) { |
| | | // for (TjProject tjProject : tjProSonList) { |
| | | // List<TbTransition> transitionss = transitionService.getTbTransitionListByCusIdAndPacIdAndProId(cusId, String.valueOf(tjProject.getProId())); |
| | | // if (null != transitionss && transitionss.size() > 0) { |
| | | // continue; |
| | | // } |
| | | // TbTransition tbTransition = new TbTransition(); |
| | | // tbTransition.setCusId(cusId); |
| | | // tbTransition.setPacId(null); |
| | | // if (null != tjProject.getProPrice()) { |
| | | // tbTransition.setOrdPrice(tjProject.getProPrice()); |
| | | // tbTransition.setNowPrice(tjProject.getProPrice()); |
| | | // } else { |
| | | // tbTransition.setOrdPrice(BigDecimal.valueOf(0.00)); |
| | | // tbTransition.setNowPrice(BigDecimal.valueOf(0.00)); |
| | | // } |
| | | // tbTransition.setParentProId(proId); |
| | | // tbTransition.setParentProName(project.getProName()); |
| | | // tbTransition.setProId(tjProject.getProId()); |
| | | // tbTransition.setProName(tjProject.getProName()); |
| | | // tbTransition.setCreateTime(new Date()); |
| | | // tbTransition.setProType(tjProject.getProType()); |
| | | // tbTransition.setProCheckMethod(tjProject.getProCheckMethod()); |
| | | // transitionService.save(tbTransition); |
| | | // } |
| | | // } |
| | | // } |
| | | // } |
| | | // } |
| | | // |
| | | // @Override |
| | | // @Async("async") |
| | | // public void getTjPackageList() { |
| | | // |
| | | // //男人 |
| | | // getTjPackageListsByMan(tjPackageService.getTjPackageListByMan()); |
| | | // |
| | | // //女人 |
| | | // getTjPackageListByWoMan(tjPackageService.getTjPackageListByWoMan()); |
| | | // |
| | | // //未知 |
| | | // getTjPackageListByManAndWoMan(tjPackageService.list(new LambdaQueryWrapper<TjPackage>().eq(TjPackage::getPacStatus,0))); |
| | | // } |
| | | // |
| | | // @Override |
| | | // @Async("async") |
| | | // public void addNewReservationConfirm(List<TjReservation> rightList ) { |
| | | // if(null !=rightList && rightList.size()>0){ |
| | | // for (TjReservation reservation : rightList) { |
| | | // transitionService.deletedTbTransitionByCusId(reservation.getIdCard()); |
| | | // List<AddNewReservationConfirm> confirmList = groupingProService.getAddNewReservationConfirm(reservation.getGroupingId()); |
| | | // if (null !=confirmList && confirmList.size()>0){ |
| | | // for (AddNewReservationConfirm confirm : confirmList) { |
| | | // List<TbTransition> transitionss = transitionService.getTbTransitionListByCusIdAndPacIdAndProId(reservation.getIdCard(),confirm.getPid()); |
| | | // if (null != transitionss && transitionss.size() > 0) { |
| | | // continue; |
| | | // } |
| | | // TbTransition tbTransition = new TbTransition(); |
| | | // tbTransition.setCusId(reservation.getIdCard()); |
| | | // tbTransition.setPacId(null); |
| | | // if (null != confirm.getProPrice()) { |
| | | // tbTransition.setOrdPrice(confirm.getProPrice()); |
| | | // tbTransition.setNowPrice(confirm.getProPrice().multiply(BigDecimal.valueOf(Long.parseLong(confirm.getLimits())).divide(BigDecimal.valueOf(10)))); |
| | | // } else { |
| | | // tbTransition.setOrdPrice(BigDecimal.valueOf(0.00)); |
| | | // tbTransition.setNowPrice(BigDecimal.valueOf(0.00)); |
| | | // } |
| | | // tbTransition.setParentProId(Long.valueOf(confirm.getProId())); |
| | | // tbTransition.setParentProName(confirm.getProName()); |
| | | // tbTransition.setProId(Long.valueOf(confirm.getPid())); |
| | | // tbTransition.setProName(confirm.getPname()); |
| | | // tbTransition.setCreateTime(new Date()); |
| | | // transitionService.save(tbTransition); |
| | | // } |
| | | // } |
| | | // } |
| | | // } |
| | | // } |
| | | // |
| | | // @Override |
| | | // @Async("async") |
| | | // public void saveNewReservationConfirm(List<TjReservation> rightList) { |
| | | // long l = System.currentTimeMillis(); |
| | | // if(null !=rightList && rightList.size()>0){ |
| | | // //创建线程池 |
| | | // ExecutorService threadPool = Executors.newFixedThreadPool(rightList.size()); |
| | | // for (TjReservation reservation : rightList) { |
| | | // //删除之前的数据 |
| | | // transitionService.deletedTbTransitionByCusId(reservation.getIdCard()); |
| | | // //获取线程 |
| | | // threadPool.execute(new Runnable() { |
| | | // @Override |
| | | // public void run() { |
| | | // try { |
| | | // transitionService.saveTemoTransitionByGroupingId(reservation.getIdCard(),reservation.getGroupingId()); |
| | | // |
| | | // threadPool.shutdown(); |
| | | // } catch (Exception e) { |
| | | // e.printStackTrace(); |
| | | // } |
| | | // } |
| | | // }); |
| | | // } |
| | | // } |
| | | // long ll = System.currentTimeMillis(); |
| | | // |
| | | // System.out.println("这段代码执行时间为"+ (ll-l)); |
| | | // } |
| | | // |
| | | // private void getTjPackageListsByMan(List<TjPackage> tjPackageList) { |
| | | // if (null != tjPackageList && tjPackageList.size() > 0) { |
| | | // for (TjPackage aPackage : tjPackageList) { |
| | | // List<TjProject> tjProjectList = new ArrayList<>(); |
| | | // List<TjPackageProject> pplist = ppservice.getTjPackageProjectListByPacId(String.valueOf(aPackage.getPacId())); |
| | | // StringBuilder allProName = new StringBuilder(); |
| | | // String allSonName = null; |
| | | // if (null != pplist) { |
| | | // for (TjPackageProject packageProject : pplist) { |
| | | //// StringBuilder allSonProName = new StringBuilder(); |
| | | // TjProject tjProject = projectService.selectTjProjectByProId(packageProject.getProId()); |
| | | // if (null != tjProject) { |
| | | // allProName.append(tjProject.getProName()).append(";"); |
| | | //// List<TjProject> projects = tjProjectService.getTjProjectListBySoneId(String.valueOf(packageProject.getProId())); |
| | | // String name = projectService.appendTjProjectName(String.valueOf(packageProject.getProId())); |
| | | //// for (TjProject project : projects) { |
| | | //// allSonProName.append(project.getProName()).append(";"); |
| | | //// allSonName.append(project.getProName()).append(";"); |
| | | //// tjProject.setAllSonProName(allSonProName.toString()); |
| | | //// } |
| | | // allSonName = name; |
| | | // tjProject.setAllSonProName(name); |
| | | // tjProjectList.add(tjProject); |
| | | //// List<TjProConsumables> list = tjProConsumablesService.list(packageProject.getProId()); |
| | | //// List<TjConsumables> list1 = new ArrayList<>(); |
| | | //// for (TjProConsumables tjProConsumables : list) { |
| | | //// list1.add(tjConsumablesService.selectTjConsumablesById(tjProConsumables.getConsumablesId())); |
| | | //// } |
| | | // List<TjConsumables> list1 = consumablesService.getTjConsumablesList(String.valueOf(packageProject.getProId())); |
| | | // tjProject.setConsumablesList(list1); |
| | | // } |
| | | // } |
| | | // } |
| | | // aPackage.setTjProjectList(tjProjectList); |
| | | // aPackage.setAllProName(allProName.toString()); |
| | | // aPackage.setAllSonName(allSonName); |
| | | // } |
| | | // if(redisCache.hasKey("getTjPackageListBySex")){ |
| | | // redisCache.deleteCacheMapValue("getTjPackageListBySex","getTjPackageListByMan"); |
| | | // } |
| | | // redisCache.setCacheMapValue("getTjPackageListBySex","getTjPackageListByMan",tjPackageList); |
| | | // } |
| | | // } |
| | | // private void getTjPackageListByWoMan(List<TjPackage> tjPackageList) { |
| | | // if (null != tjPackageList && tjPackageList.size() > 0) { |
| | | // for (TjPackage aPackage : tjPackageList) { |
| | | // List<TjProject> tjProjectList = new ArrayList<>(); |
| | | // List<TjPackageProject> pplist = ppservice.getTjPackageProjectListByPacId(String.valueOf(aPackage.getPacId())); |
| | | // StringBuilder allProName = new StringBuilder(); |
| | | // String allSonName = null; |
| | | // if (null != pplist) { |
| | | // for (TjPackageProject packageProject : pplist) { |
| | | //// StringBuilder allSonProName = new StringBuilder(); |
| | | // TjProject tjProject = projectService.selectTjProjectByProId(packageProject.getProId()); |
| | | // if (null != tjProject) { |
| | | // allProName.append(tjProject.getProName()).append(";"); |
| | | //// List<TjProject> projects = tjProjectService.getTjProjectListBySoneId(String.valueOf(packageProject.getProId())); |
| | | // String name = projectService.appendTjProjectName(String.valueOf(packageProject.getProId())); |
| | | //// for (TjProject project : projects) { |
| | | //// allSonProName.append(project.getProName()).append(";"); |
| | | //// allSonName.append(project.getProName()).append(";"); |
| | | //// tjProject.setAllSonProName(allSonProName.toString()); |
| | | //// } |
| | | // allSonName = name; |
| | | // tjProject.setAllSonProName(name); |
| | | // tjProjectList.add(tjProject); |
| | | //// List<TjProConsumables> list = tjProConsumablesService.list(packageProject.getProId()); |
| | | //// List<TjConsumables> list1 = new ArrayList<>(); |
| | | //// for (TjProConsumables tjProConsumables : list) { |
| | | //// list1.add(tjConsumablesService.selectTjConsumablesById(tjProConsumables.getConsumablesId())); |
| | | //// } |
| | | // List<TjConsumables> list1 = consumablesService.getTjConsumablesList(String.valueOf(packageProject.getProId())); |
| | | // tjProject.setConsumablesList(list1); |
| | | // } |
| | | // } |
| | | // } |
| | | // aPackage.setTjProjectList(tjProjectList); |
| | | // aPackage.setAllProName(allProName.toString()); |
| | | // aPackage.setAllSonName(allSonName); |
| | | // } |
| | | // if(redisCache.hasKey("getTjPackageListBySex")){ |
| | | // redisCache.deleteCacheMapValue("getTjPackageListBySex","getTjPackageListByWoMan"); |
| | | // } |
| | | // redisCache.setCacheMapValue("getTjPackageListBySex","getTjPackageListByWoMan",tjPackageList); |
| | | // } |
| | | // } |
| | | // private void getTjPackageListByManAndWoMan(List<TjPackage> tjPackageList) { |
| | | // if (null != tjPackageList && tjPackageList.size() > 0) { |
| | | // for (TjPackage aPackage : tjPackageList) { |
| | | // List<TjProject> tjProjectList = new ArrayList<>(); |
| | | // List<TjPackageProject> pplist = ppservice.getTjPackageProjectListByPacId(String.valueOf(aPackage.getPacId())); |
| | | // StringBuilder allProName = new StringBuilder(); |
| | | // String allSonName = null; |
| | | // if (null != pplist) { |
| | | // for (TjPackageProject packageProject : pplist) { |
| | | // TjProject tjProject = projectService.selectTjProjectByProId(packageProject.getProId()); |
| | | // if (null != tjProject) { |
| | | // allProName.append(tjProject.getProName()).append(";"); |
| | | // String name = projectService.appendTjProjectName(String.valueOf(packageProject.getProId())); |
| | | // allSonName = name; |
| | | // tjProject.setAllSonProName(name); |
| | | // tjProjectList.add(tjProject); |
| | | // List<TjConsumables> list1 = consumablesService.getTjConsumablesList(String.valueOf(packageProject.getProId())); |
| | | // tjProject.setConsumablesList(list1); |
| | | // } |
| | | // } |
| | | // } |
| | | // aPackage.setTjProjectList(tjProjectList); |
| | | // aPackage.setAllProName(allProName.toString()); |
| | | // aPackage.setAllSonName(allSonName); |
| | | // } |
| | | // if(redisCache.hasKey("getTjPackageListBySex")){ |
| | | // redisCache.deleteCacheMapValue("getTjPackageListBySex","getTjPackageListByManAndWoMan"); |
| | | // } |
| | | // redisCache.setCacheMapValue("getTjPackageListBySex","getTjPackageListByManAndWoMan",tjPackageList); |
| | | // } |
| | | // } |
| | | // |
| | | // |
| | | // //已检 |
| | | // public List<TjCustomer> getYjAjaxResult(List<Long> ksproList) { |
| | | // List<TjCustomer> customerLis = new ArrayList<>(); |
| | | // LambdaQueryWrapper<TjOrderDetail> wq1 = new LambdaQueryWrapper<>(); |
| | | // wq1.eq(TjOrderDetail::getTjStatus, 1); |
| | | // wq1.in(TjOrderDetail::getProId, ksproList); |
| | | // wq1.isNotNull(TjOrderDetail::getFlowingWaterId); |
| | | // wq1.orderByDesc(TjOrderDetail::getCreateTime); |
| | | // List<TjOrderDetail> detailList = tjOrderDetailService.list(wq1); |
| | | // if (null != detailList && detailList.size() > 0) { |
| | | // //收集orderId并去重 |
| | | // List<Long> orderIds = detailList.stream().collect(Collectors.collectingAndThen(Collectors.toCollection( |
| | | // () -> new TreeSet<>(Comparator.comparing(TjOrderDetail::getOrderId)) |
| | | // ), ArrayList::new)).stream().map(TjOrderDetail::getOrderId).collect(Collectors.toList()); |
| | | // for (Long orderId : orderIds) { |
| | | // if (null != orderId) { |
| | | // TjOrder order = orderService.getById(orderId); |
| | | // if(null ==order){ |
| | | // continue; |
| | | // } |
| | | // LambdaQueryWrapper<TjOrderDetail> qww = new LambdaQueryWrapper<>(); |
| | | // qww.eq(TjOrderDetail::getOrderId, order.getOrderId()); |
| | | // qww.eq(TjOrderDetail::getTjStatus, 0); |
| | | // qww.isNotNull(TjOrderDetail::getFlowingWaterId); |
| | | // List<TjOrderDetail> lists = tjOrderDetailService.list(qww); |
| | | // if (null != lists && lists.size() > 0) { |
| | | // continue; |
| | | // } |
| | | // |
| | | // TjCustomer customer = tjCustomerService.getById(order.getUserId()); |
| | | // if (null != customer) { |
| | | // customer.setCusName(hideCusName(customer.getCusName())); |
| | | // customer.setCusPhone(hidePhoneNum(customer.getCusPhone())); |
| | | // customer.setCusIdcard(hideIdCardNum(customer.getCusIdcard())); |
| | | // if (order.getTjType().equals("1")) { |
| | | // customer.setTjType("团体"); |
| | | // } |
| | | // if (order.getTjType().equals("2")) { |
| | | // customer.setTjType("个人"); |
| | | // } |
| | | // customer.setTjTime(order.getCreateTime()); |
| | | // customer.setTjNumber(order.getTjNumber()); |
| | | // customer.setTjStatus(1L); |
| | | // LambdaQueryWrapper<TjOrderRemark> wq = new LambdaQueryWrapper<>(); |
| | | // wq.eq(TjOrderRemark::getTjNumber, order.getTjNumber()); |
| | | // wq.in(TjOrderRemark::getType, 0,3); |
| | | // List<TjOrderRemark> list = orderRemarkService.list(wq); |
| | | // if (null != list && list.size() > 0) { |
| | | // StringBuilder stringBuilder = new StringBuilder(); |
| | | // for (TjOrderRemark remark : list) { |
| | | // TjProject byId = projectService.getById(remark.getProId()); |
| | | // stringBuilder.append(byId.getProName()).append(";"); |
| | | // } |
| | | // customer.setNotCheckeds(String.valueOf(stringBuilder)); |
| | | // if(null ==customer.getNotCheckeds())customer.setNotCheckeds("全部已检"); |
| | | // } |
| | | // customerLis.add(customer); |
| | | // } |
| | | // } |
| | | // } |
| | | // } |
| | | // return customerLis; |
| | | // } |
| | | // |
| | | // //未检 |
| | | // public List<TjCustomer> getWjAjaxResult(List<Long> ksproList) { |
| | | // List<TjCustomer> customerLis = new ArrayList<>(); |
| | | // LambdaQueryWrapper<TjOrderDetail> wq1 = new LambdaQueryWrapper<>(); |
| | | // wq1.eq(TjOrderDetail::getTjStatus, 0); |
| | | // wq1.in(TjOrderDetail::getProId, ksproList); |
| | | // wq1.isNotNull(TjOrderDetail::getFlowingWaterId); |
| | | // wq1.orderByDesc(TjOrderDetail::getCreateTime); |
| | | // List<TjOrderDetail> detailList = tjOrderDetailService.list(wq1); |
| | | // if (null != detailList && detailList.size() > 0) { |
| | | // //收集orderId并去重 |
| | | // List<Long> orderIds = detailList.stream().collect(Collectors.collectingAndThen(Collectors.toCollection( |
| | | // () -> new TreeSet<>(Comparator.comparing(TjOrderDetail::getOrderId)) |
| | | // ), ArrayList::new)).stream().map(TjOrderDetail::getOrderId).collect(Collectors.toList()); |
| | | // for (Long orderId : orderIds) { |
| | | // if (null != orderId) { |
| | | // TjOrder order = orderService.getById(orderId); |
| | | // if(null ==order){ |
| | | // continue; |
| | | // } |
| | | // TjCustomer customer = tjCustomerService.getById(order.getUserId()); |
| | | // if (null != customer) { |
| | | // customer.setCusName(hideCusName(customer.getCusName())); |
| | | // customer.setCusPhone(hidePhoneNum(customer.getCusPhone())); |
| | | // customer.setCusIdcard(hideIdCardNum(customer.getCusIdcard())); |
| | | // |
| | | // if (order.getTjType().equals("1")) { |
| | | // customer.setTjType("团体"); |
| | | // } |
| | | // if (order.getTjType().equals("2")) { |
| | | // customer.setTjType("个人"); |
| | | // } |
| | | // customer.setTjTime(order.getCreateTime()); |
| | | // customer.setTjNumber(order.getTjNumber()); |
| | | // customer.setTjStatus(0L); |
| | | // LambdaQueryWrapper<TjOrderRemark> wq = new LambdaQueryWrapper<>(); |
| | | // wq.eq(TjOrderRemark::getTjNumber, order.getTjNumber()); |
| | | // wq.in(TjOrderRemark::getType, 0,3); |
| | | // List<TjOrderRemark> list = orderRemarkService.list(wq); |
| | | // if (null != list && list.size() > 0) { |
| | | // StringBuilder stringBuilder = new StringBuilder(); |
| | | // for (TjOrderRemark remark : list) { |
| | | // TjProject byId = projectService.getById(remark.getProId()); |
| | | // stringBuilder.append(byId.getProName()).append(";"); |
| | | // } |
| | | // customer.setNotCheckeds(String.valueOf(stringBuilder)); |
| | | // if(null ==customer.getNotCheckeds())customer.setNotCheckeds("全部已检"); |
| | | // } |
| | | // customerLis.add(customer); |
| | | // } |
| | | // } |
| | | // } |
| | | // } |
| | | // return customerLis; |
| | | // } |
| | | // |
| | | // //已审 |
| | | // private List<TjCustomer> getYsResult(String config) { |
| | | // List<TjOrder> orderList = null; |
| | | // if("Y".equals(config)){ |
| | | // orderList = orderService.getCsTjOrderList1(null,1,null,null,null); |
| | | // }else { |
| | | // orderList = orderService.getTjOrderList(null,1,null,null,null); |
| | | // } |
| | | // List<TjCustomer> customerList = new ArrayList<>(); |
| | | // if(null !=orderList && orderList.size()>0){ |
| | | // for (TjOrder tjOrder : orderList) { |
| | | // if (null != tjOrder) { |
| | | // TjCustomer customer = tjCustomerService.selectTjCustomerByCusId(tjOrder.getUserId()); |
| | | // if (customer == null) { |
| | | // continue; |
| | | // } |
| | | // customer.setCusName(hideCusName(customer.getCusName())); |
| | | // customer.setCusPhone(hidePhoneNum(customer.getCusPhone())); |
| | | // customer.setCusIdcard(hideIdCardNum(customer.getCusIdcard())); |
| | | // customer.setTjNumber(tjOrder.getTjNumber()); |
| | | // customer.setTjStatus(Long.valueOf(tjOrder.getCheckStatus())); |
| | | // customer.setOrderId(tjOrder.getOrderId()); |
| | | // customer.setTjTime(tjOrder.getCreateTime()); |
| | | // customer.setFinishTime(tjOrder.getFinishTime()); |
| | | // customer.setConfirmStatus(String.valueOf(tjOrder.getStatus())); |
| | | // if (tjOrder.getFirmId() == null) { |
| | | // customer.setTjCompName("无"); |
| | | // } else { |
| | | // DictComp byId = compService.selectDictCompByDrugManufacturerId(tjOrder.getFirmId()); |
| | | // if (byId != null) { |
| | | // customer.setTjCompName(byId.getCnName()); |
| | | // } |
| | | // } |
| | | // customerList.add(customer); |
| | | // } |
| | | // } |
| | | // } |
| | | // return customerList; |
| | | // } |
| | | // |
| | | // //未审 |
| | | // private List<TjCustomer> getWsResult(String config) { |
| | | // List<TjOrder> orderList = null; |
| | | // if("Y".equals(config)){ |
| | | // orderList = orderService.getCsTjOrderList1(null,0,null,null,null); |
| | | // }else { |
| | | // orderList = orderService.getTjOrderList(null,0,null,null,null); |
| | | // } |
| | | // List<TjCustomer> customerList = new ArrayList<>(); |
| | | // if(null !=orderList && orderList.size()>0) { |
| | | // for (TjOrder tjOrder : orderList) { |
| | | // if (null != tjOrder) { |
| | | // TjCustomer customer = tjCustomerService.selectTjCustomerByCusId(tjOrder.getUserId()); |
| | | // if (customer == null) { |
| | | // continue; |
| | | // } |
| | | // customer.setCusName(hideCusName(customer.getCusName())); |
| | | // customer.setCusPhone(hidePhoneNum(customer.getCusPhone())); |
| | | // customer.setCusIdcard(hideIdCardNum(customer.getCusIdcard())); |
| | | // customer.setTjNumber(tjOrder.getTjNumber()); |
| | | // customer.setTjStatus(Long.valueOf(tjOrder.getCheckStatus())); |
| | | // customer.setOrderId(tjOrder.getOrderId()); |
| | | // customer.setTjTime(tjOrder.getCreateTime()); |
| | | // customer.setFinishTime(tjOrder.getFinishTime()); |
| | | // customer.setConfirmStatus(String.valueOf(tjOrder.getStatus())); |
| | | // if (tjOrder.getFirmId() == null) { |
| | | // customer.setTjCompName("无"); |
| | | // } else { |
| | | // DictComp byId = compService.selectDictCompByDrugManufacturerId(tjOrder.getFirmId()); |
| | | // if (byId != null) { |
| | | // customer.setTjCompName(byId.getCnName()); |
| | | // } |
| | | // } |
| | | // customerList.add(customer); |
| | | // } |
| | | // } |
| | | // } |
| | | // return customerList; |
| | | // } |
| | | // |
| | | // private AjaxResult getAjaxResult(String tjNumber) { |
| | | // List<Map<String, Object>> list = new ArrayList<>(); |
| | | // TjOrder one = orderService.getOrderByTjNum(tjNumber); |
| | | // |
| | | // if (one == null) { |
| | | // return AjaxResult.error("暂无数据!!"); |
| | | // } |
| | | // |
| | | // TjCustomer customer = tjCustomerService.getById(one.getUserId()); |
| | | // List<TjOrderRemark> remarkList = orderRemarkService.getRemarkListByTjNumAndType(tjNumber); |
| | | // |
| | | // if (null != remarkList && remarkList.size() > 0) { |
| | | // for (TjOrderRemark remark : remarkList) { |
| | | // Map<String, Object> parent = new HashMap<>(); |
| | | // parent.put("checkAdvice", one.getCheckAdvice()); |
| | | // TjProject project = projectService.selectTjProjectByProId(remark.getProId()); |
| | | // if (null != project) { |
| | | // parent.put("parent", project.getProName()); |
| | | // parent.put("parentId", project.getProId().toString()); |
| | | // } |
| | | // List<TjOrderDetail> tjOrderDetails = tjOrderDetailService.getDetailByOrderIdAndParId(one.getOrderId(), remark.getProId()); |
| | | // if (null != tjOrderDetails && tjOrderDetails.size() > 0) { |
| | | // for (TjOrderDetail tjOrderDetail : tjOrderDetails) { |
| | | // final TjProject byId = projectService.selectTjProjectByProId(tjOrderDetail.getProId()); |
| | | // tjOrderDetail.setProject(byId); |
| | | // List<TjStandard> list2 = tjStandardService.getTjStandardListByProId(String.valueOf(tjOrderDetail.getProId())); |
| | | // if (list2.size() == 0) { |
| | | // tjOrderDetail.setStandard(new TjStandard()); |
| | | // } else if (list2.size() == 1) { |
| | | // tjOrderDetail.setStandard(list2.get(0)); |
| | | // } else { |
| | | // final int ageType = StringUtils.getAgeType(DateUtil.ageOfNow(customer.getCusBrithday())); |
| | | // TjStandard tjStandard1=tjStandardService.getListBySexAndType(customer.getCusSex(),ageType, String.valueOf(tjOrderDetail.getProId())); |
| | | // tjOrderDetail.setStandard(tjStandard1); |
| | | // } |
| | | // } |
| | | // String summary = remark.getSummary(); |
| | | // if (null != summary) { |
| | | // String[] split = summary.split(";"); |
| | | // parent.put("parentAdvice", tjAdviceService.getAdviceStringByIds(Arrays.asList(split))); |
| | | // |
| | | // } else { |
| | | // parent.put("parentAdvice", null); |
| | | // } |
| | | // parent.put("sons", tjOrderDetails); |
| | | // parent.put("remark", remark.getRemark()); |
| | | //// if (remark.getDoctorName() != null && null != userService.getById(remark.getDoctorName())) { |
| | | //// parent.put("doctorName", userService.getById(remark.getDoctorName()).getNickName()); |
| | | //// } |
| | | // list.add(parent); |
| | | // } else { |
| | | // return AjaxResult.success("该客户没有体检项目数据"); |
| | | // } |
| | | //// } |
| | | // } |
| | | // return AjaxResult.success(list); |
| | | // } |
| | | // return AjaxResult.success("该客户没有体检项目数据!"); |
| | | // } |
| | | // |
| | | // //已签收/未签收 |
| | | // private List<Map<String, Object>> getYWqsResult(int a) { |
| | | // LambdaQueryWrapper<TjSampling>wq=new LambdaQueryWrapper<>(); |
| | | // List<Map<String,Object>> arrayList=new ArrayList<>(); |
| | | // wq.orderByDesc(TjSampling::getApplicationTime); |
| | | // wq.eq(TjSampling::getIsSignFor,a); |
| | | // List<TjSampling> list = tjSamplingService.list(wq); |
| | | // if(null != list && list.size()>0 ){ |
| | | // Map<String, List<TjSampling>> stringListMap = list.stream().collect(Collectors.groupingBy(TjSampling::getCusId)); |
| | | // for (Map.Entry<String, List<TjSampling>> entry : stringListMap.entrySet()) { |
| | | // Map<String,Object>map=new HashMap<>(); |
| | | // TjCustomer customer = tjCustomerService.getById(entry.getKey()); |
| | | // if (customer==null){ |
| | | // continue; |
| | | // } |
| | | // customer.setCusName(hideCusName(customer.getCusName())); |
| | | // customer.setCusPhone(hidePhoneNum(customer.getCusPhone())); |
| | | // customer.setCusIdcard(hideIdCardNum(customer.getCusIdcard())); |
| | | // customer.setTjNumber(entry.getValue().get(0).getTjNum()); |
| | | // customer.setApplicationTime(entry.getValue().get(0).getApplicationTime()); |
| | | // List<TjSampling> samplings = entry.getValue(); |
| | | // if(null !=samplings && samplings.size()>0){ |
| | | // List<TjSampling> projectList=new ArrayList<>(); |
| | | // for (TjSampling sampling : samplings) { |
| | | // TjProject project = projectService.getById(sampling.getProId()); |
| | | // if(null !=project && project.getProParentId()==0){ |
| | | // projectList.add(sampling); |
| | | // } |
| | | // } |
| | | // map.put("list",projectList); |
| | | // } |
| | | // map.put("customer",customer); |
| | | // arrayList.add(map); |
| | | // } |
| | | // } |
| | | // return arrayList; |
| | | // } |
| | | // |
| | | // |
| | | // /** |
| | | // * 隐藏手机号 |
| | | // * |
| | | // * @param phoneNum |
| | | // * @return |
| | | // */ |
| | | // public static String hidePhoneNum(String phoneNum){ |
| | | // if(phoneNum.contains("*")){ |
| | | // return phoneNum; |
| | | // } |
| | | // Pattern pattern = Pattern.compile("((13[0-9])|(14[5,7,9])|(15([0-3]|[5-9]))|(17[0,1,3,5,6,7,8])|(18[0-9])|(19[8|9]))\\d{8}"); |
| | | // Matcher matcher = pattern.matcher(phoneNum); |
| | | // StringBuffer sb = new StringBuffer(); |
| | | // try { |
| | | // while(matcher.find()) { |
| | | // String phoneStr = matcher.group(); |
| | | // phoneStr = phoneStr.substring(0, 3) + "****" + phoneStr.substring(7, phoneStr.length()); |
| | | // matcher.appendReplacement(sb,phoneStr); |
| | | // } |
| | | // matcher.appendTail(sb); |
| | | // } catch (Exception ex) { |
| | | // ex.printStackTrace(); |
| | | // } |
| | | // return sb.toString(); |
| | | // } |
| | | // |
| | | // /** |
| | | // * 隐藏身份证号码 |
| | | // * |
| | | // * @param idCardNum |
| | | // * @return |
| | | // */ |
| | | // public static String hideIdCardNum(String idCardNum){ |
| | | // if(idCardNum.contains("*")){ |
| | | // return idCardNum; |
| | | // } |
| | | // Pattern pattern = Pattern.compile("(\\d{6})(19|20)(\\d{2})(1[0-2]|0[1-9])(0[1-9]|[1-2][0-9]|3[0-1])(\\d{3})(\\d|X|x)"); |
| | | // Matcher matcher = pattern.matcher(idCardNum); |
| | | // StringBuffer sb = new StringBuffer(); |
| | | // try { |
| | | // while(matcher.find()) { |
| | | // String idCardStr = matcher.group(); |
| | | // int len=idCardStr.length(); |
| | | // if(len>=9){ |
| | | // idCardStr = idCardStr.replaceAll("(.{"+(len<12?3:6)+"})(.*)(.{4})", "$1" + "****" + "$3"); |
| | | // } |
| | | // matcher.appendReplacement(sb,idCardStr); |
| | | // } |
| | | // matcher.appendTail(sb); |
| | | // } catch (Exception ex) { |
| | | // ex.printStackTrace(); |
| | | // } |
| | | // return sb.toString(); |
| | | // } |
| | | // |
| | | // |
| | | // /** |
| | | // * 隐藏用户姓名 |
| | | // * |
| | | // * @param cusName |
| | | // * @return |
| | | // */ |
| | | // public static String hideCusName(String cusName){ |
| | | // if(!cusName.contains("*")){ |
| | | // String realname=null; |
| | | // char[] r = cusName.toCharArray(); |
| | | // if(r.length ==1){ |
| | | // realname = cusName; |
| | | // } |
| | | // if(r.length == 2){ |
| | | // realname = cusName.replaceFirst(cusName.substring(1),"*"); |
| | | // } |
| | | // if (r.length > 2) { |
| | | // realname = cusName.replaceFirst(cusName.substring(1,r.length-1) ,"*"); |
| | | // } |
| | | // return realname; |
| | | // } |
| | | // return cusName; |
| | | // } |
| | | // |
| | | // |
| | | // //临时表添加单项 |
| | | // public void saveRedisTransitionByProId(String cusId, List<Long> proIds) { |
| | | // for (Long proId : proIds) { |
| | | // if (null != transitionService.getTbTransitionListByCusIdAndPacIdAndProId(cusId, String.valueOf(proId)) && transitionService.getTbTransitionListByCusIdAndPacIdAndProId(cusId, String.valueOf(proId)).size() > 0) { |
| | | // continue; |
| | | // } |
| | | // transitionService.saveRedisTransitionByProId(cusId,proId); |
| | | // } |
| | | // } |
| | | //} |