|
|
@@ -4,13 +4,12 @@ package cn.hnthyy.thmz.controller.yk;
|
|
|
import cn.hnthyy.thmz.Utils.TokenUtil;
|
|
|
import cn.hnthyy.thmz.comment.UserLoginToken;
|
|
|
import cn.hnthyy.thmz.entity.his.yp.YpInDetl;
|
|
|
+import cn.hnthyy.thmz.entity.his.yp.YpOutDetl;
|
|
|
import cn.hnthyy.thmz.entity.thmz.User;
|
|
|
import cn.hnthyy.thmz.service.his.mz.EmployeeService;
|
|
|
-import cn.hnthyy.thmz.service.his.yp.YpInDetlService;
|
|
|
-import cn.hnthyy.thmz.service.his.yp.YpZdDictService;
|
|
|
-import cn.hnthyy.thmz.service.his.yp.YpZdManufactoryService;
|
|
|
-import cn.hnthyy.thmz.service.his.yp.YpZdSupplyService;
|
|
|
+import cn.hnthyy.thmz.service.his.yp.*;
|
|
|
import cn.hnthyy.thmz.vo.YpInDetlVo;
|
|
|
+import cn.hnthyy.thmz.vo.YpOutDetlVo;
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
import org.apache.commons.lang3.StringUtils;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
@@ -39,6 +38,8 @@ public class YpInDetlController {
|
|
|
EmployeeService employeeService;
|
|
|
@Autowired
|
|
|
YpZdSupplyService ypZdSupplyService;
|
|
|
+ @Autowired
|
|
|
+ YpOutDetlService ypOutDetlService;
|
|
|
|
|
|
/**
|
|
|
* 查询入库记录
|
|
|
@@ -72,50 +73,42 @@ public class YpInDetlController {
|
|
|
/**
|
|
|
* 查询药品入库记录
|
|
|
*
|
|
|
- * @param ypInDetl
|
|
|
+ * @param map
|
|
|
* @return
|
|
|
*/
|
|
|
@UserLoginToken
|
|
|
@RequestMapping(value = "/getYpInDetl", method = {RequestMethod.POST})
|
|
|
- public Map<String, Object> getYpInDetl(@RequestBody YpInDetl ypInDetl) {
|
|
|
+ public Map<String, Object> getYpInDetl(@RequestBody Map<String,Object> map) {
|
|
|
Map<String, Object> resultMap = new HashMap<>();
|
|
|
try {
|
|
|
- if (ypInDetl == null) {
|
|
|
+ if (map == null) {
|
|
|
resultMap.put("code", -1);
|
|
|
resultMap.put("message", "查询药品入库记录信息失败,参数为空");
|
|
|
return resultMap;
|
|
|
}
|
|
|
- resultMap.put("data", ypInDetlService.queryYpInDetl(ypInDetl));
|
|
|
- resultMap.put("code", 0);
|
|
|
- resultMap.put("message", "查询药品入库记录信息成功");
|
|
|
- return resultMap;
|
|
|
- } catch (Exception e) {
|
|
|
- log.error(e.toString());
|
|
|
- resultMap.put("code", -1);
|
|
|
- resultMap.put("message", "查询药品入库记录信息失败");
|
|
|
- return resultMap;
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- /**
|
|
|
- * 查询药品入库记录
|
|
|
- * @param chargeCode
|
|
|
- * @param serial
|
|
|
- * @param groupNo
|
|
|
- * @return
|
|
|
- */
|
|
|
- @UserLoginToken
|
|
|
- @RequestMapping(value = "/getYpInDetl1", method = {RequestMethod.POST})
|
|
|
- public Map<String, Object> getYpInDetl1(@RequestParam("chargeCode") String chargeCode,@RequestParam("serial") String serial,
|
|
|
- @RequestParam("groupNo") String groupNo) {
|
|
|
- Map<String, Object> resultMap = new HashMap<>();
|
|
|
- try {
|
|
|
YpInDetl ypInDetl = new YpInDetl();
|
|
|
- ypInDetl.setChargeCode(chargeCode);
|
|
|
- ypInDetl.setSerial(serial);
|
|
|
- ypInDetl.setGroupNo(groupNo);
|
|
|
- ypInDetl.setCurrentStock(0.0);
|
|
|
- resultMap.put("data", ypInDetlService.queryYpInDetl(ypInDetl));
|
|
|
+ ypInDetl.setCurrentStock(Double.parseDouble(map.get("currentStock").toString()));
|
|
|
+ ypInDetl.setChargeCode(map.get("chargeCode").toString());
|
|
|
+ ypInDetl.setSerial(map.get("serial").toString());
|
|
|
+ ypInDetl.setGroupNo(map.get("groupNo").toString());
|
|
|
+ List<YpInDetlVo> ypInDetlVos = ypInDetlService.queryYpInDetl(ypInDetl);
|
|
|
+ if(StringUtils.isNotBlank(map.get("drawNo").toString())){
|
|
|
+ YpOutDetl ypOutDetl = new YpOutDetl();
|
|
|
+ ypOutDetl.setDrawNo(map.get("drawNo").toString());
|
|
|
+ List<YpOutDetlVo> ypOutDetlVos = ypOutDetlService.queryYpOutDetlDetail(ypOutDetl);
|
|
|
+ for (int i = 0; i < ypInDetlVos.size(); i++) {
|
|
|
+ YpInDetlVo ypInDetlVo = ypInDetlVos.get(i);
|
|
|
+ for (int j = 0; j < ypOutDetlVos.size(); j++) {
|
|
|
+ YpOutDetlVo ypOutDetlVo = ypOutDetlVos.get(j);
|
|
|
+ if(ypInDetlVo.getChargeCode().equals(ypOutDetlVo.getChargeCode())
|
|
|
+ && ypInDetlVo.getSerial().equals(ypOutDetlVo.getSerial())
|
|
|
+ && ypInDetlVo.getManuNo().equals(ypOutDetlVo.getManuNo())){
|
|
|
+ ypInDetlVo.setAmountOut(ypOutDetlVo.getOutAmt());
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ resultMap.put("data", ypInDetlVos);
|
|
|
resultMap.put("code", 0);
|
|
|
resultMap.put("message", "查询药品入库记录信息成功");
|
|
|
return resultMap;
|