| | |
| | | import com.ycl.platform.base.BaseSelect; |
| | | import com.ycl.platform.domain.entity.YwUnit; |
| | | import com.ycl.platform.domain.form.YwUnitForm; |
| | | import com.ycl.platform.domain.query.DistributeWorkOrderQuery; |
| | | import com.ycl.platform.domain.query.YwUnitQuery; |
| | | import com.ycl.platform.domain.vo.YwUnitVO; |
| | | import com.ycl.platform.mapper.YwUnitMapper; |
| | |
| | | import com.ycl.utils.DateUtils; |
| | | import com.ycl.utils.SecurityUtils; |
| | | import lombok.RequiredArgsConstructor; |
| | | import org.apache.ibatis.annotations.Param; |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | 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()); |
| | |
| | | } |
| | | |
| | | @Override |
| | | public Result workList() { |
| | | List<YwUnitVO> entities = baseMapper.workList(); |
| | | public Result workList(DistributeWorkOrderQuery query) { |
| | | List<YwUnitVO> entities = baseMapper.workList(query); |
| | | return Result.ok().data(entities); |
| | | } |
| | | |