| | |
| | | import com.ycl.platform.domain.form.CalculateMoneyRuleForm; |
| | | import com.ycl.platform.domain.vo.CalculateMoneyRuleVO; |
| | | import com.ycl.platform.domain.query.CalculateMoneyRuleQuery; |
| | | |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | import org.apache.commons.lang3.StringUtils; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | |
| | | @Override |
| | | public Result add(CalculateMoneyRuleForm form) { |
| | | CalculateMoneyRule entity = CalculateMoneyRuleForm.getEntityByForm(form, null); |
| | | Date now = new Date(); |
| | | entity.setCreateTime(now); |
| | | entity.setUpdateTime(now); |
| | | if(baseMapper.insert(entity) > 0) { |
| | | return Result.ok("添加成功"); |
| | | } |
| | |
| | | public Result update(CalculateMoneyRuleForm form) { |
| | | |
| | | CalculateMoneyRule entity = baseMapper.selectById(form.getId()); |
| | | |
| | | // 为空抛IllegalArgumentException,做全局异常处理 |
| | | Assert.notNull(entity, "记录不存在"); |
| | | BeanUtils.copyProperties(form, entity); |
| | | Date now = new Date(); |
| | | entity.setUpdateTime(now); |
| | | |
| | | if (baseMapper.updateById(entity) > 0) { |
| | | return Result.ok("修改成功"); |
| | | } |
| | |
| | | import com.ycl.platform.domain.form.CalculateRecordForm; |
| | | import com.ycl.platform.domain.vo.CalculateRecordVO; |
| | | import com.ycl.platform.domain.query.CalculateRecordQuery; |
| | | |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | import org.apache.commons.lang3.StringUtils; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | |
| | | @Override |
| | | public Result add(CalculateRecordForm form) { |
| | | CalculateRecord entity = CalculateRecordForm.getEntityByForm(form, null); |
| | | Date now = new Date(); |
| | | entity.setCreateTime(now); |
| | | entity.setUpdateTime(now); |
| | | if(baseMapper.insert(entity) > 0) { |
| | | return Result.ok("添加成功"); |
| | | } |
| | |
| | | public Result update(CalculateRecordForm form) { |
| | | |
| | | CalculateRecord entity = baseMapper.selectById(form.getId()); |
| | | |
| | | // 为空抛IllegalArgumentException,做全局异常处理 |
| | | Assert.notNull(entity, "记录不存在"); |
| | | BeanUtils.copyProperties(form, entity); |
| | | Date now = new Date(); |
| | | entity.setUpdateTime(now); |
| | | if (baseMapper.updateById(entity) > 0) { |
| | | return Result.ok("修改成功"); |
| | | } |
| | |
| | | import java.math.BigDecimal; |
| | | import java.net.URLEncoder; |
| | | import java.nio.charset.StandardCharsets; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | import java.util.Objects; |
| | | import java.util.stream.Collectors; |
| | |
| | | @Override |
| | | public Result add(CalculateReportForm form) { |
| | | CalculateReport entity = CalculateReportForm.getEntityByForm(form, null); |
| | | Date now = new Date(); |
| | | entity.setCreateTime(now); |
| | | entity.setUpdateTime(now); |
| | | if(baseMapper.insert(entity) > 0) { |
| | | return Result.ok("添加成功"); |
| | | } |
| | |
| | | public Result update(CalculateReportForm form) { |
| | | |
| | | CalculateReport entity = baseMapper.selectById(form.getId()); |
| | | |
| | | // 为空抛IllegalArgumentException,做全局异常处理 |
| | | Assert.notNull(entity, "记录不存在"); |
| | | BeanUtils.copyProperties(form, entity); |
| | | Date now = new Date(); |
| | | entity.setUpdateTime(now); |
| | | if (baseMapper.updateById(entity) > 0) { |
| | | return Result.ok("修改成功"); |
| | | } |
| | |
| | | import com.ycl.platform.domain.form.NotifyForm; |
| | | import com.ycl.platform.domain.vo.NotifyVO; |
| | | import com.ycl.platform.domain.query.NotifyQuery; |
| | | |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | |
| | | @Override |
| | | public Result add(NotifyForm form) { |
| | | Notify entity = NotifyForm.getEntityByForm(form, null); |
| | | Date now = new Date(); |
| | | entity.setCreateTime(now); |
| | | entity.setUpdateTime(now); |
| | | if(baseMapper.insert(entity) > 0) { |
| | | return Result.ok("添加成功"); |
| | | } |
| | |
| | | public Result update(NotifyForm form) { |
| | | |
| | | Notify entity = baseMapper.selectById(form.getId()); |
| | | |
| | | // 为空抛IllegalArgumentException,做全局异常处理 |
| | | Assert.notNull(entity, "记录不存在"); |
| | | BeanUtils.copyProperties(form, entity); |
| | | Date now = new Date(); |
| | | entity.setUpdateTime(now); |
| | | if (baseMapper.updateById(entity) > 0) { |
| | | return Result.ok("修改成功"); |
| | | } |
| | |
| | | import org.springframework.util.Assert; |
| | | import org.springframework.util.CollectionUtils; |
| | | |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | import java.util.stream.Collectors; |
| | | |
| | |
| | | public Result add(PlatformForm form) { |
| | | Platform entity = PlatformForm.getEntityByForm(form, null); |
| | | entity.setParentId(0); |
| | | Date now = new Date(); |
| | | entity.setCreateTime(now); |
| | | entity.setUpdateTime(now); |
| | | baseMapper.insert(entity); |
| | | if (! CollectionUtils.isEmpty(form.getDeployList())) { |
| | | List<Platform> childList = form.getDeployList().stream().map(deploy -> { |
| | | Platform child = new Platform(); |
| | | BeanUtils.copyProperties(deploy, child); |
| | | child.setParentId(entity.getId()); |
| | | child.setCreateTime(now); |
| | | child.setUpdateTime(now); |
| | | return child; |
| | | }).collect(Collectors.toList()); |
| | | this.saveBatch(childList); |
| | |
| | | import com.ycl.platform.domain.form.RegionForm; |
| | | import com.ycl.platform.domain.vo.RegionVO; |
| | | import com.ycl.platform.domain.query.RegionQuery; |
| | | |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | | import com.ycl.utils.DateUtils; |
| | |
| | | public Result add(RegionForm form) { |
| | | Region entity = RegionForm.getEntityByForm(form, null); |
| | | entity.setRegionLevel(RegionLevelEnum.STREET); |
| | | Date now = new Date(); |
| | | entity.setCreateTime(now); |
| | | entity.setUpdateTime(now); |
| | | if(baseMapper.insert(entity) > 0) { |
| | | return Result.ok("添加成功"); |
| | | } |
| | |
| | | public Result update(RegionForm form) { |
| | | |
| | | Region entity = baseMapper.selectById(form.getId()); |
| | | |
| | | // 为空抛IllegalArgumentException,做全局异常处理 |
| | | Assert.notNull(entity, "记录不存在"); |
| | | BeanUtils.copyProperties(form, entity); |
| | | Date now = new Date(); |
| | | entity.setUpdateTime(now); |
| | | if (baseMapper.updateById(entity) > 0) { |
| | | return Result.ok("修改成功"); |
| | | } |
| | |
| | | Report entity = ReportForm.getEntityByForm(form, null); |
| | | entity.setStatus(0); |
| | | entity.setIdentify(IdUtils.timeAddRandomNO(3)); |
| | | Date now = new Date(); |
| | | entity.setCreateTime(now); |
| | | entity.setUpdateTime(now); |
| | | if(baseMapper.insert(entity) > 0) { |
| | | return Result.ok("添加成功"); |
| | | } |
| | |
| | | Report entity = baseMapper.selectById(form.getId()); |
| | | // 为空抛IllegalArgumentException,做全局异常处理 |
| | | Assert.notNull(entity, "记录不存在"); |
| | | |
| | | Date now = new Date(); |
| | | entity.setUpdateTime(now); |
| | | if (0 == entity.getStatus()) { |
| | | // 待审核的直接改 |
| | | BeanUtils.copyProperties(form, entity); |
| | |
| | | errorType = errorType + "," + workOrder.getErrorType(); |
| | | databaseWorkOrder.setErrorType(errorType); |
| | | databaseWorkOrder.setStatus(WorkOrderStatusEnum.DISTRIBUTED); |
| | | Date now = new Date(); |
| | | databaseWorkOrder.setUpdateTime(now); |
| | | baseMapper.updateById(databaseWorkOrder); |
| | | updateNum++; |
| | | // 同时新增一个运维处理信息,表明此工单被调整 TODO |
| | |
| | | workOrderDistributeRecord.setWorkOrderId(item.getId()); |
| | | workOrderDistributeRecord.setDistributeWay(WorkOrderDistributeWayEnum.DIRECT_DISTRIBUTE); |
| | | workOrderDistributeRecord.setUserId(1L); |
| | | Date now = new Date(); |
| | | workOrderDistributeRecord.setCreateTime(now); |
| | | workOrderDistributeRecord.setUpdateTime(now); |
| | | return workOrderDistributeRecord; |
| | | }).collect(Collectors.toList()); |
| | | workOrderDistributeRecordMapper.insertBatch(distributedRecordList); |
| | |
| | | entity.setWorkOrderNo(IdUtils.timeAddRandomNO(5)); |
| | | entity.setCreateTime(DateUtils.getNowDate()); |
| | | entity.setStatus(WorkOrderStatusEnum.WAIT_DISTRIBUTE); |
| | | Date now = new Date(); |
| | | entity.setCreateTime(now); |
| | | entity.setUpdateTime(now); |
| | | if(baseMapper.insert(entity) > 0) { |
| | | return Result.ok("添加成功"); |
| | | } |
| | |
| | | public Result update(WorkOrderForm form) { |
| | | |
| | | WorkOrder entity = baseMapper.selectById(form.getId()); |
| | | |
| | | // 为空抛IllegalArgumentException,做全局异常处理 |
| | | Assert.notNull(entity, "记录不存在"); |
| | | BeanUtils.copyProperties(form, entity); |
| | | Date now = new Date(); |
| | | entity.setUpdateTime(now); |
| | | if (baseMapper.updateById(entity) > 0) { |
| | | return Result.ok("修改成功"); |
| | | } |
| | |
| | | import com.ycl.platform.domain.query.YwPeopleQuery; |
| | | |
| | | import java.util.Collections; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | |
| | | YwPeople entity = YwPeopleForm.getEntityByForm(form, null); |
| | | entity.setUserId(sysUser.getUserId()); |
| | | entity.setAddWay("manual"); |
| | | Date now = new Date(); |
| | | entity.setCreateTime(now); |
| | | entity.setUpdateTime(now); |
| | | if(baseMapper.insert(entity) > 0) { |
| | | return Result.ok("添加成功"); |
| | | } |
| | |
| | | sysUserMapper.updateUser(sysUser); |
| | | |
| | | BeanUtils.copyProperties(form, entity); |
| | | Date now = new Date(); |
| | | entity.setUpdateTime(now); |
| | | if (baseMapper.updateById(entity) > 0) { |
| | | return Result.ok("修改成功"); |
| | | } |
| | |
| | | @Override |
| | | public Result add(YwPointForm form) { |
| | | YwPoint entity = YwPointForm.getEntityByForm(form, null); |
| | | Date now = new Date(); |
| | | entity.setCreateTime(now); |
| | | entity.setUpdateTime(now); |
| | | if(baseMapper.insert(entity) > 0) { |
| | | return Result.ok("添加成功"); |
| | | } |
| | |
| | | .forEach(form -> { |
| | | YwPoint entity = YwPointForm.getEntityByForm(form, null); |
| | | entity.setStatus("未开始"); |
| | | Date now = new Date(); |
| | | entity.setCreateTime(now); |
| | | entity.setUpdateTime(now); |
| | | baseMapper.insert(entity); |
| | | }); |
| | | return Result.ok("添加成功"); |
| | |
| | | new LambdaUpdateChainWrapper<>(baseMapper) |
| | | .in(YwPoint::getId, form.getIds()) |
| | | .set(YwPoint::getUnitId, form.getUnitId()) |
| | | .set(YwPoint::getUpdateTime, new Date()) |
| | | .update(); |
| | | } else { |
| | | new LambdaUpdateChainWrapper<>(baseMapper) |
| | |
| | | .set(YwPoint::getUnitId, form.getUnitId()) |
| | | .set(YwPoint::getStartTime, null) |
| | | .set(YwPoint::getEndTime, null) |
| | | .set(YwPoint::getUpdateTime, new Date()) |
| | | .update(); |
| | | } |
| | | return Result.ok("修改成功"); |
| | |
| | | YwPoint entity = baseMapper.selectById(form.getId()); |
| | | Assert.notNull(entity, "记录不存在"); |
| | | BeanUtils.copyProperties(form, entity); |
| | | Date now = new Date(); |
| | | entity.setUpdateTime(now); |
| | | baseMapper.updateById(entity); |
| | | return Result.ok("修改成功"); |
| | | } |
| | |
| | | return new LambdaUpdateChainWrapper<>(baseMapper) |
| | | .in(YwPoint::getSerialNumber, serialNumberList) |
| | | .set(YwPoint::getRecovery, recovery) |
| | | .set(YwPoint::getUpdateTime, new Date()) |
| | | .set(recovery == 0, YwPoint::getRecoveryTime, DateUtils.getNowDate()) |
| | | .update(); |
| | | } |
| | |
| | | import org.springframework.util.Assert; |
| | | import org.springframework.util.StringUtils; |
| | | |
| | | import java.util.Collections; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import java.util.Objects; |
| | | import java.util.*; |
| | | import java.util.stream.Collectors; |
| | | |
| | | /** |
| | |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public Result add(YwUnitForm form) { |
| | | YwUnit entity = YwUnitForm.getEntityByForm(form, null); |
| | | Date now = new Date(); |
| | | entity.setCreateTime(now); |
| | | entity.setUpdateTime(now); |
| | | if(baseMapper.insert(entity) > 0) { |
| | | // 新增运维人员账号 |
| | | SysUser sysUser = new SysUser(); |
| | |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public Result update(YwUnitForm form) { |
| | | YwUnit entity = baseMapper.selectById(form.getId()); |
| | | |
| | | // 为空抛IllegalArgumentException,做全局异常处理 |
| | | Assert.notNull(entity, "记录不存在"); |
| | | BeanUtils.copyProperties(form, entity); |
| | | Date now = new Date(); |
| | | entity.setUpdateTime(now); |
| | | if (baseMapper.updateById(entity) > 0) { |
| | | // 修改运维单位账号信息 |
| | | SysUser sysUser = sysUserMapper.selectUserByUserName(entity.getUnitAdminAccount()); |