Compare commits
No commits in common. "483199f0422d21a4263dc6b656b6d3c4932725b4" and "c2cb6324e1aa00465638cf4ea12d90f22d06f72c" have entirely different histories.
483199f042
...
c2cb6324e1
@ -9,7 +9,6 @@ import cn.iocoder.yudao.module.base.vo.RepairWorkerPageReqVO;
|
|||||||
import cn.iocoder.yudao.module.base.vo.RepairWorkerRespVO;
|
import cn.iocoder.yudao.module.base.vo.RepairWorkerRespVO;
|
||||||
import cn.iocoder.yudao.module.base.vo.RepairWorkerSaveReqVO;
|
import cn.iocoder.yudao.module.base.vo.RepairWorkerSaveReqVO;
|
||||||
import cn.iocoder.yudao.module.project.vo.RepairProjectPageReqVO;
|
import cn.iocoder.yudao.module.project.vo.RepairProjectPageReqVO;
|
||||||
import cn.iocoder.yudao.module.system.api.user.dto.UserDTO;
|
|
||||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
import io.swagger.v3.oas.annotations.Operation;
|
import io.swagger.v3.oas.annotations.Operation;
|
||||||
@ -21,8 +20,6 @@ import org.springframework.web.bind.annotation.*;
|
|||||||
import javax.annotation.Resource;
|
import javax.annotation.Resource;
|
||||||
import javax.validation.Valid;
|
import javax.validation.Valid;
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
|
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
|
||||||
|
|
||||||
@Tag(name = "管理后台 - 维修工人")
|
@Tag(name = "管理后台 - 维修工人")
|
||||||
@ -34,30 +31,19 @@ public class RepairWorkerController {
|
|||||||
@Resource
|
@Resource
|
||||||
private RepairWorkerService workerService;
|
private RepairWorkerService workerService;
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 批量创建维修工人集合
|
|
||||||
* @author PQZ
|
|
||||||
* @date 18:32 2024/10/9
|
|
||||||
* @param userList 选中的用户集合
|
|
||||||
* @return cn.iocoder.yudao.framework.common.pojo.CommonResult<java.lang.String>
|
|
||||||
**/
|
|
||||||
@PostMapping("/create")
|
@PostMapping("/create")
|
||||||
@Operation(summary = "创建维修工人")
|
@Operation(summary = "创建维修工人")
|
||||||
public CommonResult<Boolean> createWorker(@RequestBody List<UserDTO> userList) {
|
public CommonResult<String> createWorker(@Valid @RequestBody RepairWorkerSaveReqVO createReqVO) {
|
||||||
workerService.saveWorkers(userList);
|
return success(workerService.createWorker(createReqVO));
|
||||||
return success(true);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@PutMapping("/update")
|
@PutMapping("/update")
|
||||||
@Operation(summary = "更新维修工人")
|
@Operation(summary = "更新维修工人")
|
||||||
public CommonResult<Boolean> updateWorker(@RequestBody RepairWorkerSaveReqVO updateReqVO) {
|
public CommonResult<Boolean> updateWorker(@Valid @RequestBody RepairWorkerSaveReqVO updateReqVO) {
|
||||||
workerService.updateWorker(updateReqVO);
|
workerService.updateWorker(updateReqVO);
|
||||||
return success(true);
|
return success(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@DeleteMapping("/delete")
|
@DeleteMapping("/delete")
|
||||||
@Operation(summary = "删除维修工人")
|
@Operation(summary = "删除维修工人")
|
||||||
@Parameter(name = "id", description = "编号", required = true)
|
@Parameter(name = "id", description = "编号", required = true)
|
||||||
|
|||||||
@ -28,7 +28,7 @@ public class RepairWorker extends TenantBaseDO {
|
|||||||
/**
|
/**
|
||||||
* 用户id
|
* 用户id
|
||||||
*/
|
*/
|
||||||
private Long userId;
|
private String userId;
|
||||||
/**
|
/**
|
||||||
* 维修工人名称
|
* 维修工人名称
|
||||||
*/
|
*/
|
||||||
|
|||||||
@ -4,13 +4,11 @@ import cn.iocoder.yudao.module.base.entity.RepairWorker;
|
|||||||
import cn.iocoder.yudao.module.base.vo.RepairWorkerPageReqVO;
|
import cn.iocoder.yudao.module.base.vo.RepairWorkerPageReqVO;
|
||||||
import cn.iocoder.yudao.module.base.vo.RepairWorkerRespVO;
|
import cn.iocoder.yudao.module.base.vo.RepairWorkerRespVO;
|
||||||
import cn.iocoder.yudao.module.base.vo.RepairWorkerSaveReqVO;
|
import cn.iocoder.yudao.module.base.vo.RepairWorkerSaveReqVO;
|
||||||
import cn.iocoder.yudao.module.system.api.user.dto.UserDTO;
|
|
||||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
import com.baomidou.mybatisplus.extension.service.IService;
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
|
|
||||||
import javax.validation.Valid;
|
import javax.validation.Valid;
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 维修工人 Service 接口
|
* 维修工人 Service 接口
|
||||||
@ -19,14 +17,13 @@ import java.util.List;
|
|||||||
*/
|
*/
|
||||||
public interface RepairWorkerService extends IService<RepairWorker> {
|
public interface RepairWorkerService extends IService<RepairWorker> {
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 批量创建维修工人
|
* 创建维修工人
|
||||||
* @author PQZ
|
*
|
||||||
* @date 18:33 2024/10/9
|
* @param createReqVO 创建信息
|
||||||
* @param userList 选中用户集合
|
* @return 编号
|
||||||
**/
|
*/
|
||||||
void saveWorkers(List<UserDTO> userList);
|
String createWorker(@Valid RepairWorkerSaveReqVO createReqVO);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 更新维修工人
|
* 更新维修工人
|
||||||
|
|||||||
@ -1,6 +1,5 @@
|
|||||||
package cn.iocoder.yudao.module.base.service.impl;
|
package cn.iocoder.yudao.module.base.service.impl;
|
||||||
|
|
||||||
import cn.hutool.core.collection.CollectionUtil;
|
|
||||||
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
||||||
import cn.iocoder.yudao.module.base.entity.RepairWorker;
|
import cn.iocoder.yudao.module.base.entity.RepairWorker;
|
||||||
import cn.iocoder.yudao.module.base.mapper.RepairWorkerMapper;
|
import cn.iocoder.yudao.module.base.mapper.RepairWorkerMapper;
|
||||||
@ -8,7 +7,6 @@ import cn.iocoder.yudao.module.base.service.RepairWorkerService;
|
|||||||
import cn.iocoder.yudao.module.base.vo.RepairWorkerPageReqVO;
|
import cn.iocoder.yudao.module.base.vo.RepairWorkerPageReqVO;
|
||||||
import cn.iocoder.yudao.module.base.vo.RepairWorkerRespVO;
|
import cn.iocoder.yudao.module.base.vo.RepairWorkerRespVO;
|
||||||
import cn.iocoder.yudao.module.base.vo.RepairWorkerSaveReqVO;
|
import cn.iocoder.yudao.module.base.vo.RepairWorkerSaveReqVO;
|
||||||
import cn.iocoder.yudao.module.system.api.user.dto.UserDTO;
|
|
||||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
@ -16,8 +14,6 @@ import org.springframework.stereotype.Service;
|
|||||||
import org.springframework.validation.annotation.Validated;
|
import org.springframework.validation.annotation.Validated;
|
||||||
|
|
||||||
import javax.annotation.Resource;
|
import javax.annotation.Resource;
|
||||||
import java.util.ArrayList;
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 维修工人 Service 实现类
|
* 维修工人 Service 实现类
|
||||||
@ -31,26 +27,13 @@ public class RepairWorkerServiceImpl extends ServiceImpl<RepairWorkerMapper, Rep
|
|||||||
@Resource
|
@Resource
|
||||||
private RepairWorkerMapper workerMapper;
|
private RepairWorkerMapper workerMapper;
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 批量创建维修工人
|
|
||||||
*
|
|
||||||
* @param userList 选中用户集合
|
|
||||||
* @author PQZ
|
|
||||||
* @date 18:33 2024/10/9
|
|
||||||
**/
|
|
||||||
@Override
|
@Override
|
||||||
public void saveWorkers(List<UserDTO> userList) {
|
public String createWorker(RepairWorkerSaveReqVO createReqVO) {
|
||||||
if (CollectionUtil.isNotEmpty(userList)){
|
// 插入
|
||||||
List<RepairWorker> saveList = new ArrayList<>();
|
RepairWorker worker = BeanUtils.toBean(createReqVO, RepairWorker.class);
|
||||||
userList.forEach(item -> {
|
workerMapper.insert(worker);
|
||||||
RepairWorker worker = new RepairWorker();
|
// 返回
|
||||||
worker.setUserId(item.getId());
|
return worker.getId();
|
||||||
worker.setUserName(item.getNickname());
|
|
||||||
saveList.add(worker);
|
|
||||||
});
|
|
||||||
saveBatch(saveList);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@ -8,4 +8,6 @@ import lombok.Data;
|
|||||||
@Data
|
@Data
|
||||||
public class RepairWorkerSaveReqVO extends RepairWorker {
|
public class RepairWorkerSaveReqVO extends RepairWorker {
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -21,9 +21,6 @@
|
|||||||
<if test="entity.userName != null and entity.userName != ''">
|
<if test="entity.userName != null and entity.userName != ''">
|
||||||
and main.user_name = #{entity.userName}
|
and main.user_name = #{entity.userName}
|
||||||
</if>
|
</if>
|
||||||
<if test="entity.workType != null and entity.workType != ''">
|
|
||||||
and main.work_type = #{entity.workType}
|
|
||||||
</if>
|
|
||||||
</where>
|
</where>
|
||||||
|
|
||||||
</select>
|
</select>
|
||||||
|
|||||||
File diff suppressed because one or more lines are too long
@ -4,7 +4,7 @@
|
|||||||
"avatar": "",
|
"avatar": "",
|
||||||
"version": "4.9.2",
|
"version": "4.9.2",
|
||||||
"createdTime": "2024-10-9 10:34:15",
|
"createdTime": "2024-10-9 10:34:15",
|
||||||
"updatedTime": "2024-10-9 17:32:50",
|
"updatedTime": "2024-10-9 18:10:10",
|
||||||
"dbConns": [],
|
"dbConns": [],
|
||||||
"profile": {
|
"profile": {
|
||||||
"default": {
|
"default": {
|
||||||
@ -683,7 +683,7 @@
|
|||||||
"optionsFetcher": ""
|
"optionsFetcher": ""
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"menuWidth": "266px"
|
"menuWidth": "297px"
|
||||||
},
|
},
|
||||||
"entities": [
|
"entities": [
|
||||||
{
|
{
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user