Skip to content

Commit

Permalink
同步码云1114
Browse files Browse the repository at this point in the history
  • Loading branch information
jishenghua committed Nov 14, 2021
1 parent b56f2e6 commit 3c7bcb1
Show file tree
Hide file tree
Showing 135 changed files with 21,014 additions and 717 deletions.
141 changes: 72 additions & 69 deletions jshERP-boot/docs/jsh_erp.sql

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -1273,4 +1273,28 @@ delete from jsh_function where number='010104';
-- by jishenghua
-- 给租户表增加备注字段
-- --------------------------------------------------------
alter table jsh_tenant add remark varchar(500) DEFAULT NULL COMMENT '备注' after expire_time;
alter table jsh_tenant add remark varchar(500) DEFAULT NULL COMMENT '备注' after expire_time;

-- --------------------------------------------------------
-- 时间 2021年10月29日
-- by jishenghua
-- 给商品初始库存表增加最低库存数量、最高库存数量字段
-- 给商品表增加基础重量字段
-- 给商品表移除安全库存字段
-- --------------------------------------------------------
alter table jsh_material_initial_stock add low_safe_stock decimal(24,6) DEFAULT NULL COMMENT '最低库存数量' after number;
alter table jsh_material_initial_stock add high_safe_stock decimal(24,6) DEFAULT NULL COMMENT '最高库存数量' after low_safe_stock;
alter table jsh_material add weight decimal(24,6) DEFAULT NULL COMMENT '基础重量(kg)' after expiry_num;
alter table jsh_material drop column safety_stock;

