Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to run after fixing the refactoring code architecture #13 #18

Merged
merged 3 commits into from
Aug 31, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion api/src/main/java/com/wansensoft/api/ErpApplication.java
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

@SpringBootApplication
@EnableScheduling
@MapperScan("com.wansensoft.mappers")
@MapperScan("com.wansensoft")
@ComponentScan("com.wansensoft")
public class ErpApplication {

Expand Down
26 changes: 13 additions & 13 deletions api/src/main/java/com/wansensoft/api/account/AccountController.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.wansensoft.entities.account.Account;
import com.wansensoft.service.account.AccountService;
import com.wansensoft.service.account.AccountServiceImpl;
import com.wansensoft.service.systemConfig.SystemConfigService;
import com.wansensoft.utils.BaseResponseInfo;
import com.wansensoft.utils.ErpInfo;
Expand All @@ -26,12 +26,12 @@
public class AccountController {
private Logger logger = LoggerFactory.getLogger(AccountController.class);

private final AccountService accountService;
private final AccountServiceImpl accountServiceImpl;

private final SystemConfigService systemConfigService;

public AccountController(AccountService accountService, SystemConfigService systemConfigService) {
this.accountService = accountService;
public AccountController(AccountServiceImpl accountServiceImpl, SystemConfigService systemConfigService) {
this.accountServiceImpl = accountServiceImpl;
this.systemConfigService = systemConfigService;
}

Expand All @@ -46,7 +46,7 @@ public AccountController(AccountService accountService, SystemConfigService syst
public String findBySelect(HttpServletRequest request) throws Exception {
String res = null;
try {
List<Account> dataList = accountService.findBySelect();
List<Account> dataList = accountServiceImpl.findBySelect();
//存放数据json数组
JSONArray dataArray = new JSONArray();
if (null != dataList) {
Expand Down Expand Up @@ -77,7 +77,7 @@ public BaseResponseInfo getAccount(HttpServletRequest request) throws Exception
BaseResponseInfo res = new BaseResponseInfo();
Map<String, Object> map = new HashMap<String, Object>();
try {
List<Account> accountList = accountService.getAccount();
List<Account> accountList = accountServiceImpl.getAccount();
map.put("accountList", accountList);
res.code = 200;
res.data = map;
Expand Down Expand Up @@ -108,8 +108,8 @@ public BaseResponseInfo findAccountInOutList(@RequestParam("currentPage") Intege
BaseResponseInfo res = new BaseResponseInfo();
Map<String, Object> map = new HashMap<String, Object>();
try {
List<AccountVo4InOutList> dataList = accountService.findAccountInOutList(accountId, (currentPage-1)*pageSize, pageSize);
int total = accountService.findAccountInOutListCount(accountId);
List<AccountVo4InOutList> dataList = accountServiceImpl.findAccountInOutList(accountId, (currentPage-1)*pageSize, pageSize);
int total = accountServiceImpl.findAccountInOutListCount(accountId);
map.put("total", total);
//存放数据json数组
JSONArray dataArray = new JSONArray();
Expand All @@ -119,8 +119,8 @@ public BaseResponseInfo findAccountInOutList(@RequestParam("currentPage") Intege
String type = aEx.getType().replace("其它", "");
aEx.setType(type);
String timeStr = aEx.getOperTime().toString();
BigDecimal balance = accountService.getAccountSum(accountId, timeStr, "date", forceFlag).add(accountService.getAccountSumByHead(accountId, timeStr, "date", forceFlag))
.add(accountService.getAccountSumByDetail(accountId, timeStr, "date", forceFlag)).add(accountService.getManyAccountSum(accountId, timeStr, "date", forceFlag)).add(initialAmount);
BigDecimal balance = accountServiceImpl.getAccountSum(accountId, timeStr, "date", forceFlag).add(accountServiceImpl.getAccountSumByHead(accountId, timeStr, "date", forceFlag))
.add(accountServiceImpl.getAccountSumByDetail(accountId, timeStr, "date", forceFlag)).add(accountServiceImpl.getManyAccountSum(accountId, timeStr, "date", forceFlag)).add(initialAmount);
aEx.setBalance(balance);
aEx.setAccountId(accountId);
dataArray.add(aEx);
Expand Down Expand Up @@ -150,7 +150,7 @@ public String updateIsDefault(@RequestBody JSONObject object,
HttpServletRequest request) throws Exception{
Long accountId = object.getLong("id");
Map<String, Object> objectMap = new HashMap<>();
int res = accountService.updateIsDefault(accountId);
int res = accountServiceImpl.updateIsDefault(accountId);
if(res > 0) {
return ResponseJsonUtil.returnJson(objectMap, ErpInfo.OK.name, ErpInfo.OK.code);
} else {
Expand All @@ -170,7 +170,7 @@ public BaseResponseInfo getStatistics(@RequestParam("name") String name,
HttpServletRequest request) throws Exception {
BaseResponseInfo res = new BaseResponseInfo();
try {
Map<String, Object> map = accountService.getStatistics(name, serialNo);
Map<String, Object> map = accountServiceImpl.getStatistics(name, serialNo);
res.code = 200;
res.data = map;
} catch(Exception e){
Expand All @@ -194,7 +194,7 @@ public String batchSetStatus(@RequestBody JSONObject jsonObject,
Boolean status = jsonObject.getBoolean("status");
String ids = jsonObject.getString("ids");
Map<String, Object> objectMap = new HashMap<>();
int res = accountService.batchSetStatus(status, ids);
int res = accountServiceImpl.batchSetStatus(status, ids);
if(res > 0) {
return ResponseJsonUtil.returnJson(objectMap, ErpInfo.OK.name, ErpInfo.OK.code);
} else {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
import com.wansensoft.entities.account.AccountHead;
import com.wansensoft.entities.account.AccountHeadVo4Body;
import com.wansensoft.entities.account.AccountHeadVo4ListEx;
import com.wansensoft.service.accountHead.AccountHeadServiceImpl;
import com.wansensoft.utils.constants.ExceptionConstants;
import com.wansensoft.service.accountHead.AccountHeadService;
import com.wansensoft.utils.BaseResponseInfo;
import com.wansensoft.utils.ErpInfo;
import com.wansensoft.utils.ResponseJsonUtil;
Expand All @@ -30,7 +30,7 @@ public class AccountHeadController {
private Logger logger = LoggerFactory.getLogger(AccountHeadController.class);

@Resource
private AccountHeadService accountHeadService;
private AccountHeadServiceImpl accountHeadServiceImpl;

/**
* 批量设置状态-审核或者反审核
Expand All @@ -45,7 +45,7 @@ public String batchSetStatus(@RequestBody JSONObject jsonObject,
Map<String, Object> objectMap = new HashMap<>();
String status = jsonObject.getString("status");
String ids = jsonObject.getString("ids");
int res = accountHeadService.batchSetStatus(status, ids);
int res = accountHeadServiceImpl.batchSetStatus(status, ids);
if(res > 0) {
return ResponseJsonUtil.returnJson(objectMap, ErpInfo.OK.name, ErpInfo.OK.code);
} else {
Expand All @@ -66,7 +66,7 @@ public Object addAccountHeadAndDetail(@RequestBody AccountHeadVo4Body body, Http
JSONObject result = ExceptionConstants.standardSuccess();
String beanJson = body.getInfo();
String rows = body.getRows();
accountHeadService.addAccountHeadAndDetail(beanJson,rows, request);
accountHeadServiceImpl.addAccountHeadAndDetail(beanJson,rows, request);
return result;
}

Expand All @@ -83,7 +83,7 @@ public Object updateAccountHeadAndDetail(@RequestBody AccountHeadVo4Body body, H
JSONObject result = ExceptionConstants.standardSuccess();
String beanJson = body.getInfo();
String rows = body.getRows();
accountHeadService.updateAccountHeadAndDetail(beanJson,rows,request);
accountHeadServiceImpl.updateAccountHeadAndDetail(beanJson,rows,request);
return result;
}

Expand All @@ -100,7 +100,7 @@ public BaseResponseInfo getDetailByNumber(@RequestParam("billNo") String billNo,
BaseResponseInfo res = new BaseResponseInfo();
AccountHeadVo4ListEx ahl = new AccountHeadVo4ListEx();
try {
List<AccountHeadVo4ListEx> list = accountHeadService.getDetailByNumber(billNo);
List<AccountHeadVo4ListEx> list = accountHeadServiceImpl.getDetailByNumber(billNo);
if(list.size()>0) {
ahl = list.get(0);
}
Expand All @@ -126,7 +126,7 @@ public BaseResponseInfo getFinancialBillNoByBillId(@RequestParam("billId") Long
HttpServletRequest request)throws Exception {
BaseResponseInfo res = new BaseResponseInfo();
try {
List<AccountHead> list = accountHeadService.getFinancialBillNoByBillId(billId);
List<AccountHead> list = accountHeadServiceImpl.getFinancialBillNoByBillId(billId);
res.code = 200;
res.data = list;
} catch(Exception e){
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import com.alibaba.fastjson.JSONObject;
import com.wansensoft.vo.AccountItemVo4List;
import com.wansensoft.utils.constants.BusinessConstants;
import com.wansensoft.service.accountHead.AccountHeadService;
import com.wansensoft.service.accountHead.AccountHeadServiceImpl;
import com.wansensoft.service.accountItem.AccountItemService;
import com.wansensoft.utils.BaseResponseInfo;
import com.wansensoft.utils.StringUtil;
Expand Down Expand Up @@ -36,7 +36,7 @@ public class AccountItemController {
private AccountItemService accountItemService;

@Resource
private AccountHeadService accountHeadService;
private AccountHeadServiceImpl accountHeadServiceImpl;

@GetMapping(value = "/getDetailList")
@ApiOperation(value = "明细列表")
Expand All @@ -48,7 +48,7 @@ public BaseResponseInfo getDetailList(@RequestParam("headerId") Long headerId,
List<AccountItemVo4List> dataList = new ArrayList<>();
if(headerId != 0) {
dataList = accountItemService.getDetailList(headerId);
type = accountHeadService.getAccountHead(headerId).getType();
type = accountHeadServiceImpl.getAccountHead(headerId).getType();
}
JSONObject outer = new JSONObject();
outer.put("total", dataList.size());
Expand Down
32 changes: 16 additions & 16 deletions api/src/main/java/com/wansensoft/api/depot/DepotController.java
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@
import com.wansensoft.entities.depot.Depot;
import com.wansensoft.entities.depot.DepotEx;
import com.wansensoft.entities.material.MaterialInitialStock;
import com.wansensoft.service.depot.DepotService;
import com.wansensoft.service.material.MaterialService;
import com.wansensoft.service.userBusiness.UserBusinessService;
import com.wansensoft.service.depot.DepotServiceImpl;
import com.wansensoft.service.material.MaterialServiceImpl;
import com.wansensoft.service.userBusiness.UserBusinessServiceImpl;
import com.wansensoft.utils.BaseResponseInfo;
import com.wansensoft.utils.ErpInfo;
import com.wansensoft.utils.ResponseJsonUtil;
Expand All @@ -32,13 +32,13 @@ public class DepotController {
private Logger logger = LoggerFactory.getLogger(DepotController.class);

@Resource
private DepotService depotService;
private DepotServiceImpl depotServiceImpl;

@Resource
private UserBusinessService userBusinessService;
private UserBusinessServiceImpl userBusinessServiceImpl;

@Resource
private MaterialService materialService;
private MaterialServiceImpl materialServiceImpl;

/**
* 仓库列表
Expand All @@ -51,7 +51,7 @@ public class DepotController {
public BaseResponseInfo getAllList(HttpServletRequest request) throws Exception{
BaseResponseInfo res = new BaseResponseInfo();
try {
List<Depot> depotList = depotService.getAllList();
List<Depot> depotList = depotServiceImpl.getAllList();
res.code = 200;
res.data = depotList;
} catch(Exception e){
Expand All @@ -76,8 +76,8 @@ public JSONArray findUserDepot(@RequestParam("UBType") String type, @RequestPara
JSONArray arr = new JSONArray();
try {
//获取权限信息
String ubValue = userBusinessService.getUBValueByTypeAndKeyId(type, keyId);
List<Depot> dataList = depotService.findUserDepot();
String ubValue = userBusinessServiceImpl.getUBValueByTypeAndKeyId(type, keyId);
List<Depot> dataList = depotServiceImpl.findUserDepot();
//开始拼接json数据
JSONObject outer = new JSONObject();
outer.put("id", 0);
Expand Down Expand Up @@ -121,7 +121,7 @@ public JSONArray findUserDepot(@RequestParam("UBType") String type, @RequestPara
public BaseResponseInfo findDepotByCurrentUser(HttpServletRequest request) throws Exception{
BaseResponseInfo res = new BaseResponseInfo();
try {
JSONArray arr = depotService.findDepotByCurrentUser();
JSONArray arr = depotServiceImpl.findDepotByCurrentUser();
res.code = 200;
res.data = arr;
} catch (Exception e) {
Expand All @@ -145,7 +145,7 @@ public String updateIsDefault(@RequestBody JSONObject object,
HttpServletRequest request) throws Exception{
Long depotId = object.getLong("id");
Map<String, Object> objectMap = new HashMap<>();
int res = depotService.updateIsDefault(depotId);
int res = depotServiceImpl.updateIsDefault(depotId);
if(res > 0) {
return ResponseJsonUtil.returnJson(objectMap, ErpInfo.OK.name, ErpInfo.OK.code);
} else {
Expand All @@ -165,16 +165,16 @@ public BaseResponseInfo getAllList(@RequestParam("mId") Long mId,
HttpServletRequest request) {
BaseResponseInfo res = new BaseResponseInfo();
try {
List<Depot> list = depotService.getAllList();
List<Depot> list = depotServiceImpl.getAllList();
List<DepotEx> depotList = new ArrayList<DepotEx>();
for(Depot depot: list) {
DepotEx de = new DepotEx();
if(mId!=0) {
BigDecimal initStock = materialService.getInitStock(mId, depot.getId());
BigDecimal currentStock = materialService.getCurrentStockByMaterialIdAndDepotId(mId, depot.getId());
BigDecimal initStock = materialServiceImpl.getInitStock(mId, depot.getId());
BigDecimal currentStock = materialServiceImpl.getCurrentStockByMaterialIdAndDepotId(mId, depot.getId());
de.setInitStock(initStock);
de.setCurrentStock(currentStock);
MaterialInitialStock materialInitialStock = materialService.getSafeStock(mId, depot.getId());
MaterialInitialStock materialInitialStock = materialServiceImpl.getSafeStock(mId, depot.getId());
de.setLowSafeStock(materialInitialStock.getLowSafeStock());
de.setHighSafeStock(materialInitialStock.getHighSafeStock());
} else {
Expand Down Expand Up @@ -208,7 +208,7 @@ public String batchSetStatus(@RequestBody JSONObject jsonObject,
Boolean status = jsonObject.getBoolean("status");
String ids = jsonObject.getString("ids");
Map<String, Object> objectMap = new HashMap<>();
int res = depotService.batchSetStatus(status, ids);
int res = depotServiceImpl.batchSetStatus(status, ids);
if(res > 0) {
return ResponseJsonUtil.returnJson(objectMap, ErpInfo.OK.name, ErpInfo.OK.code);
} else {
Expand Down
Loading