Commit 3de9096c by shiwenbo

库存提供查询库存预警详情的接口

parent 8945de1c
......@@ -4,7 +4,9 @@ import java.math.BigDecimal;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.UUID;
import java.util.stream.Collectors;
......@@ -26,6 +28,7 @@ import com.beecode.inz.basis.team.pojo.ResponseObj;
import com.xyst.dinas.biz.service.DinasOrganizationService;
import com.xyst.dinas.biz.service.DinasTypeService;
import com.xyst.dinas.biz.service.StationService;
import com.xyst.dinas.biz.warn.dao.WarnSettingDao;
import com.xyst.dinas.price.entity.StationDinasTypePriceDetail;
import com.xyst.dinas.price.service.PriceAdjustmentService;
import com.xyst.dinas.sales.constant.InventoryConstant;
......@@ -58,6 +61,9 @@ public class InventoryServiceImpl implements InventoryService {
public InventoryDao inventoryDao;
@Autowired
private WarnSettingDao warnSettingDao;
@Autowired
public BapContext bapContext;
@Override
......@@ -246,4 +252,21 @@ public class InventoryServiceImpl implements InventoryService {
}
return result;
}
@Override
public Object queryWarnSettingById(UUID id) {
KObject warnSetting = warnSettingDao.queryWarnSettingById(id);
String billId = warnSetting.getString("billId");
KObject station = stationService.getById(UUID.fromString(billId));
Map<String, Object> map = new HashMap<>();
map.put("stationName", station.getString("stationName"));
map.put("personnel", warnSetting.getString("personnel"));
map.put("max", warnSetting.getString("max"));
map.put("min", warnSetting.getString("min"));
map.put("target", warnSetting.getString("target"));
map.put("targetType", warnSetting.getString("targetType"));
map.put("id", warnSetting.getUuid("id"));
map.put("billId", warnSetting.getString("billId"));
return map;
}
}
......@@ -12,5 +12,6 @@ public interface InventoryService {
public List<StationDinasTypeRelation> getInventoryByRegionalCompany(UUID regionalCompany);
public ResponseObj<String> modifyInventory(String body, boolean isLog, boolean autoCalculate);
public List<InventoryLog> queryLog(UUID regionalCompany);
Object queryWarnSettingById(UUID id);
}
......@@ -4,6 +4,8 @@ import java.util.List;
import java.util.UUID;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
......@@ -48,4 +50,10 @@ public class InventoryController {
List<InventoryLog> data = inventoryService.queryLog(UUID.fromString(regionalCompany));
return ResponseObj.success("库存纠正日志查询成功", data);
}
@GetMapping("/contract/warnsetting/{id}")
public Object queryWarnSetting(@PathVariable UUID id) {
Assert.notNull(id,"The id must not be null");
return inventoryService.queryWarnSettingById(id);
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment