md
This commit is contained in:
parent
c4ebefd8bd
commit
4e47e2c5bc
@ -11,9 +11,15 @@
|
|||||||
|
|
||||||
package com.xdadan.erp.web.emis;
|
package com.xdadan.erp.web.emis;
|
||||||
|
|
||||||
|
import java.util.Date;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import javax.servlet.http.HttpServletResponse;
|
import javax.servlet.http.HttpServletResponse;
|
||||||
|
|
||||||
|
import com.xdadan.erp.common.utils.DateUtils;
|
||||||
|
import com.xdadan.erp.emis.domain.exception.EmisBizError;
|
||||||
|
import com.xdadan.erp.emis.utils.WaybillHelper;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.dao.DuplicateKeyException;
|
||||||
import org.springframework.security.access.prepost.PreAuthorize;
|
import org.springframework.security.access.prepost.PreAuthorize;
|
||||||
import org.springframework.web.bind.annotation.GetMapping;
|
import org.springframework.web.bind.annotation.GetMapping;
|
||||||
import org.springframework.web.bind.annotation.PostMapping;
|
import org.springframework.web.bind.annotation.PostMapping;
|
||||||
@ -94,6 +100,47 @@ public class EmisSiteAccountController extends EmisBaseController
|
|||||||
return toAjax(emisSiteAccountService.insertEmisSiteAccount(emisSiteAccount));
|
return toAjax(emisSiteAccountService.insertEmisSiteAccount(emisSiteAccount));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量开户
|
||||||
|
*/
|
||||||
|
@PreAuthorize("@ss.hasPermi('emis:emisSiteAccount:add')")
|
||||||
|
@Log(title = "网点结算账户", businessType = BusinessType.INSERT)
|
||||||
|
@PostMapping("/batchAddAccount")
|
||||||
|
public AjaxResult batchAddAccount(@RequestBody EmisSiteAccount emisSiteAccount)
|
||||||
|
{
|
||||||
|
String siteCodeStr=WaybillHelper.formatQueryValue(emisSiteAccount.getSiteCode());
|
||||||
|
if(!StringUtils.isEmpty(siteCodeStr))
|
||||||
|
{
|
||||||
|
String [] codeArr =siteCodeStr.split(",");
|
||||||
|
for(int i=0;i<codeArr.length;i++){
|
||||||
|
String siteCode=codeArr[i];
|
||||||
|
// 生成账户号
|
||||||
|
// String nowStr= DateUtils.parseDateToStr(DateUtils.YYYYMMDDHHMMSS,new Date());
|
||||||
|
// String applySeqNo=nowStr+Math.round(Math.random() * 23 + 1000);
|
||||||
|
EmisSiteAccount addSite = new EmisSiteAccount();
|
||||||
|
// 一个站点一个账户号,基本户 最多 999
|
||||||
|
String accCode=siteCode+"001";
|
||||||
|
addSite.setAccCode(accCode);
|
||||||
|
|
||||||
|
addSite.setSiteCode(siteCode);
|
||||||
|
addSite.setCurrency(emisSiteAccount.getCurrency());
|
||||||
|
|
||||||
|
// 判断国家是否有重复
|
||||||
|
try {
|
||||||
|
emisSiteAccountService.insertEmisSiteAccount(addSite);
|
||||||
|
} catch (DuplicateKeyException e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
return AjaxResult.error("卡户重复!");
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return AjaxResult.success("开户成功");
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 修改网点结算账户
|
* 修改网点结算账户
|
||||||
*/
|
*/
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user