TrustApplySupplementBiz.java
1.64 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
package com.cjs.cms.biz.ration;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import com.cjs.cms.dao.ration.OtcTrustEECodeDao;
import com.cjs.cms.dao.ration.TrustApplySupplementDao;
import com.cjs.cms.model.ration.OtcTrusteeCodeInfo;
import com.cjs.cms.model.ration.TrustApplySupplementInfo;
import com.cjs.cms.util.lang.JsonUtil;
/**
* 补货托管
*
* @author tongyufu
*
*/
@Service
public class TrustApplySupplementBiz {
@Autowired
private OtcTrustEECodeDao otcTrustEECodeDao;
@Autowired
private TrustApplySupplementDao trustApplySupplementDao;
/**修改入库总量*/
@Transactional
public String updateTotalAmount(OtcTrusteeCodeInfo otcTrusteeCodeInfo, String createBy) {
OtcTrusteeCodeInfo old = otcTrustEECodeDao.queryByOtcCode(otcTrusteeCodeInfo.getOtcCode());
otcTrustEECodeDao.updateTotalAmount(otcTrusteeCodeInfo);
TrustApplySupplementInfo supplement = new TrustApplySupplementInfo();
supplement.setOtcCode(old.getOtcCode());
supplement.setOtcName(old.getOtcName());
supplement.setBusinessFlag("2");
supplement.setApplyNo("");
supplement
.setOccurAmount(otcTrusteeCodeInfo.getApplicableAmount() - old.getApplicableAmount());
supplement.setPostAmount(otcTrusteeCodeInfo.getApplicableAmount());
supplement.setCreateBy(createBy);
supplement.setRemark(otcTrusteeCodeInfo.getRemark());
trustApplySupplementDao.save(supplement);
return JsonUtil.toFormJson("修改成功", true);
}
}