|
@@ -25,94 +25,99 @@ import java.util.Map;
|
|
|
@Transactional
|
|
@Transactional
|
|
|
public class WarehouseService extends BaseService<Warehouse> {
|
|
public class WarehouseService extends BaseService<Warehouse> {
|
|
|
|
|
|
|
|
- @Override
|
|
|
|
|
- public BaseMapper<Warehouse> getRepository() {
|
|
|
|
|
- return warehouseMapper;
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- @Autowired
|
|
|
|
|
- private WarehouseMapper warehouseMapper;
|
|
|
|
|
-
|
|
|
|
|
- @Autowired
|
|
|
|
|
- private CommonService commonService;
|
|
|
|
|
-
|
|
|
|
|
- @Autowired
|
|
|
|
|
- private WarehouseConvert warehouseConvert;
|
|
|
|
|
-
|
|
|
|
|
- /**
|
|
|
|
|
- * @desc : 重写主键
|
|
|
|
|
- * @author : 于继渤
|
|
|
|
|
- * @date : 2024/2/29 20:29
|
|
|
|
|
- */
|
|
|
|
|
- @Override
|
|
|
|
|
- public String getPrimaryKey() {
|
|
|
|
|
- return "wh_id";
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
- /**
|
|
|
|
|
- * @desc : 查询
|
|
|
|
|
- * @author : 于继渤
|
|
|
|
|
- * @date : 2023/1/5 9:39
|
|
|
|
|
- */
|
|
|
|
|
- @Pagination
|
|
|
|
|
- public ResponseResultVO<PageList<WarehouseResponse>> selectByCond(WarehouseQuery warehouseQuery) {
|
|
|
|
|
- return super.mergeListWithCount(warehouseQuery, warehouseMapper.selectByCond(warehouseQuery),
|
|
|
|
|
- warehouseMapper.countByCond(warehouseQuery));
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
- /**
|
|
|
|
|
- * @desc : 新建
|
|
|
|
|
- * @author : 于继渤
|
|
|
|
|
- * @date : 2023/1/5 9:39
|
|
|
|
|
- */
|
|
|
|
|
- @Transactional(
|
|
|
|
|
- rollbackFor = {Exception.class}
|
|
|
|
|
- )
|
|
|
|
|
- public ResponseResultVO<?> insert(WarehouseVO warehouseVO) {
|
|
|
|
|
- //实体转换
|
|
|
|
|
- Warehouse warehouse = warehouseConvert.convertToPo(warehouseVO);
|
|
|
|
|
- //设置序号
|
|
|
|
|
- warehouse.setDisplayNo(commonService.getMaxDisplayNo(Constant.DisplayNoTable.WAREHOUSE));
|
|
|
|
|
- //设置编码
|
|
|
|
|
- Map<String, Object> uniqueNoteCode = commonService.getUniqueNoteCode(Constant.docNameConstant.WAREHOUSE.getName(), true);
|
|
|
|
|
- warehouse.setWhId(uniqueNoteCode.get("outId").toString());
|
|
|
|
|
- warehouse.setWhCode(uniqueNoteCode.get("outNote").toString());
|
|
|
|
|
- //新建
|
|
|
|
|
- warehouseMapper.insert(warehouse);
|
|
|
|
|
-
|
|
|
|
|
- return ResponseResultUtil.success();
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
- /**
|
|
|
|
|
- * @desc : 编辑
|
|
|
|
|
- * @author : 于继渤
|
|
|
|
|
- * @date : 2023/1/5 9:39
|
|
|
|
|
- */
|
|
|
|
|
- @Transactional(
|
|
|
|
|
- rollbackFor = {Exception.class}
|
|
|
|
|
- )
|
|
|
|
|
- public ResponseResultVO<?> update(WarehouseVO warehouseVO) {
|
|
|
|
|
- Warehouse warehouse = warehouseConvert.convertToPo(warehouseVO);
|
|
|
|
|
- super.updateByUuid(warehouse);
|
|
|
|
|
- return ResponseResultUtil.success();
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- /**
|
|
|
|
|
- * @desc : 编辑
|
|
|
|
|
- * @author : 于继渤
|
|
|
|
|
- * @date : 2023/1/5 9:39
|
|
|
|
|
- */
|
|
|
|
|
- @Transactional(
|
|
|
|
|
- rollbackFor = {Exception.class}
|
|
|
|
|
- )
|
|
|
|
|
- public ResponseResultVO<?> updateBatchWarehouseDisplayNo(WarehouseVO warehouseVO) {
|
|
|
|
|
- warehouseMapper.updateBatchWarehouseDisplayNo(warehouseVO.getDataIds());
|
|
|
|
|
- return ResponseResultUtil.success();
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ @Override
|
|
|
|
|
+ public BaseMapper<Warehouse> getRepository() {
|
|
|
|
|
+ return warehouseMapper;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ @Autowired
|
|
|
|
|
+ private WarehouseMapper warehouseMapper;
|
|
|
|
|
+
|
|
|
|
|
+ @Autowired
|
|
|
|
|
+ private CommonService commonService;
|
|
|
|
|
+
|
|
|
|
|
+ @Autowired
|
|
|
|
|
+ private WarehouseConvert warehouseConvert;
|
|
|
|
|
+
|
|
|
|
|
+ /**
|
|
|
|
|
+ * @desc : 重写主键
|
|
|
|
|
+ * @author : 于继渤
|
|
|
|
|
+ * @date : 2024/2/29 20:29
|
|
|
|
|
+ */
|
|
|
|
|
+ @Override
|
|
|
|
|
+ public String getPrimaryKey() {
|
|
|
|
|
+ return "wh_id";
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+ /**
|
|
|
|
|
+ * @desc : 查询
|
|
|
|
|
+ * @author : 于继渤
|
|
|
|
|
+ * @date : 2023/1/5 9:39
|
|
|
|
|
+ */
|
|
|
|
|
+ @Pagination
|
|
|
|
|
+ public ResponseResultVO<PageList<WarehouseResponse>> selectByCond(WarehouseQuery warehouseQuery) {
|
|
|
|
|
+ return super.mergeListWithCount(warehouseQuery, warehouseMapper.selectByCond(warehouseQuery),
|
|
|
|
|
+ warehouseMapper.countByCond(warehouseQuery));
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+ /**
|
|
|
|
|
+ * @desc : 新建
|
|
|
|
|
+ * @author : 于继渤
|
|
|
|
|
+ * @date : 2023/1/5 9:39
|
|
|
|
|
+ */
|
|
|
|
|
+ @Transactional(
|
|
|
|
|
+ rollbackFor = {Exception.class}
|
|
|
|
|
+ )
|
|
|
|
|
+ public ResponseResultVO<?> insert(WarehouseVO warehouseVO) {
|
|
|
|
|
+ //实体转换
|
|
|
|
|
+ Warehouse warehouse = warehouseConvert.convertToPo(warehouseVO);
|
|
|
|
|
+ //设置序号
|
|
|
|
|
+ warehouse.setDisplayNo(commonService.getMaxDisplayNo(Constant.DisplayNoTable.WAREHOUSE));
|
|
|
|
|
+ //设置编码
|
|
|
|
|
+ Map<String, Object> uniqueNoteCode = commonService.getUniqueNoteCode(Constant.docNameConstant.WAREHOUSE.getName(), true);
|
|
|
|
|
+ warehouse.setWhId(uniqueNoteCode.get("outId").toString());
|
|
|
|
|
+ warehouse.setWhCode(uniqueNoteCode.get("outNote").toString());
|
|
|
|
|
+ //新建
|
|
|
|
|
+ warehouseMapper.insert(warehouse);
|
|
|
|
|
+
|
|
|
|
|
+ return ResponseResultUtil.success();
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+ /**
|
|
|
|
|
+ * @desc : 编辑
|
|
|
|
|
+ * @author : 于继渤
|
|
|
|
|
+ * @date : 2023/1/5 9:39
|
|
|
|
|
+ */
|
|
|
|
|
+ @Transactional(
|
|
|
|
|
+ rollbackFor = {Exception.class}
|
|
|
|
|
+ )
|
|
|
|
|
+ public ResponseResultVO<?> update(WarehouseVO warehouseVO) {
|
|
|
|
|
+ Warehouse warehouse1 = warehouseMapper.selectById(warehouseVO.getWhId());
|
|
|
|
|
+ if ((warehouse1.getFlgDefault() == null || !warehouse1.getFlgDefault()) && warehouseVO.getFlgDefault() != null && warehouseVO.getFlgDefault()) {
|
|
|
|
|
+ //默认 把其他置为非默认
|
|
|
|
|
+ warehouseMapper.updateFlgDefault(warehouseVO.getCpId());
|
|
|
|
|
+ }
|
|
|
|
|
+ Warehouse warehouse = warehouseConvert.convertToPo(warehouseVO);
|
|
|
|
|
+ super.updateByUuid(warehouse);
|
|
|
|
|
+ return ResponseResultUtil.success();
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+ /**
|
|
|
|
|
+ * @desc : 编辑
|
|
|
|
|
+ * @author : 于继渤
|
|
|
|
|
+ * @date : 2023/1/5 9:39
|
|
|
|
|
+ */
|
|
|
|
|
+ @Transactional(
|
|
|
|
|
+ rollbackFor = {Exception.class}
|
|
|
|
|
+ )
|
|
|
|
|
+ public ResponseResultVO<?> updateBatchWarehouseDisplayNo(WarehouseVO warehouseVO) {
|
|
|
|
|
+ warehouseMapper.updateBatchWarehouseDisplayNo(warehouseVO.getDataIds());
|
|
|
|
|
+ return ResponseResultUtil.success();
|
|
|
|
|
+ }
|
|
|
|
|
|
|
|
}
|
|
}
|