Skip to content

Commit

Permalink
Merge pull request #20 from Jzow/master
Browse files Browse the repository at this point in the history
Adjusting code structure
  • Loading branch information
Jzow authored Sep 1, 2023
2 parents 650aec0 + 2d18b4d commit 9a38202
Show file tree
Hide file tree
Showing 79 changed files with 1,073 additions and 947 deletions.
30 changes: 15 additions & 15 deletions api/src/main/java/com/wansensoft/api/depot/DepotItemController.java
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
import com.wansensoft.entities.depot.DepotItemVo4WithInfoEx;
import com.wansensoft.entities.material.MaterialVo4Unit;
import com.wansensoft.entities.unit.Unit;
import com.wansensoft.service.role.RoleServiceImpl;
import com.wansensoft.service.user.UserServiceImpl;
import com.wansensoft.utils.constants.BusinessConstants;
import com.wansensoft.utils.constants.ExceptionConstants;
Expand All @@ -15,7 +16,6 @@
import com.wansensoft.service.depotHead.DepotHeadServiceImpl;
import com.wansensoft.service.depotItem.DepotItemServiceImpl;
import com.wansensoft.service.material.MaterialServiceImpl;
import com.wansensoft.service.role.RoleService;
import com.wansensoft.service.systemConfig.SystemConfigService;
import com.wansensoft.service.unit.UnitService;
import com.wansensoft.utils.*;
Expand Down Expand Up @@ -65,7 +65,7 @@ public class DepotItemController {
private DepotServiceImpl depotServiceImpl;

@Resource
private RoleService roleService;
private RoleServiceImpl roleServiceImpl;

@Resource
private UserServiceImpl userServiceImpl;
Expand Down Expand Up @@ -247,15 +247,15 @@ public BaseResponseInfo getDetailList(@RequestParam("headerId") Long headerId,
item.put("basicNumber", diEx.getBasicNumber());
item.put("preNumber", diEx.getOperNumber()); //原数量
item.put("finishNumber", depotItemServiceImpl.getFinishNumber(diEx.getMaterialExtendId(), diEx.getId(), diEx.getHeaderId(), unitInfo, materialUnit, linkType)); //已入库|已出库
item.put("purchaseDecimal", roleService.parseBillPriceByLimit(diEx.getPurchaseDecimal(), billCategory, priceLimit, request)); //采购价
item.put("purchaseDecimal", roleServiceImpl.parseBillPriceByLimit(diEx.getPurchaseDecimal(), billCategory, priceLimit, request)); //采购价
if("basic".equals(linkType)) {
//正常情况显示金额,而以销定购的情况不能显示金额
item.put("unitPrice", roleService.parseBillPriceByLimit(diEx.getUnitPrice(), billCategory, priceLimit, request));
item.put("taxUnitPrice", roleService.parseBillPriceByLimit(diEx.getTaxUnitPrice(), billCategory, priceLimit, request));
item.put("allPrice", roleService.parseBillPriceByLimit(diEx.getAllPrice(), billCategory, priceLimit, request));
item.put("taxRate", roleService.parseBillPriceByLimit(diEx.getTaxRate(), billCategory, priceLimit, request));
item.put("taxMoney", roleService.parseBillPriceByLimit(diEx.getTaxMoney(), billCategory, priceLimit, request));
item.put("taxLastMoney", roleService.parseBillPriceByLimit(diEx.getTaxLastMoney(), billCategory, priceLimit, request));
item.put("unitPrice", roleServiceImpl.parseBillPriceByLimit(diEx.getUnitPrice(), billCategory, priceLimit, request));
item.put("taxUnitPrice", roleServiceImpl.parseBillPriceByLimit(diEx.getTaxUnitPrice(), billCategory, priceLimit, request));
item.put("allPrice", roleServiceImpl.parseBillPriceByLimit(diEx.getAllPrice(), billCategory, priceLimit, request));
item.put("taxRate", roleServiceImpl.parseBillPriceByLimit(diEx.getTaxRate(), billCategory, priceLimit, request));
item.put("taxMoney", roleServiceImpl.parseBillPriceByLimit(diEx.getTaxMoney(), billCategory, priceLimit, request));
item.put("taxLastMoney", roleServiceImpl.parseBillPriceByLimit(diEx.getTaxLastMoney(), billCategory, priceLimit, request));
}
BigDecimal allWeight = diEx.getBasicNumber()==null||diEx.getWeight()==null?BigDecimal.ZERO:diEx.getBasicNumber().multiply(diEx.getWeight());
item.put("weight", allWeight);
Expand Down Expand Up @@ -286,9 +286,9 @@ public BaseResponseInfo getDetailList(@RequestParam("headerId") Long headerId,
if(StringUtil.isNotEmpty(isReadOnly) && "1".equals(isReadOnly)) {
JSONObject footItem = new JSONObject();
footItem.put("operNumber", totalOperNumber);
footItem.put("allPrice", roleService.parseBillPriceByLimit(totalAllPrice, billCategory, priceLimit, request));
footItem.put("taxMoney", roleService.parseBillPriceByLimit(totalTaxMoney, billCategory, priceLimit, request));
footItem.put("taxLastMoney", roleService.parseBillPriceByLimit(totalTaxLastMoney, billCategory, priceLimit, request));
footItem.put("allPrice", roleServiceImpl.parseBillPriceByLimit(totalAllPrice, billCategory, priceLimit, request));
footItem.put("taxMoney", roleServiceImpl.parseBillPriceByLimit(totalTaxMoney, billCategory, priceLimit, request));
footItem.put("taxLastMoney", roleServiceImpl.parseBillPriceByLimit(totalTaxLastMoney, billCategory, priceLimit, request));
footItem.put("weight", totalWeight);
dataArray.add(footItem);
}
Expand Down Expand Up @@ -829,7 +829,7 @@ public BaseResponseInfo buyOrSalePrice(@RequestParam(value = "roleType", require
BigDecimal outPrice = depotItemServiceImpl.inOrOutPrice("入库", "采购", month, roleType);
BigDecimal inPrice = depotItemServiceImpl.inOrOutPrice("出库", "采购退货", month, roleType);
obj.put("x", month);
obj.put("y", roleService.parseHomePriceByLimit(outPrice.subtract(inPrice), "buy", priceLimit, "***", request));
obj.put("y", roleServiceImpl.parseHomePriceByLimit(outPrice.subtract(inPrice), "buy", priceLimit, "***", request));
buyPriceList.add(obj);
}
map.put("buyPriceList", buyPriceList);
Expand All @@ -839,7 +839,7 @@ public BaseResponseInfo buyOrSalePrice(@RequestParam(value = "roleType", require
BigDecimal outPrice = depotItemServiceImpl.inOrOutPrice("出库", "销售", month, roleType);
BigDecimal inPrice = depotItemServiceImpl.inOrOutPrice("入库", "销售退货", month, roleType);
obj.put("x", month);
obj.put("y", roleService.parseHomePriceByLimit(outPrice.subtract(inPrice), "sale", priceLimit, "***", request));
obj.put("y", roleServiceImpl.parseHomePriceByLimit(outPrice.subtract(inPrice), "sale", priceLimit, "***", request));
salePriceList.add(obj);
}
map.put("salePriceList", salePriceList);
Expand All @@ -849,7 +849,7 @@ public BaseResponseInfo buyOrSalePrice(@RequestParam(value = "roleType", require
BigDecimal outPrice = depotItemServiceImpl.inOrOutRetailPrice("出库", "零售", month, roleType);
BigDecimal inPrice = depotItemServiceImpl.inOrOutRetailPrice("入库", "零售退货", month, roleType);
obj.put("x", month);
obj.put("y", roleService.parseHomePriceByLimit(outPrice.subtract(inPrice), "retail", priceLimit, "***", request));
obj.put("y", roleServiceImpl.parseHomePriceByLimit(outPrice.subtract(inPrice), "retail", priceLimit, "***", request));
retailPriceList.add(obj);
}
map.put("retailPriceList", retailPriceList);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.wansensoft.entities.organization.Organization;
import com.wansensoft.service.organization.OrganizationServiceImpl;
import com.wansensoft.utils.constants.ExceptionConstants;
import com.wansensoft.plugins.exception.BusinessRunTimeException;
import com.wansensoft.service.organization.OrganizationService;
import com.wansensoft.utils.BaseResponseInfo;
import com.wansensoft.vo.TreeNode;
import io.swagger.annotations.Api;
Expand All @@ -28,7 +28,7 @@ public class OrganizationController {
private Logger logger = LoggerFactory.getLogger(OrganizationController.class);

@Resource
private OrganizationService organizationService;
private OrganizationServiceImpl organizationServiceImpl;
/**
* 根据id来查询机构信息
* @param id
Expand All @@ -41,14 +41,14 @@ public BaseResponseInfo findById(@RequestParam("id") Long id, HttpServletRequest
BaseResponseInfo res = new BaseResponseInfo();
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
try {
List<Organization> dataList = organizationService.findById(id);
List<Organization> dataList = organizationServiceImpl.findById(id);
JSONObject outer = new JSONObject();
if (null != dataList) {
for (Organization org : dataList) {
outer.put("id", org.getId());
outer.put("orgAbr", org.getOrgAbr());
outer.put("parentId", org.getParentId());
List<Organization> dataParentList = organizationService.findByParentId(org.getParentId());
List<Organization> dataParentList = organizationServiceImpl.findByParentId(org.getParentId());
if(dataParentList!=null&&dataParentList.size()>0){
//父级机构名称显示简称
outer.put("orgParentName", dataParentList.get(0).getOrgAbr());
Expand Down Expand Up @@ -78,7 +78,7 @@ public BaseResponseInfo findById(@RequestParam("id") Long id, HttpServletRequest
@ApiOperation(value = "获取机构树数据")
public JSONArray getOrganizationTree(@RequestParam("id") Long id) throws Exception{
JSONArray arr=new JSONArray();
List<TreeNode> organizationTree= organizationService.getOrganizationTree(id);
List<TreeNode> organizationTree= organizationServiceImpl.getOrganizationTree(id);
if(organizationTree!=null&&organizationTree.size()>0){
for(TreeNode node:organizationTree){
String str=JSON.toJSONString(node);
Expand All @@ -99,7 +99,7 @@ public JSONArray getOrganizationTree(@RequestParam("id") Long id) throws Excepti
public Object addOrganization(@RequestParam("info") String beanJson) throws Exception {
JSONObject result = ExceptionConstants.standardSuccess();
Organization org= JSON.parseObject(beanJson, Organization.class);
int i= organizationService.addOrganization(org);
int i= organizationServiceImpl.addOrganization(org);
if(i<1){
throw new BusinessRunTimeException(ExceptionConstants.ORGANIZATION_ADD_FAILED_CODE,
ExceptionConstants.ORGANIZATION_ADD_FAILED_MSG);
Expand All @@ -117,7 +117,7 @@ public Object addOrganization(@RequestParam("info") String beanJson) throws Exce
public Object editOrganization(@RequestParam("info") String beanJson) throws Exception {
JSONObject result = ExceptionConstants.standardSuccess();
Organization org= JSON.parseObject(beanJson, Organization.class);
int i= organizationService.editOrganization(org);
int i= organizationServiceImpl.editOrganization(org);
if(i<1){
throw new BusinessRunTimeException(ExceptionConstants.ORGANIZATION_EDIT_FAILED_CODE,
ExceptionConstants.ORGANIZATION_EDIT_FAILED_MSG);
Expand Down
10 changes: 5 additions & 5 deletions api/src/main/java/com/wansensoft/api/role/RoleController.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.role.Role;
import com.wansensoft.service.role.RoleService;
import com.wansensoft.service.role.RoleServiceImpl;
import com.wansensoft.service.userBusiness.UserBusinessServiceImpl;
import com.wansensoft.utils.ErpInfo;
import com.wansensoft.utils.ResponseJsonUtil;
Expand All @@ -26,7 +26,7 @@ public class RoleController {
private Logger logger = LoggerFactory.getLogger(RoleController.class);

@Resource
private RoleService roleService;
private RoleServiceImpl roleServiceImpl;

@Resource
private UserBusinessServiceImpl userBusinessServiceImpl;
Expand All @@ -44,7 +44,7 @@ public JSONArray findUserRole(@RequestParam("UBType") String type, @RequestParam
try {
//获取权限信息
String ubValue = userBusinessServiceImpl.getUBValueByTypeAndKeyId(type, keyId);
List<Role> dataList = roleService.findUserRole();
List<Role> dataList = roleServiceImpl.findUserRole();
if (null != dataList) {
for (Role role : dataList) {
JSONObject item = new JSONObject();
Expand All @@ -66,7 +66,7 @@ public JSONArray findUserRole(@RequestParam("UBType") String type, @RequestParam
@GetMapping(value = "/allList")
@ApiOperation(value = "查询全部角色列表")
public List<Role> allList(HttpServletRequest request)throws Exception {
return roleService.allList();
return roleServiceImpl.allList();
}

/**
Expand All @@ -82,7 +82,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 = roleService.batchSetStatus(status, ids);
int res = roleServiceImpl.batchSetStatus(status, ids);
if(res > 0) {
return ResponseJsonUtil.returnJson(objectMap, ErpInfo.OK.name, ErpInfo.OK.code);
} else {
Expand Down
6 changes: 3 additions & 3 deletions api/src/main/java/com/wansensoft/api/user/UserController.java
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
import com.wansensoft.utils.constants.ExceptionConstants;
import com.wansensoft.plugins.exception.BusinessParamCheckingException;
import com.wansensoft.service.redis.RedisService;
import com.wansensoft.service.role.RoleService;
import com.wansensoft.service.role.RoleServiceImpl;
import com.wansensoft.service.user.UserServiceImpl;
import com.wansensoft.utils.*;
import com.wansensoft.vo.TreeNodeEx;
Expand Down Expand Up @@ -40,7 +40,7 @@ public class UserController {
private UserServiceImpl userServiceImpl;

@Resource
private RoleService roleService;
private RoleServiceImpl roleServiceImpl;

@Resource
private TenantServiceImpl tenantServiceImpl;
Expand Down Expand Up @@ -335,7 +335,7 @@ public BaseResponseInfo getCurrentPriceLimit(HttpServletRequest request)throws E
BaseResponseInfo res = new BaseResponseInfo();
try {
Map<String, Object> data = new HashMap<>();
String priceLimit = roleService.getCurrentPriceLimit(request);
String priceLimit = roleServiceImpl.getCurrentPriceLimit(request);
data.put("priceLimit", priceLimit);
res.code = 200;
res.data = data;
Expand Down
2 changes: 1 addition & 1 deletion api/src/main/resources/application.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ logging:
config: classpath:logback-spring.xml

mybatis-plus:
mapper-locations: classpath*:./mapper_xml/*Mapper.xml,classpath*:./mapper_xml/*MapperEx.xml
mapper-locations: classpath*:./mapper_xml/*.xml
type-aliases-package: com.wansensoft.entity
global-config:
id-type: 0
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ public interface AccountHeadMapper extends BaseMapper<AccountHead> {

int deleteByPrimaryKey(Long id);

int insert(AccountHead record);
int insertAccountHead(AccountHead record);

int insertSelective(AccountHead record);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ public interface AccountItemMapper extends BaseMapper<AccountItem> {

int deleteByPrimaryKey(Long id);

int insert(AccountItem record);
int insertAccountItem(AccountItem record);

int insertSelective(AccountItem record);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ public interface AccountMapper extends BaseMapper<Account> {

int deleteByPrimaryKey(Long id);

int insert(Account record);
int insertAccount(Account record);

int insertSelective(Account record);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ public interface DepotHeadMapper extends BaseMapper<DepotHead> {

int deleteByPrimaryKey(Long id);

int insert(DepotHead record);
int insertDepotHead(DepotHead record);

int insertSelective(DepotHead record);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ public interface DepotItemMapper extends BaseMapper<DepotItem> {

int deleteByPrimaryKey(Long id);

int insert(DepotItem record);
int insertDepotItem(DepotItem record);

int insertSelective(DepotItem record);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ public interface DepotMapper extends BaseMapper<Depot> {

int deleteByPrimaryKey(Long id);

int insert(Depot record);
int insertDepot(Depot record);

int insertSelective(Depot record);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ public interface FunctionMapper extends BaseMapper<Function> {

int deleteByPrimaryKey(Long id);

int insert(Function record);
int insertFunction(Function record);

int insertSelective(Function record);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ public interface InOutItemMapper extends BaseMapper<InOutItem> {

int deleteByPrimaryKey(Long id);

int insert(InOutItem record);
int insertInOutItem(InOutItem record);

int insertSelective(InOutItem record);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ public interface LogMapper extends BaseMapper<Log> {

int deleteByPrimaryKey(Long id);

int insert(Log record);
int insertLog(Log record);

int insertSelective(Log record);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ public interface MaterialAttributeMapper extends BaseMapper<MaterialAttribute> {

int deleteByPrimaryKey(Long id);

int insert(MaterialAttribute record);
int insertMaterialAttribute(MaterialAttribute record);

int insertSelective(MaterialAttribute record);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ public interface MaterialCategoryMapper extends BaseMapper<MaterialCategory> {

int deleteByPrimaryKey(Long id);

int insert(MaterialCategory record);
int insertMaterialCategory(MaterialCategory record);

int insertSelective(MaterialCategory record);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ public interface MaterialCurrentStockMapper extends BaseMapper<MaterialCurrentSt

int deleteByPrimaryKey(Long id);

int insert(MaterialCurrentStock record);
int insertMaterialCurrentStock(MaterialCurrentStock record);

int insertSelective(MaterialCurrentStock record);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ public interface MaterialExtendMapper extends BaseMapper<MaterialExtend> {

int deleteByPrimaryKey(Long id);

int insert(MaterialExtend record);
int insertMaterialExtend(MaterialExtend record);

int insertSelective(MaterialExtend record);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ public interface MaterialInitialStockMapper extends BaseMapper<MaterialInitialSt

int deleteByPrimaryKey(Long id);

int insert(MaterialInitialStock record);
int insertMaterialInitialStock(MaterialInitialStock record);

int insertSelective(MaterialInitialStock record);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ public interface MaterialMapper extends BaseMapper<Material> {

int deleteByPrimaryKey(Long id);

int insert(Material record);
int insertMaterial(Material record);

int insertSelective(Material record);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ public interface MaterialPropertyMapper extends BaseMapper<MaterialProperty> {

int deleteByPrimaryKey(Long id);

int insert(MaterialProperty record);
int insertMaterialProperty(MaterialProperty record);

int insertSelective(MaterialProperty record);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ public interface MsgMapper extends BaseMapper<Msg> {

int deleteByPrimaryKey(Long id);

int insert(Msg record);
int insertMsg(Msg record);

int insertSelective(Msg record);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ public interface OrgaUserRelMapper extends BaseMapper<OrgaUserRel> {
*
* @mbggenerated
*/
int insert(OrgaUserRel record);
int insertOrgaUserRel(OrgaUserRel record);

/**
* This method was generated by MyBatis Generator.
Expand Down
Loading

0 comments on commit 9a38202

Please sign in to comment.