| | |
| | | import com.doumee.dao.business.join.*; |
| | | import com.doumee.dao.business.model.*; |
| | | import com.doumee.dao.business.vo.CountCyclePriceVO; |
| | | import com.doumee.dao.system.model.SystemUser; |
| | | import com.doumee.service.business.SmsEmailService; |
| | | import com.doumee.service.business.UnionChangeService; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | |
| | | |
| | | @Autowired |
| | | private ApplyLogMapper applyLogMapper; |
| | | |
| | | @Autowired |
| | | private ApplyLogJoinMapper applyLogJoinMapper; |
| | | @Override |
| | | public Integer create(UnionChange unionChange) { |
| | | unionChangeMapper.insert(unionChange); |
| | |
| | | .eq(UnionChange::getId,id) |
| | | .last(" limit 1 ") |
| | | ); |
| | | |
| | | if(!Objects.isNull(unionChange)){ |
| | | //查询操作记录 |
| | | List<ApplyLog> applyLogList = applyLogJoinMapper.selectJoinList(ApplyLog.class, |
| | | new MPJLambdaWrapper<ApplyLog>() |
| | | .selectAll(ApplyLog.class) |
| | | .selectAs(SystemUser::getRealname,ApplyLog::getCreatorName) |
| | | .selectAs(Company::getName,ApplyLog::getCompanyName) |
| | | .selectAs(SystemUser::getType,ApplyLog::getCreatorType) |
| | | .leftJoin(SystemUser.class,SystemUser::getId,ApplyLog::getCreator) |
| | | .leftJoin(Company.class,Company::getId,SystemUser::getCompanyId) |
| | | .in(ApplyLog::getObjType,Constants.ApplyLogType.getTypeList(Constants.THREE)) |
| | | .eq(ApplyLog::getApplyId,unionChange.getId()) |
| | | .orderByAsc(ApplyLog::getCreateDate) |
| | | ); |
| | | unionChange.setApplyLogList(applyLogList); |
| | | } |
| | | return unionChange; |
| | | } |
| | | |
| | |
| | | IPage<UnionChange> page = new Page<>(pageWrap.getPage(), pageWrap.getCapacity()); |
| | | MPJLambdaWrapper<UnionChange> queryWrapper = new MPJLambdaWrapper<>(); |
| | | queryWrapper.selectAll(UnionChange.class); |
| | | queryWrapper.selectAs(UnionApply::getCode,UnionChange::getApplyCode) |
| | | queryWrapper.selectAs(UnionApply::getCode,UnionChange::getApplyCode); |
| | | queryWrapper.selectAs(Solutions::getName,UnionChange::getSolutionsName) |
| | | .select("( select count(1) from apply_chagne_detail ad where t.id = ad.UNION_CHANGE_ID and ad.TYPE = 0 )",UnionChange::getAddNum) |
| | | .select("( select count(1) from apply_chagne_detail ad where t.id = ad.UNION_CHANGE_ID and ad.TYPE = 1 )",UnionChange::getDelNum) |
| | | .select("( select count(1) from apply_chagne_detail ad where t.id = ad.UNION_CHANGE_ID and ad.TYPE = 2 )",UnionChange::getChangeNum); |
| | | queryWrapper.leftJoin(UnionApply.class,UnionApply::getId,UnionChange::getUnionApplyId); |
| | | queryWrapper.leftJoin(Solutions.class,Solutions::getId,UnionApply::getSolutionId); |
| | | LoginUserInfo user = (LoginUserInfo) SecurityUtils.getSubject().getPrincipal(); |
| | | if(user.getType().equals(Constants.TWO)){ |
| | | if(Constants.equalsInteger(user.getType(),Constants.TWO)){ |
| | | queryWrapper.eq(UnionChange::getShopId, pageWrap.getModel().getShopId()); |
| | | } |
| | | Utils.MP.blankToNull(pageWrap.getModel()); |
| | |
| | | .leftJoin(InsuranceApply.class,InsuranceApply::getId,ApplyChange::getApplyId) |
| | | .eq(ApplyChange::getIsdeleted, Constants.ZERO) |
| | | .eq(InsuranceApply::getUnionApplyId,saveUnionChangeDTO.getUnionApplyId()) |
| | | .eq(ApplyChange::getStatus,Constants.ApplyChangeStatus.PALTFORM_CHECK_PASS.getKey()) |
| | | .eq(ApplyChange::getStatus,Constants.ApplyChangeStatus.COMPANY_SIGN.getKey()) |
| | | .eq(InsuranceApply::getStatus,Constants.InsuranceApplyStatus.UPLOAD_INSURANCE.getKey()) |
| | | .eq(ApplyChange::getType,saveUnionChangeDTO.getBusinessType()) |
| | | .in(ApplyChange::getId,saveUnionChangeDTO.getApplyIds()) |
| | |
| | | .set(ApplyChange::getUnionChangeId,unionChange.getId()) |
| | | .set(ApplyChange::getCheckDate,new Date()) |
| | | .set(ApplyChange::getCheckUserId,user.getId()) |
| | | .set(ApplyChange::getStatus,Constants.ApplyChangeStatus.WTB_TOUBAOING.getKey()) |
| | | .in(ApplyChange::getId,saveUnionChangeDTO.getApplyIds()) |
| | | ); |
| | | |
| | |
| | | .set(ApplyChange::getUnionChangeId,null) |
| | | .set(ApplyChange::getCheckDate,new Date()) |
| | | .set(ApplyChange::getCheckUserId,user.getId()) |
| | | .set(ApplyChange::getStatus,Constants.ApplyChangeStatus.COMPANY_SIGN.getKey()) |
| | | .in(ApplyChange::getUnionChangeId,unionChange.getId()) |
| | | ); |
| | | |