| | |
| | | import com.zt.life.modules.itemCirculatOrder.service.ItemCirculatOrderService; |
| | | import com.zt.life.modules.itemCirculatOrder.service.ItemCirculatOrderTechnicalService; |
| | | import com.zt.life.modules.project.dto.SoftwareTestOrderDto; |
| | | import com.zt.life.modules.project.service.ProjectService; |
| | | import com.zt.life.sys.dto.OssDto; |
| | | import com.zt.life.sys.service.SysOssConfigService; |
| | | import com.zt.modules.coderule.service.SysCodeRuleService; |
| | |
| | | import org.springframework.web.bind.annotation.*; |
| | | import springfox.documentation.annotations.ApiIgnore; |
| | | |
| | | import javax.servlet.http.HttpServletRequest; |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | |
| | | private SysCodeRuleService sysCodeRuleService; |
| | | |
| | | @Autowired |
| | | private ProjectService projectService; |
| | | |
| | | @Autowired |
| | | private SysOssConfigService sysOssConfigService; |
| | | |
| | | @Autowired |
| | |
| | | @ApiImplicitParam(name = Constant.Q.LIMIT, value = Constant.QV.LIMIT, required = true, dataType = Constant.QT.INT), |
| | | @ApiImplicitParam(name = Constant.Q.ORDER_FIELD, value = Constant.QV.ORDER_FIELD, dataType = Constant.QT.STRING), |
| | | @ApiImplicitParam(name = Constant.Q.ORDER, value = Constant.QV.ORDER, dataType = Constant.QT.STRING), |
| | | @ApiImplicitParam(name = "code", value = "物品流转单编号", dataType = Constant.QT.STRING, format = "code^LK"), |
| | | @ApiImplicitParam(name = "softwareName", value = "物品名称", dataType = Constant.QT.STRING, format = "software_name^EQ"), |
| | | @ApiImplicitParam(name = "softwareIdentity", value = "物品编号", dataType = Constant.QT.STRING, format = "software_identity^EQ") |
| | | @ApiImplicitParam(name = "code", value = "物品流转单编号", dataType = Constant.QT.STRING, format = "a.code^LK"), |
| | | @ApiImplicitParam(name = "softwareName", value = "物品名称", dataType = Constant.QT.STRING, format = "p.software_name^LK"), |
| | | @ApiImplicitParam(name = "softwareIdentity", value = "物品编号", dataType = Constant.QT.STRING, format = "p.software_identity^LK") |
| | | }) |
| | | public PageResult<ItemCirculatOrder> page(@ApiIgnore @QueryParam QueryFilter queryFilter){ |
| | | |
| | |
| | | @ApiOperation("信息") |
| | | public Result<ItemCirculatOrderDto> getDto(Long projectId, Long circulatOrderid) { |
| | | ItemCirculatOrderDto data = itemCirculatOrderService.getDto(projectId, circulatOrderid); |
| | | if (circulatOrderid!=null) { |
| | | for (ItemCirculatOrderTechnical technical : technicalService.getList(circulatOrderid)) { |
| | | Long technicalId = technical.getId(); |
| | | OssDto ossDto = sysOssConfigService.getOssByBusiType(technicalId, "circulat_order"); |
| | | if (ossDto != null) { |
| | | technical.setFiles(ossDto); |
| | | } |
| | | } |
| | | } |
| | | return Result.ok(data); |
| | | } |
| | | |
| | | @PostMapping |
| | | @ApiOperation("新增") |
| | | @LogOperation("新增") |
| | | public Result insert(@RequestBody ItemCirculatOrderDto itemCirculatOrderDto){ |
| | | public Result<Long> insert(@RequestBody ItemCirculatOrderDto itemCirculatOrderDto){ |
| | | //效验数据 |
| | | ValidatorUtils.validateEntity(itemCirculatOrderDto.getCirculatOrder(), AddGroup.class, DefaultGroup.class); |
| | | Map<String, String> map = new HashMap<>(); |
| | | map.put("funCode", "item_circulat_order"); |
| | | map.put("projectId",itemCirculatOrderDto.getProjectId().toString()); |
| | | itemCirculatOrderDto.getCirculatOrder().setCode(sysCodeRuleService.getNewCode(map)); |
| | | Boolean result = itemCirculatOrderService.save(itemCirculatOrderDto); |
| | | return Result.ok(); |
| | | Long result = itemCirculatOrderService.save(itemCirculatOrderDto); |
| | | return Result.ok(itemCirculatOrderDto.getCirculatOrder().getId()); |
| | | } |
| | | |
| | | @PutMapping |
| | | @ApiOperation("修改") |
| | | @LogOperation("修改") |
| | | public Result update(@RequestBody ItemCirculatOrderDto itemCirculatOrderDto){ |
| | | public Result<Long> update(@RequestBody ItemCirculatOrderDto itemCirculatOrderDto){ |
| | | //效验数据 |
| | | ValidatorUtils.validateEntity(itemCirculatOrderDto.getCirculatOrder(), UpdateGroup.class, DefaultGroup.class); |
| | | Boolean result = itemCirculatOrderService.save(itemCirculatOrderDto); |
| | | |
| | | return Result.ok(); |
| | | Long result = itemCirculatOrderService.save(itemCirculatOrderDto); |
| | | //返回的是项目入库的ID |
| | | return Result.ok(result); |
| | | } |
| | | |
| | | @DeleteMapping("deleteCirculat") |
| | |
| | | //效验数据 |
| | | AssertUtils.isArrayEmpty(ids, "id"); |
| | | itemCirculatOrderService.delete(ids); |
| | | projectService.deleteItem(ids,"item_circulat_order_technical","circulat_order_id"); |
| | | |
| | | return Result.ok(); |
| | | } |
| | | |
| | | @GetMapping("exportCirculatOrder") |
| | | @ApiOperation("打印物品流转单") |
| | | @LogOperation("打印物品流转单") |
| | | public void exportCirculatOrder(Long id, HttpServletRequest request, HttpServletResponse response) { |
| | | itemCirculatOrderService.exportCirculatOrder(id, request, response); |
| | | } |
| | | |
| | | } |