优化采购入库的账户
This commit is contained in:
@@ -525,13 +525,12 @@ public class AccountService {
|
|||||||
|
|
||||||
public String getAccountStrByIdAndMoney(Map<Long,String> accountMap, String accountIdList, String accountMoneyList){
|
public String getAccountStrByIdAndMoney(Map<Long,String> accountMap, String accountIdList, String accountMoneyList){
|
||||||
StringBuffer sb = new StringBuffer();
|
StringBuffer sb = new StringBuffer();
|
||||||
accountIdList = accountIdList.replace("[", "").replace("]", "").replace("\"", "");
|
|
||||||
accountMoneyList = accountMoneyList.replace("[", "").replace("]", "").replace("\"", "");
|
|
||||||
List<Long> idList = StringUtil.strToLongList(accountIdList);
|
List<Long> idList = StringUtil.strToLongList(accountIdList);
|
||||||
List<Long> moneyList = StringUtil.strToLongList(accountMoneyList);
|
List<Long> moneyList = StringUtil.strToLongList(accountMoneyList);
|
||||||
for (int i = 0; i < idList.size(); i++) {
|
for (int i = 0; i < idList.size(); i++) {
|
||||||
Long id = idList.get(i);
|
Long id = idList.get(i);
|
||||||
sb.append(accountMap.get(id) + "(" + moneyList.get(i) + "元) ");
|
BigDecimal money = BigDecimal.valueOf(moneyList.get(i)).abs();
|
||||||
|
sb.append(accountMap.get(id) + "(" + money + "元) ");
|
||||||
}
|
}
|
||||||
return sb.toString();
|
return sb.toString();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -523,6 +523,8 @@ public class DepotHeadService {
|
|||||||
depotHead.setCreateTime(new Timestamp(System.currentTimeMillis()));
|
depotHead.setCreateTime(new Timestamp(System.currentTimeMillis()));
|
||||||
depotHead.setStatus(BusinessConstants.BILLS_STATUS_UN_AUDIT);
|
depotHead.setStatus(BusinessConstants.BILLS_STATUS_UN_AUDIT);
|
||||||
depotHead.setPayType(depotHead.getPayType()==null?"现付":depotHead.getPayType());
|
depotHead.setPayType(depotHead.getPayType()==null?"现付":depotHead.getPayType());
|
||||||
|
depotHead.setAccountIdList(depotHead.getAccountIdList().replace("[", "").replace("]", "").replaceAll("\"", ""));
|
||||||
|
depotHead.setAccountMoneyList(depotHead.getAccountMoneyList().replace("[", "").replace("]", "").replaceAll("\"", ""));
|
||||||
try{
|
try{
|
||||||
depotHeadMapper.insertSelective(depotHead);
|
depotHeadMapper.insertSelective(depotHead);
|
||||||
}catch(Exception e){
|
}catch(Exception e){
|
||||||
@@ -574,6 +576,8 @@ public class DepotHeadService {
|
|||||||
BigDecimal preTotalPrice, Long tenantId,HttpServletRequest request)throws Exception {
|
BigDecimal preTotalPrice, Long tenantId,HttpServletRequest request)throws Exception {
|
||||||
/**更新单据主表信息*/
|
/**更新单据主表信息*/
|
||||||
DepotHead depotHead = JSONObject.parseObject(beanJson, DepotHead.class);
|
DepotHead depotHead = JSONObject.parseObject(beanJson, DepotHead.class);
|
||||||
|
depotHead.setAccountIdList(depotHead.getAccountIdList().replace("[", "").replace("]", "").replaceAll("\"", ""));
|
||||||
|
depotHead.setAccountMoneyList(depotHead.getAccountMoneyList().replace("[", "").replace("]", "").replaceAll("\"", ""));
|
||||||
try{
|
try{
|
||||||
depotHeadMapper.updateByPrimaryKeySelective(depotHead);
|
depotHeadMapper.updateByPrimaryKeySelective(depotHead);
|
||||||
}catch(Exception e){
|
}catch(Exception e){
|
||||||
|
|||||||
Reference in New Issue
Block a user