|
|
@@ -6,6 +6,7 @@ import com.dk.common.model.pojo.PageList;
|
|
|
import com.dk.common.response.ResponseResultUtil;
|
|
|
import com.dk.common.response.ResponseResultVO;
|
|
|
import com.dk.mdm.infrastructure.convert.mst.WarehouseConvert;
|
|
|
+import com.dk.mdm.infrastructure.util.AuthUtils;
|
|
|
import com.dk.mdm.model.pojo.mst.Warehouse;
|
|
|
import com.dk.mdm.mapper.mst.WarehouseMapper;
|
|
|
import com.dk.common.service.BaseService;
|
|
|
@@ -39,6 +40,10 @@ public class WarehouseService extends BaseService<Warehouse> {
|
|
|
@Autowired
|
|
|
private WarehouseConvert warehouseConvert;
|
|
|
|
|
|
+
|
|
|
+ @Autowired
|
|
|
+ private AuthUtils authUtils;
|
|
|
+
|
|
|
/**
|
|
|
* @desc : 重写主键
|
|
|
* @author : 于继渤
|
|
|
@@ -79,9 +84,13 @@ public class WarehouseService extends BaseService<Warehouse> {
|
|
|
Map<String, Object> uniqueNoteCode = commonService.getUniqueNoteCode(Constant.docNameConstant.WAREHOUSE.getName(), true);
|
|
|
warehouse.setWhId(uniqueNoteCode.get("outId").toString());
|
|
|
warehouse.setWhCode(uniqueNoteCode.get("outNote").toString());
|
|
|
+ //新建如果是默认取消其他默认
|
|
|
+ if(warehouseVO.getFlgDefault()){
|
|
|
+ //默认 把其他置为非默认
|
|
|
+ warehouseMapper.updateFlgDefault(authUtils.getStaff().getCpId());
|
|
|
+ }
|
|
|
//新建
|
|
|
warehouseMapper.insert(warehouse);
|
|
|
-
|
|
|
return ResponseResultUtil.success();
|
|
|
}
|
|
|
|