| | |
| | | |
| | | import cn.hutool.core.util.ReflectUtil; |
| | | import com.consum.base.BaseController; |
| | | import com.consum.base.core.utils.CommonUtil; |
| | | import com.consum.base.core.utils.IdUtil; |
| | | import com.consum.base.core.utils.MapUtils; |
| | | import com.consum.base.core.utils.MapperUtil; |
| | |
| | | import com.consum.base.pojo.response.FromTransferTemplateInfoVO; |
| | | import com.consum.base.pojo.response.LWHFromTransferExtendVO; |
| | | import com.consum.base.pojo.response.TransferInfoVO; |
| | | import com.consum.base.service.*; |
| | | import com.consum.model.po.*; |
| | | import com.consum.base.service.BaseGoodsModelsServiceImpl; |
| | | import com.consum.base.service.BaseWarehouseServiceImpl; |
| | | import com.consum.base.service.LWhFormTransferCoreService; |
| | | import com.consum.base.service.LWhFormTransferServiceImpl; |
| | | import com.consum.base.service.LWhProcureModelService; |
| | | import com.consum.base.service.LWhProcureModelUserRecordServiceImpl; |
| | | import com.consum.base.service.LWhProcureModelUserServiceImpl; |
| | | import com.consum.model.po.BaseWarehouse; |
| | | import com.consum.model.po.FinSysTenantUser; |
| | | import com.consum.model.po.LWhFormTransfer; |
| | | import com.consum.model.po.LWhProcureModelUser; |
| | | import com.consum.model.po.LWhProcureModelUserRecord; |
| | | import com.consum.model.vo.LWhFormOutputVo; |
| | | import com.iplatform.model.po.S_user_core; |
| | | import com.walker.db.page.GenericPager; |
| | |
| | | import io.swagger.annotations.ApiImplicitParam; |
| | | import io.swagger.annotations.ApiImplicitParams; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import java.lang.reflect.Field; |
| | | import java.util.ArrayList; |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import java.util.Optional; |
| | | import java.util.stream.Collectors; |
| | | import org.apache.commons.compress.utils.Lists; |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import java.lang.reflect.Field; |
| | | import java.util.*; |
| | | import java.util.stream.Collectors; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | /** |
| | | * @Description 调拨管理 |
| | |
| | | @ApiOperation(value = "单据新增", notes = "单据新增") |
| | | @ApiImplicitParam(name = "param", value = "单据新增", required = true, dataType = "LWhFormTransferParam") |
| | | @PostMapping("/add") |
| | | public ResponseValue add(@RequestBody LWhFormTransferParam param) throws Exception { |
| | | public ResponseValue add() throws Exception { |
| | | LWhFormTransferParam param = CommonUtil.getObjFromReqBody(LWhFormTransferParam.class); |
| | | LWhFormTransferParam param2 = new LWhFormTransferParam(); |
| | | CommonUtil.copyProperties(param, param2); |
| | | param = param2; |
| | | |
| | | S_user_core currentUser = this.getCurrentUser(); |
| | | if (currentUser == null) { |
| | | return ResponseValue.error("登录用户信息不存在"); |
| | |
| | | if (CollectionUtils.isEmpty(transferGoods)) { |
| | | return ResponseValue.error("调拨单不能为空"); |
| | | } |
| | | int result = this.lWhFormTransferService.add(param, this.getSysInfo()); |
| | | if (result > 0) { |
| | | return ResponseValue.success(); |
| | | long id = this.lWhFormTransferService.add(param, this.getSysInfo()); |
| | | |
| | | Integer transferBusinessType = param.getTransferBusinessType(); |
| | | //部门分发业务需要处理 |
| | | if (transferBusinessType == 1) { |
| | | // 先出库,再入库 |
| | | // 出库前 设置出库仓库 |
| | | FinSysTenantUser sysTenantUser = this.getSysInfo(); |
| | | String agencyId = sysTenantUser.getTenantId(); |
| | | List<BaseWarehouse> baseWarehouseList = baseWarehouseService.getByAgencyId(Long.valueOf(agencyId), (short) 1, (short) 1); |
| | | if (CollectionUtils.isEmpty(baseWarehouseList)) { |
| | | return ResponseValue.error("机构无默认仓库!"); |
| | | } |
| | | BaseWarehouse baseWarehouse = baseWarehouseList.get(0); |
| | | Long wareHouseId = baseWarehouse.getId(); |
| | | String warehouseName = baseWarehouse.getWarehouseName(); |
| | | LWhFormTransfer lWhFormTransfer = new LWhFormTransfer(id); |
| | | lWhFormTransfer.setOutWarehouseId(wareHouseId); |
| | | lWhFormTransfer.setOutWarehouseName(warehouseName); |
| | | lWhFormTransferService.update(lWhFormTransfer); |
| | | lWhFormTransferCoreService.doTransferOutPut(id, getCurrentUser()); |
| | | |
| | | lWhFormTransferCoreService.doTransferInPut(id, getCurrentUser()); |
| | | } |
| | | return ResponseValue.error("新增失败!"); |
| | | |
| | | return ResponseValue.success(); |
| | | } |
| | | |
| | | /** |
| | |
| | | @ApiImplicitParam(name = "param", value = "条件参数", required = true, dataType = "TransferQry"), |
| | | }) |
| | | @GetMapping("/list") |
| | | public ResponseValue queryFormTransferList(TransferQry param) { |
| | | public ResponseValue queryFormTransferList() { |
| | | TransferQry param = CommonUtil.getObjFromReq(TransferQry.class); |
| | | TransferQry param2 = new TransferQry(); |
| | | CommonUtil.copyProperties(param, param2); |
| | | param = param2; |
| | | |
| | | S_user_core currentUser = this.getCurrentUser(); |
| | | if (currentUser == null) { |
| | | return ResponseValue.error("登录用户信息不存在"); |
| | |
| | | @ApiImplicitParam(name = "param", value = "条件", required = true, dataType = "TransferQry"), |
| | | }) |
| | | @GetMapping("/detail/list") |
| | | public ResponseValue queryFormTransferDetailList(TransferQry param) { |
| | | public ResponseValue queryFormTransferDetailList() { |
| | | TransferQry param = CommonUtil.getObjFromReq(TransferQry.class); |
| | | TransferQry param2 = new TransferQry(); |
| | | CommonUtil.copyProperties(param, param2); |
| | | param = param2; |
| | | |
| | | FinSysTenantUser sysInfo = this.getSysInfo(); |
| | | if (sysInfo == null) { |
| | | return ResponseValue.error("登录用户信息不存在"); |
| | |
| | | /** |
| | | * 部门物品分发列表明细 |
| | | * |
| | | * @param transferQry |
| | | * @param |
| | | * @return |
| | | */ |
| | | @ApiOperation(value = "部门物品分发列表明细", notes = "部门物品分发列表明细") |
| | |
| | | @ApiImplicitParam(name = "transferQryDto", value = "调拨单查询条件", required = true) |
| | | }) |
| | | @GetMapping("/department/list") |
| | | public ResponseValue departmentTransferList(TransferQry transferQry) { |
| | | public ResponseValue departmentTransferList() { |
| | | TransferQry param = CommonUtil.getObjFromReq(TransferQry.class); |
| | | TransferQry param2 = new TransferQry(); |
| | | CommonUtil.copyProperties(param, param2); |
| | | param = param2; |
| | | |
| | | S_user_core currentUser = this.getCurrentUser(); |
| | | if (currentUser == null) { |
| | | return ResponseValue.error("登录用户信息不存在"); |
| | | } |
| | | GenericPager<Map<String, Object>> transferInfoDetailsVoGenericPager = this.lWhFormTransferService.queryTransferInfo(transferQry); |
| | | GenericPager<Map<String, Object>> transferInfoDetailsVoGenericPager = this.lWhFormTransferService.queryTransferInfo(param); |
| | | return ResponseValue.success(transferInfoDetailsVoGenericPager); |
| | | } |
| | | |
| | |
| | | @ApiImplicitParam(name = "procureModelInfoDto", value = "使用信息", required = true) |
| | | }) |
| | | @PostMapping("/useInfo/update") |
| | | public ResponseValue infoUpdate(@RequestBody List<ProcureModelInfoParam> procureModelInfoParam) { |
| | | public ResponseValue infoUpdate() { |
| | | |
| | | List<ProcureModelInfoParam> param = CommonUtil.getObjFromReqBody(List.class); |
| | | List<ProcureModelInfoParam> procureModelInfoParam = Lists.newArrayList(); |
| | | procureModelInfoParam.addAll(param); |
| | | |
| | | S_user_core currentUser = this.getCurrentUser(); |
| | | if (currentUser == null) { |