-- --------------------------------------------------------
-- 时间 2021年11月5日
-- by jishenghua
-- 给用户/角色/模块关系表增加租户字段
-- 给用户/角色/模块关系表的租户字段赋值
-- --------------------------------------------------------
alter table jsh_user_business add tenant_id bigint(20) DEFAULT null COMMENT '租户id' after btn_str;
update jsh_user_business ub left join jsh_user u on ub.key_id=u.id set ub.tenant_id=u.tenant_id
where (ub.type='UserRole' or ub.type='UserDepot' or ub.type='UserCustomer') and u.tenant_id!=0;
update jsh_user_business ub left join jsh_role r on ub.key_id=r.id set ub.tenant_id=r.tenant_id
where (ub.type='RoleFunctions') and r.tenant_id is not null;
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,11 @@ public Docket createRestApi() {

private ApiInfo apiInfo() {
return new ApiInfoBuilder()
.title("Mybatis-Plus Plugin Example RESTful APIs")
.description("集成Mybatis-Plus模块接口描述")
.title("华夏ERP Restful Api")
.description("华夏ERP接口描述")
.termsOfServiceUrl("http://127.0.0.1")
.contact(new Contact("jishenghua", "", ""))
.version("2.1.1")
.version("3.0")
.build();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -253,12 +253,15 @@ public class ExceptionConstants {
//商品类别编号已存在
public static final int MATERIAL_CATEGORY_SERIAL_ALREADY_EXISTS_CODE = 7500003;
public static final String MATERIAL_CATEGORY_SERIAL_ALREADY_EXISTS_MSG = "商品类别编号已存在";
//根目录不支持修改
//根类别不支持修改
public static final int MATERIAL_CATEGORY_ROOT_NOT_SUPPORT_EDIT_CODE = 7500004;
public static final String MATERIAL_CATEGORY_ROOT_NOT_SUPPORT_EDIT_MSG = "根目录不支持修改";
//根目录不支持删除
public static final String MATERIAL_CATEGORY_ROOT_NOT_SUPPORT_EDIT_MSG = "根类别不支持修改";
//根类别不支持删除
public static final int MATERIAL_CATEGORY_ROOT_NOT_SUPPORT_DELETE_CODE = 7500005;
public static final String MATERIAL_CATEGORY_ROOT_NOT_SUPPORT_DELETE_MSG = "根目录不支持删除";
public static final String MATERIAL_CATEGORY_ROOT_NOT_SUPPORT_DELETE_MSG = "根类别不支持删除";
//该类别存在下级不允许删除
public static final int MATERIAL_CATEGORY_CHILD_NOT_SUPPORT_DELETE_CODE = 7500006;
public static final String MATERIAL_CATEGORY_CHILD_NOT_SUPPORT_DELETE_MSG = "该类别存在下级不允许删除";
/**
* 商品信息
* type = 80
Expand Down Expand Up @@ -422,6 +425,9 @@ public class ExceptionConstants {
//根机构不允许修改
public static final int ORGANIZATION_ROOT_NOT_ALLOWED_EDIT_CODE = 11000005;
public static final String ORGANIZATION_ROOT_NOT_ALLOWED_EDIT_MSG = "根机构不允许修改";
//该机构存在下级不允许删除
public static final int ORGANIZATION_CHILD_NOT_ALLOWED_DELETE_CODE = 11000006;
public static final String ORGANIZATION_CHILD_NOT_ALLOWED_DELETE_MSG = "该机构存在下级不允许删除";
/**
* 机构用户关联关系
* type = 115
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,11 @@
import com.jsh.erp.service.account.AccountService;
import com.jsh.erp.utils.BaseResponseInfo;
import com.jsh.erp.utils.ErpInfo;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.context.annotation.Description;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
Expand All @@ -29,6 +32,7 @@
*/
@RestController
@RequestMapping(value = "/account")
@Api(tags = {"账户管理"})
public class AccountController {
private Logger logger = LoggerFactory.getLogger(AccountController.class);

Expand All @@ -41,6 +45,7 @@ public class AccountController {
* @return
*/
@GetMapping(value = "/findBySelect")
@ApiOperation(value = "查找结算账户信息-下拉框")
public String findBySelect(HttpServletRequest request) throws Exception {
String res = null;
try {
Expand Down Expand Up @@ -70,6 +75,7 @@ public String findBySelect(HttpServletRequest request) throws Exception {
* @return
*/
@GetMapping(value = "/getAccount")
@ApiOperation(value = "获取所有结算账户")
public BaseResponseInfo getAccount(HttpServletRequest request) throws Exception {
BaseResponseInfo res = new BaseResponseInfo();
Map<String, Object> map = new HashMap<String, Object>();
Expand All @@ -96,6 +102,7 @@ public BaseResponseInfo getAccount(HttpServletRequest request) throws Exception
* @return
*/
@GetMapping(value = "/findAccountInOutList")
@ApiOperation(value = "账户流水信息")
public BaseResponseInfo findAccountInOutList(@RequestParam("currentPage") Integer currentPage,
@RequestParam("pageSize") Integer pageSize,
@RequestParam("accountId") Long accountId,
Expand Down Expand Up @@ -130,7 +137,15 @@ public BaseResponseInfo findAccountInOutList(@RequestParam("currentPage") Intege
return res;
}

/**
* 更新默认账户
* @param object
* @param request
* @return
* @throws Exception
*/
@PostMapping(value = "/updateIsDefault")
@ApiOperation(value = "更新默认账户")
public String updateIsDefault(@RequestBody JSONObject object,
HttpServletRequest request) throws Exception{
Long accountId = object.getLong("id");
Expand All @@ -149,6 +164,7 @@ public String updateIsDefault(@RequestBody JSONObject object,
* @return
*/
@GetMapping(value = "/getStatistics")
@ApiOperation(value = "结算账户的统计")
public BaseResponseInfo getStatistics(@RequestParam("name") String name,
@RequestParam("serialNo") String serialNo,
HttpServletRequest request) throws Exception {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@
import com.jsh.erp.service.accountHead.AccountHeadService;
import com.jsh.erp.utils.BaseResponseInfo;
import com.jsh.erp.utils.ErpInfo;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.web.bind.annotation.*;
Expand All @@ -25,6 +27,7 @@
*/
@RestController
@RequestMapping(value = "/accountHead")
@Api(tags = {"财务管理"})
public class AccountHeadController {
private Logger logger = LoggerFactory.getLogger(AccountHeadController.class);

Expand All @@ -38,6 +41,7 @@ public class AccountHeadController {
* @return
*/
@PostMapping(value = "/batchSetStatus")
@ApiOperation(value = "批量设置状态-审核或者反审核")
public String batchSetStatus(@RequestBody JSONObject jsonObject,
HttpServletRequest request) throws Exception{
Map<String, Object> objectMap = new HashMap<>();
Expand All @@ -59,6 +63,7 @@ public String batchSetStatus(@RequestBody JSONObject jsonObject,
* @throws Exception
*/
@PostMapping(value = "/addAccountHeadAndDetail")
@ApiOperation(value = "新增财务主表及财务子表信息")
public Object addAccountHeadAndDetail(@RequestBody AccountHeadVo4Body body, HttpServletRequest request) throws Exception{
JSONObject result = ExceptionConstants.standardSuccess();
String beanJson = body.getInfo();
Expand All @@ -75,6 +80,7 @@ public Object addAccountHeadAndDetail(@RequestBody AccountHeadVo4Body body, Http
* @throws Exception
*/
@PutMapping(value = "/updateAccountHeadAndDetail")
@ApiOperation(value = "更新财务主表及财务子表信息")
public Object updateAccountHeadAndDetail(@RequestBody AccountHeadVo4Body body, HttpServletRequest request) throws Exception{
JSONObject result = ExceptionConstants.standardSuccess();
String beanJson = body.getInfo();
Expand All @@ -90,6 +96,7 @@ public Object updateAccountHeadAndDetail(@RequestBody AccountHeadVo4Body body, H
* @return
*/
@GetMapping(value = "/getDetailByNumber")
@ApiOperation(value = "根据编号查询单据信息")
public BaseResponseInfo getDetailByNumber(@RequestParam("billNo") String billNo,
HttpServletRequest request)throws Exception {
BaseResponseInfo res = new BaseResponseInfo();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
import com.jsh.erp.datasource.vo.AccountItemVo4List;
import com.jsh.erp.service.accountItem.AccountItemService;
import com.jsh.erp.utils.BaseResponseInfo;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.web.bind.annotation.GetMapping;
Expand All @@ -25,13 +27,15 @@
*/
@RestController
@RequestMapping(value = "/accountItem")
@Api(tags = {"财务明细"})
public class AccountItemController {
private Logger logger = LoggerFactory.getLogger(AccountItemController.class);

@Resource
private AccountItemService accountItemService;

@GetMapping(value = "/getDetailList")
@ApiOperation(value = "明细列表")
public BaseResponseInfo getDetailList(@RequestParam("headerId") Long headerId,
HttpServletRequest request)throws Exception {
BaseResponseInfo res = new BaseResponseInfo();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,17 @@
import com.jsh.erp.constants.ExceptionConstants;
import com.jsh.erp.datasource.entities.Depot;
import com.jsh.erp.datasource.entities.DepotEx;
import com.jsh.erp.datasource.entities.MaterialCurrentStock;
import com.jsh.erp.datasource.entities.MaterialInitialStock;
import com.jsh.erp.exception.BusinessRunTimeException;
import com.jsh.erp.service.depot.DepotService;
import com.jsh.erp.service.material.MaterialService;
import com.jsh.erp.service.systemConfig.SystemConfigService;
import com.jsh.erp.service.user.UserService;
import com.jsh.erp.service.userBusiness.UserBusinessService;
import com.jsh.erp.utils.*;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.dao.DataAccessException;
Expand All @@ -31,6 +35,7 @@
*/
@RestController
@RequestMapping(value = "/depot")
@Api(tags = {"仓库管理"})
public class DepotController {
private Logger logger = LoggerFactory.getLogger(DepotController.class);

Expand All @@ -43,7 +48,14 @@ public class DepotController {
@Resource
private MaterialService materialService;

/**
* 仓库列表
* @param request
* @return
* @throws Exception
*/
@GetMapping(value = "/getAllList")
@ApiOperation(value = "仓库列表")
public BaseResponseInfo getAllList(HttpServletRequest request) throws Exception{
BaseResponseInfo res = new BaseResponseInfo();
try {
Expand All @@ -66,6 +78,7 @@ public BaseResponseInfo getAllList(HttpServletRequest request) throws Exception{
* @return
*/
@GetMapping(value = "/findUserDepot")
@ApiOperation(value = "用户对应仓库显示")
public JSONArray findUserDepot(@RequestParam("UBType") String type, @RequestParam("UBKeyId") String keyId,
HttpServletRequest request) throws Exception{
JSONArray arr = new JSONArray();
Expand Down Expand Up @@ -112,6 +125,7 @@ public JSONArray findUserDepot(@RequestParam("UBType") String type, @RequestPara
* @throws Exception
*/
@GetMapping(value = "/findDepotByCurrentUser")
@ApiOperation(value = "获取当前用户拥有权限的仓库列表")
public BaseResponseInfo findDepotByCurrentUser(HttpServletRequest request) throws Exception{
BaseResponseInfo res = new BaseResponseInfo();
try {
Expand All @@ -126,7 +140,15 @@ public BaseResponseInfo findDepotByCurrentUser(HttpServletRequest request) throw
return res;
}

/**
* 更新默认仓库
* @param object
* @param request
* @return
* @throws Exception
*/
@PostMapping(value = "/updateIsDefault")
@ApiOperation(value = "更新默认仓库")
public String updateIsDefault(@RequestBody JSONObject object,
HttpServletRequest request) throws Exception{
Long depotId = object.getLong("id");
Expand All @@ -139,7 +161,14 @@ public String updateIsDefault(@RequestBody JSONObject object,
}
}

/**
* 仓库列表-带库存
* @param mId
* @param request
* @return
*/
@GetMapping(value = "/getAllListWithStock")
@ApiOperation(value = "仓库列表-带库存")
public BaseResponseInfo getAllList(@RequestParam("mId") Long mId,
HttpServletRequest request) {
BaseResponseInfo res = new BaseResponseInfo();
Expand All @@ -153,6 +182,9 @@ public BaseResponseInfo getAllList(@RequestParam("mId") Long mId,
BigDecimal currentStock = materialService.getCurrentStock(mId, depot.getId());
de.setInitStock(initStock);
de.setCurrentStock(currentStock);
MaterialInitialStock materialInitialStock = materialService.getSafeStock(mId, depot.getId());
de.setLowSafeStock(materialInitialStock.getLowSafeStock());
de.setHighSafeStock(materialInitialStock.getHighSafeStock());
} else {
de.setInitStock(BigDecimal.ZERO);
de.setCurrentStock(BigDecimal.ZERO);
Expand Down
Loading

0 comments on commit 3c7bcb1

Please sign in to comment.