| | |
| | | import com.zt.life.modules.itemCirculatOrder.dto.ItemCirculatOrderDto; |
| | | import com.zt.life.modules.itemCirculatOrder.model.ItemCirculatOrderTechnical; |
| | | import com.zt.life.sys.dto.OssDto; |
| | | import com.zt.life.sys.service.SysOssConfigService; |
| | | import com.zt.modules.coderule.service.SysCodeRuleService; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiImplicitParam; |
| | | import io.swagger.annotations.ApiImplicitParams; |
| | |
| | | import springfox.documentation.annotations.ApiIgnore; |
| | | |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | |
| | | /** |
| | |
| | | @Autowired |
| | | private ConfigItemWarehouseService configItemWarehouseService; |
| | | |
| | | @Autowired |
| | | private SysCodeRuleService sysCodeRuleService; |
| | | |
| | | @Autowired |
| | | private SysOssConfigService sysOssConfigService; |
| | | @GetMapping("page") |
| | | @ApiOperation("分页") |
| | | @ApiImplicitParams({ |
| | |
| | | @ApiOperation("信息") |
| | | public Result<ConfigItemWarehouseDto> getDto(Long projectId, Long warehouseId) { |
| | | ConfigItemWarehouseDto data =configItemWarehouseService.getDto(projectId, warehouseId); |
| | | if (warehouseId!=null) { |
| | | OssDto ossDto = sysOssConfigService.getOssByBusiType(warehouseId, "config_item_warehouse"); |
| | | if (ossDto != null) { |
| | | data.setFiles(ossDto); |
| | | } |
| | | } |
| | | return Result.ok(data); |
| | | } |
| | | |
| | | @PostMapping |
| | | @ApiOperation("新增") |
| | | @LogOperation("新增") |
| | | public Result insert(@RequestBody ConfigItemWarehouse configItemWarehouse){ |
| | | public Result insert(@RequestBody ConfigItemWarehouseDto configItemDto){ |
| | | //效验数据 |
| | | ValidatorUtils.validateEntity(configItemWarehouse, AddGroup.class, DefaultGroup.class); |
| | | configItemWarehouseService.insert(configItemWarehouse); |
| | | |
| | | ValidatorUtils.validateEntity(configItemDto, AddGroup.class, DefaultGroup.class); |
| | | Map<String, String> map = new HashMap<>(); |
| | | map.put("funCode", "config_item_warehouse"); |
| | | map.put("projectId",configItemDto.getProjectId().toString()); |
| | | configItemDto.getConfigItemWarehouse().setCode(sysCodeRuleService.getNewCode(map)); |
| | | Boolean result = configItemWarehouseService.save(configItemDto); |
| | | return Result.ok(); |
| | | } |
| | | |
| | | @PutMapping |
| | | @ApiOperation("修改") |
| | | @LogOperation("修改") |
| | | public Result update(@RequestBody ConfigItemWarehouse configItemWarehouse){ |
| | | public Result update(@RequestBody ConfigItemWarehouseDto configItemDto){ |
| | | //效验数据 |
| | | ValidatorUtils.validateEntity(configItemWarehouse, UpdateGroup.class, DefaultGroup.class); |
| | | configItemWarehouseService.update(configItemWarehouse); |
| | | ValidatorUtils.validateEntity(configItemDto, UpdateGroup.class, DefaultGroup.class); |
| | | Boolean result = configItemWarehouseService.save(configItemDto); |
| | | |
| | | return Result.ok(); |
| | | } |