|
@@ -2,10 +2,8 @@ package cn.hnthyy.thmz.service.impl.his.yp;
|
|
|
|
|
|
import cn.hnthyy.thmz.Utils.ColumnSqlUtil;
|
|
|
import cn.hnthyy.thmz.entity.MzException;
|
|
|
-import cn.hnthyy.thmz.entity.his.yp.YpBaseYf;
|
|
|
-import cn.hnthyy.thmz.entity.his.yp.YpReprice;
|
|
|
-import cn.hnthyy.thmz.entity.his.yp.YpRepriceStock;
|
|
|
-import cn.hnthyy.thmz.entity.his.yp.YpZdDict;
|
|
|
+import cn.hnthyy.thmz.entity.his.yp.*;
|
|
|
+import cn.hnthyy.thmz.mapper.his.yp.YpBaseMapper;
|
|
|
import cn.hnthyy.thmz.mapper.his.yp.YpBaseYfMapper;
|
|
|
import cn.hnthyy.thmz.mapper.his.yp.YpRepriceMapper;
|
|
|
import cn.hnthyy.thmz.mapper.his.yp.YpZdDictMapper;
|
|
@@ -41,6 +39,9 @@ public class YpRepriceServiceImpl implements YpRepricelService {
|
|
|
@SuppressWarnings("all")
|
|
|
@Autowired
|
|
|
private YpBaseYfMapper ypBaseYfMapper;
|
|
|
+ @SuppressWarnings("all")
|
|
|
+ @Autowired
|
|
|
+ private YpBaseMapper ypBaseMapper;
|
|
|
|
|
|
@Override
|
|
|
public List<YpReprice> queryYpReprice(YpReprice ypReprice) {
|
|
@@ -98,13 +99,18 @@ public class YpRepriceServiceImpl implements YpRepricelService {
|
|
|
ypBaseYf.setPackRetprice(ypZdDict.getPackRetprice());
|
|
|
ypBaseYf.setRetprice(ypZdDict.getRetprice());
|
|
|
ypBaseYfMapper.updateYpBaseYf(ypBaseYf);
|
|
|
+ YpBase ypBase = new YpBase();
|
|
|
+ ypBase.setChargeCode(yp.getCode());
|
|
|
+ ypBase.setSerial(yp.getSerial());
|
|
|
+ ypBase.setPackRetprice(ypZdDict.getPackRetprice());
|
|
|
+ ypBase.setRetprice(ypZdDict.getRetprice());
|
|
|
+ ypBaseMapper.updateYpBase(ypBase);
|
|
|
if(ypReprice.getSerial().equals("99")){
|
|
|
- YpReprice minYpReprice= ypReprice;
|
|
|
- minYpReprice.setReajustSerial(2);
|
|
|
- minYpReprice.setSerial("01");
|
|
|
- minYpReprice.setOrigPrice(yp.getRetprice());
|
|
|
- minYpReprice.setNewPrice(ypReprice.getNewPrice().divide(yp.getPackSize(),2, BigDecimal.ROUND_HALF_UP));
|
|
|
- changedNotFieldsOfSql = ColumnSqlUtil.getChangedNotFieldsOfSql(new YpReprice(), minYpReprice, 1);
|
|
|
+ ypReprice.setReajustSerial(2);
|
|
|
+ ypReprice.setSerial("01");
|
|
|
+ ypReprice.setOrigPrice(yp.getRetprice());
|
|
|
+ ypReprice.setNewPrice(ypReprice.getNewPrice().divide(yp.getPackSize(),2, BigDecimal.ROUND_HALF_UP));
|
|
|
+ changedNotFieldsOfSql = ColumnSqlUtil.getChangedNotFieldsOfSql(new YpReprice(), ypReprice, 1);
|
|
|
if (ypRepriceMapper.insertYpReprice(changedNotFieldsOfSql) != 1) {
|
|
|
throw new MzException("插入调价记录异常");
|
|
|
}
|
|
@@ -113,21 +119,23 @@ public class YpRepriceServiceImpl implements YpRepricelService {
|
|
|
minYpRepriceStock.setSerial("01");
|
|
|
ypRepriceMapper.insertYpRepriceStockYk(minYpRepriceStock);
|
|
|
ypRepriceMapper.insertYpRepriceStockYf(minYpRepriceStock);
|
|
|
- YpZdDict minYpZdDict = ypZdDict;
|
|
|
- minYpZdDict.setSerial("01");
|
|
|
- minYpZdDict.setPackRetprice(minYpReprice.getNewPrice());
|
|
|
- minYpZdDict.setRetprice(minYpZdDict.getPackRetprice());
|
|
|
- minYpZdDict.setBuyPrice(ypReprice.getNewBuyPrice().divide(yp.getPackSize(),2, BigDecimal.ROUND_HALF_UP));
|
|
|
- minYpZdDict.setFixPrice(minYpZdDict.getBuyPrice());
|
|
|
- minYpZdDict.setYbxjPrice(minYpZdDict.getBuyPrice());
|
|
|
- if (1 != ypZdDictMapper.updateYpZdDict(minYpZdDict)) {
|
|
|
+ ypZdDict.setSerial("01");
|
|
|
+ ypZdDict.setPackRetprice(ypReprice.getNewPrice());
|
|
|
+ ypZdDict.setRetprice(ypZdDict.getPackRetprice());
|
|
|
+ ypZdDict.setBuyPrice(ypReprice.getNewBuyPrice().divide(yp.getPackSize(),2, BigDecimal.ROUND_HALF_UP));
|
|
|
+ ypZdDict.setFixPrice(ypZdDict.getBuyPrice());
|
|
|
+ ypZdDict.setYbxjPrice(ypZdDict.getBuyPrice());
|
|
|
+ if (1 != ypZdDictMapper.updateYpZdDict(ypZdDict)) {
|
|
|
throw new MzException("更新药品价格异常");
|
|
|
}
|
|
|
- YpBaseYf minYpBaseYf = ypBaseYf;
|
|
|
- minYpBaseYf.setSerial("01");
|
|
|
- minYpBaseYf.setPackRetprice(minYpZdDict.getPackRetprice());
|
|
|
- minYpBaseYf.setRetprice(minYpZdDict.getPackRetprice());
|
|
|
- ypBaseYfMapper.updateYpBaseYf(minYpBaseYf);
|
|
|
+ ypBaseYf.setSerial("01");
|
|
|
+ ypBaseYf.setPackRetprice(ypZdDict.getPackRetprice());
|
|
|
+ ypBaseYf.setRetprice(ypZdDict.getPackRetprice());
|
|
|
+ ypBaseYfMapper.updateYpBaseYf(ypBaseYf);
|
|
|
+ ypBase.setSerial("01");
|
|
|
+ ypBase.setPackRetprice(ypZdDict.getPackRetprice());
|
|
|
+ ypBase.setRetprice(ypZdDict.getPackRetprice());
|
|
|
+ ypBaseMapper.updateYpBase(ypBase);
|
|
|
}
|
|
|
return reajustNo;
|
|
|
}
|