Skip to content

Commit

Permalink
同步码云0924
Browse files Browse the repository at this point in the history
  • Loading branch information
jishenghua committed Sep 24, 2021
1 parent 91ee48f commit bcc6eff
Show file tree
Hide file tree
Showing 119 changed files with 1,739 additions and 1,017 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* 虽然目前只有进销存+财务+生产的功能,但后面将会推出ERP的全部功能,有兴趣请帮点一下 **Star**
* **官网URL:http://www.huaxiaerp.com 商务合作或技术交流,请联系QQ:752718920**
* 欢迎加入华夏ERP交流QQ群,群1:120725710(满)、群3:805736336
* 平台地址:http://47.116.69.14 欢迎大家注册租户进行体验
* 平台地址:http://cloud.huaxiaerp.vip 欢迎大家注册租户进行体验
* 系统默认租户账号:jsh,默认超管账户:admin,默认密码均为:123456
* 部署如遇到困难请参考Wiki文档 https://gitee.com/jishenghua/JSH_ERP/wikis/pages

Expand Down Expand Up @@ -43,7 +43,7 @@
* Nginx代理:nginx1.12.2
* 操作系统:Windows、Linux等
* 为方便大家搭建运行环境,分享了下载地址 https://pan.baidu.com/s/1jlild9uyGdQ7H2yaMx76zw  提取码:814g
* 不会打包的小伙伴,请下载此打包后的文件 http://47.116.69.14:8899/down/J6SsL8UWr7fb 提取码:siB2FW
* 不会打包的小伙伴,请下载此打包后的文件 https://share.weiyun.com/Y6BXPOxn 密码:ae8jcy
* 不会部署的小伙伴,请参考部署教程 http://www.huaxiaerp.com/thread-177-1-1.html

# 开源说明
Expand Down
72 changes: 36 additions & 36 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 @@ -1200,4 +1200,34 @@ INSERT INTO `jsh_function` VALUES ('248', '030150', '调拨明细', '0301', '/re
-- --------------------------------------------------------
alter table jsh_tenant add type varchar(1) DEFAULT '0' COMMENT '租户类型,0免费租户,1付费租户' after bills_num_limit;
alter table jsh_tenant drop column bills_num_limit;
alter table jsh_tenant add expire_time datetime DEFAULT NULL COMMENT '到期时间' after create_time;
alter table jsh_tenant add expire_time datetime DEFAULT NULL COMMENT '到期时间' after create_time;

-- --------------------------------------------------------
-- 时间 2021年8月29日
-- by jishenghua
-- 给日志表的ip字段改长度
-- --------------------------------------------------------
alter table jsh_log change client_ip client_ip varchar(200) DEFAULT NULL COMMENT '客户端IP';

-- --------------------------------------------------------
-- 时间 2021年9月5日
-- by jishenghua
-- 给财务表增加状态字段,给历史数据赋值为0
-- --------------------------------------------------------
alter table jsh_account_head add status varchar(1) DEFAULT NULL COMMENT '状态,0未审核、1已审核' after file_name;
update jsh_account_head set status=0;

-- --------------------------------------------------------
-- 时间 2021年9月12日
-- by jishenghua
-- 插入jsh_platform_config数据,控制是否显示三联打印
-- --------------------------------------------------------
INSERT INTO `jsh_platform_config` (`id`, `platform_key`, `platform_key_info`, `platform_value`) VALUES ('4', 'bill_print_flag', '三联打印启用标记', '0');
INSERT INTO `jsh_platform_config` (`id`, `platform_key`, `platform_key_info`, `platform_value`) VALUES ('5', 'bill_print_url', '三联打印地址', '');

-- --------------------------------------------------------
-- 时间 2021年9月24日
-- by jishenghua
-- 修改单据主表的状态字段描述
-- --------------------------------------------------------
alter table jsh_depot_head change status status varchar(1) DEFAULT NULL COMMENT '状态,0未审核、1已审核、2完成采购|销售、3部分采购|销售';
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ public class BusinessConstants {
* 单据主表出入库类型 type 入库 出库
* depothead
* */
public static final String DEPOTHEAD_TYPE_STORAGE = "入库";
public static final String DEPOTHEAD_TYPE_IN = "入库";
public static final String DEPOTHEAD_TYPE_OUT = "出库";
/**
* 付款类型 payType //现付/预付款
Expand Down Expand Up @@ -67,12 +67,14 @@ public class BusinessConstants {
public static final String BILLS_STATUS_SKIP = "2";
/**
* 出入库分类
*采购、采购退货、其它、零售、销售、调拨
*采购、采购退货、其它、零售、销售、调拨等
* */
public static final String SUB_TYPE_PURCHASE_ORDER = "采购订单";
public static final String SUB_TYPE_PURCHASE = "采购";
public static final String SUB_TYPE_PURCHASE_TETURNS = "采购退货";
public static final String SUB_TYPE_OTHER = "其它";
public static final String SUB_TYPE_RETAIL = "零售";
public static final String SUB_TYPE_SALES_ORDER = "销售订单";
public static final String SUB_TYPE_SALES = "销售";
public static final String SUB_TYPE_TRANSFER = "调拨";
/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -327,6 +327,15 @@ public class ExceptionConstants {
//单据录入-调入仓库与原仓库不能重复
public static final int DEPOT_HEAD_ANOTHER_DEPOT_EQUAL_FAILED_CODE = 8500010;
public static final String DEPOT_HEAD_ANOTHER_DEPOT_EQUAL_FAILED_MSG = "调入仓库与原仓库不能重复";
//单据删除-只有未审核的单据才能删除
public static final int DEPOT_HEAD_UN_AUDIT_DELETE_FAILED_CODE = 8500011;
public static final String DEPOT_HEAD_UN_AUDIT_DELETE_FAILED_MSG = "抱歉,只有未审核的单据才能删除";
//单据审核-只有未审核的单据才能审核
public static final int DEPOT_HEAD_UN_AUDIT_TO_AUDIT_FAILED_CODE = 8500012;
public static final String DEPOT_HEAD_UN_AUDIT_TO_AUDIT_FAILED_MSG = "抱歉,只有未审核的单据才能审核";
//单据反审核-只有已审核的单据才能反审核
public static final int DEPOT_HEAD_AUDIT_TO_UN_AUDIT_FAILED_CODE = 8500013;
public static final String DEPOT_HEAD_AUDIT_TO_UN_AUDIT_FAILED_MSG = "抱歉,只有已审核的单据才能反审核";
/**
* 单据明细信息
* type = 90
Expand Down Expand Up @@ -356,6 +365,9 @@ public class ExceptionConstants {
//单据录入-明细不能为空
public static final int ACCOUNT_HEAD_ROW_FAILED_CODE = 9500003;
public static final String ACCOUNT_HEAD_ROW_FAILED_MSG = "单据明细不能为空";
//单据删除-只有未审核的单据才能删除
public static final int ACCOUNT_HEAD_UN_AUDIT_DELETE_FAILED_CODE = 9500004;
public static final String ACCOUNT_HEAD_UN_AUDIT_DELETE_FAILED_MSG = "抱歉,只有未审核的单据才能删除";
/**
* 财务明细信息
* type = 100
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
import com.jsh.erp.datasource.entities.AccountHeadVo4ListEx;
import com.jsh.erp.service.accountHead.AccountHeadService;
import com.jsh.erp.utils.BaseResponseInfo;
import com.jsh.erp.utils.ErpInfo;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.web.bind.annotation.*;
Expand All @@ -17,6 +18,8 @@
import java.util.List;
import java.util.Map;

import static com.jsh.erp.utils.ResponseJsonUtil.returnJson;

/**
* @author jishenghua 752*718*920
*/
Expand All @@ -28,6 +31,26 @@ public class AccountHeadController {
@Resource
private AccountHeadService accountHeadService;

/**
* 批量设置状态-审核或者反审核
* @param jsonObject
* @param request
* @return
*/
@PostMapping(value = "/batchSetStatus")
public String batchSetStatus(@RequestBody JSONObject jsonObject,
HttpServletRequest request) throws Exception{
Map<String, Object> objectMap = new HashMap<>();
String status = jsonObject.getString("status");
String ids = jsonObject.getString("ids");
int res = accountHeadService.batchSetStatus(status, ids);
if(res > 0) {
return returnJson(objectMap, ErpInfo.OK.name, ErpInfo.OK.code);
} else {
return returnJson(objectMap, ErpInfo.ERROR.name, ErpInfo.ERROR.code);
}
}

/**
* 新增财务主表及财务子表信息
* @param body
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,9 @@ public String findDetailByTypeAndMaterialId(
if (list != null) {
for (DepotItemVo4DetailByTypeAndMId d: list) {
JSONObject item = new JSONObject();
item.put("number", d.getNumber()); //商品编号
item.put("number", d.getNumber()); //编号
item.put("barCode", d.getBarCode()); //条码
item.put("materialName", d.getMaterialName()); //名称
String type = d.getType();
String subType = d.getSubType();
if(("其它").equals(type)) {
Expand Down Expand Up @@ -121,16 +123,20 @@ public BaseResponseInfo findStockByDepotAndBarCode(
List<MaterialVo4Unit> list = materialService.getMaterialByBarCode(barCode);
if(list!=null && list.size()>0) {
MaterialVo4Unit materialVo4Unit = list.get(0);
stock = depotItemService.getStockByParam(depotId,materialVo4Unit.getId(),null,null);
String commodityUnit = materialVo4Unit.getCommodityUnit();
Long unitId = materialVo4Unit.getUnitId();
if(unitId!=null) {
Integer ratio = 1;
Unit unit = unitService.getUnit(unitId);
if(commodityUnit.equals(unit.getOtherUnit())){
ratio = unit.getRatio();
if(ratio!=0) {
stock = stock.divide(BigDecimal.valueOf(ratio),2,BigDecimal.ROUND_HALF_UP); //两位小数
if(StringUtil.isNotEmpty(materialVo4Unit.getSku())){
stock = depotItemService.getSkuStockByParam(depotId,materialVo4Unit.getMeId(),null,null);
} else {
stock = depotItemService.getStockByParam(depotId,materialVo4Unit.getId(),null,null);
String commodityUnit = materialVo4Unit.getCommodityUnit();
Long unitId = materialVo4Unit.getUnitId();
if(unitId!=null) {
Integer ratio = 1;
Unit unit = unitService.getUnit(unitId);
if(commodityUnit.equals(unit.getOtherUnit())){
ratio = unit.getRatio();
if(ratio!=0) {
stock = stock.divide(BigDecimal.valueOf(ratio),2,BigDecimal.ROUND_HALF_UP); //两位小数
}
}
}
}
Expand Down Expand Up @@ -171,13 +177,18 @@ public BaseResponseInfo getDetailList(@RequestParam("headerId") Long headerId,
item.put("model", diEx.getMModel());
item.put("materialOther", getOtherInfo(mpArr, diEx));
Integer ratio = diEx.getRatio();
BigDecimal stock = depotItemService.getStockByParam(diEx.getDepotId(),diEx.getMaterialId(),null,null);
if(ratio!=null){
BigDecimal ratioDecimal = new BigDecimal(ratio.toString());
if(ratioDecimal.compareTo(BigDecimal.ZERO)!=0){
String otherUnit = diEx.getOtherUnit();
if(otherUnit.equals(diEx.getMaterialUnit())) {
stock = stock.divide(ratioDecimal,2,BigDecimal.ROUND_HALF_UP); //两位小数
BigDecimal stock;
if(StringUtil.isNotEmpty(diEx.getSku())){
stock = depotItemService.getSkuStockByParam(diEx.getDepotId(),diEx.getMaterialExtendId(),null,null);
} else {
stock = depotItemService.getStockByParam(diEx.getDepotId(),diEx.getMaterialId(),null,null);
if(ratio!=null){
BigDecimal ratioDecimal = new BigDecimal(ratio.toString());
if(ratioDecimal.compareTo(BigDecimal.ZERO)!=0){
String otherUnit = diEx.getOtherUnit();
if(otherUnit.equals(diEx.getMaterialUnit())) {
stock = stock.divide(ratioDecimal,2,BigDecimal.ROUND_HALF_UP); //两位小数
}
}
}
}
Expand Down Expand Up @@ -316,55 +327,6 @@ public BaseResponseInfo findByAll(@RequestParam("currentPage") Integer currentPa
return res;
}

/**
* 导出excel表格
* @param depotId
* @param monthTime
* @param materialParam
* @param request
* @param response
* @return
*/
@GetMapping(value = "/exportExcel")
public void exportExcel(@RequestParam("depotId") Long depotId,
@RequestParam("monthTime") String monthTime,
@RequestParam("materialParam") String materialParam,
HttpServletRequest request, HttpServletResponse response) throws Exception {
String timeA = Tools.firstDayOfMonth(monthTime) + BusinessConstants.DAY_FIRST_TIME;
String timeB = Tools.lastDayOfMonth(monthTime) + BusinessConstants.DAY_LAST_TIME;
try {
List<DepotItemVo4WithInfoEx> dataList = depotItemService.findByAll(StringUtil.toNull(materialParam),
timeB, null, null);
//存放数据json数组
String[] names = {"条码", "名称", "规格", "型号", "单位", "单价", "上月结存数量", "入库数量", "出库数量", "本月结存数量", "结存金额"};
String title = "库存报表";
List<String[]> objects = new ArrayList<String[]>();
if (null != dataList) {
for (DepotItemVo4WithInfoEx diEx : dataList) {
Long mId = diEx.getMId();
String[] objs = new String[11];
objs[0] = diEx.getBarCode();
objs[1] = diEx.getMName();
objs[2] = diEx.getMStandard();
objs[3] = diEx.getMModel();
objs[4] = diEx.getMaterialUnit();
objs[5] = diEx.getPurchaseDecimal().toString();
objs[6] = depotItemService.getStockByParam(depotId,mId,null,timeA).toString();
objs[7] = depotItemService.getInNumByParam(depotId,mId,timeA,timeB).toString();
objs[8] = depotItemService.getOutNumByParam(depotId,mId,timeA,timeB).toString();
BigDecimal thisSum = depotItemService.getStockByParam(depotId,mId,null,timeB);
objs[9] = thisSum.toString();
objs[10] = thisSum.multiply(diEx.getPurchaseDecimal()).toString();
objects.add(objs);
}
}
File file = ExcelUtils.exportObjectsWithoutTitle(title, names, title, objects);
ExportExecUtil.showExec(file, file.getName() + "-" + monthTime, response);
} catch (Exception e) {
e.printStackTrace();
}
}

/**
* 统计总计金额
* @param depotId
Expand Down Expand Up @@ -596,62 +558,6 @@ public BaseResponseInfo findStockWarningCount(@RequestParam("currentPage") Integ
}
return res;
}
/**
* 导出库存预警excel表格
* @param depotId
* @param request
* @param response
* @return
*/
@GetMapping(value = "/exportWarningExcel")
public BaseResponseInfo exportWarningExcel(
@RequestParam("depotId") Long depotId,
@RequestParam("materialParam") String materialParam,
@RequestParam("mpList") String mpList,
HttpServletRequest request, HttpServletResponse response)throws Exception {
BaseResponseInfo res = new BaseResponseInfo();
Map<String, Object> map = new HashMap<String, Object>();
String message = "成功";
try {
String[] mpArr = mpList.split(",");
List<DepotItemStockWarningCount> dataList = depotItemService.findStockWarningCount(null, null, materialParam, depotId);
//存放数据json数组
Long pid = depotId;
String[] names = {"条码", "名称", "规格", "型号", "扩展信息", "单位", "安全存量", "当前库存", "建议入库量"};
String title = "库存预警报表";
List<String[]> objects = new ArrayList<String[]>();
if (null != dataList) {
for (DepotItemStockWarningCount diEx : dataList) {
DepotItemVo4WithInfoEx diVI = new DepotItemVo4WithInfoEx();
diVI.setMMfrs(diEx.getMMfrs());
diVI.setMOtherField1(diEx.getMOtherField1());
diVI.setMOtherField2(diEx.getMOtherField2());
diVI.setMOtherField3(diEx.getMOtherField3());
String materialOther = getOtherInfo(mpArr, diVI);
String unitName = getUName(diEx.getMaterialUnit(), diEx.getUnitName());
String[] objs = new String[9];
objs[0] = diEx.getBarCode();
objs[1] = diEx.getMName();
objs[2] = diEx.getMStandard();
objs[3] = diEx.getMModel();
objs[4] = materialOther;
objs[5] = unitName;
objs[6] = diEx.getSafetystock() == null ? "0" : diEx.getSafetystock().toString();
objs[7] = diEx.getCurrentNumber() == null ? "0" : diEx.getCurrentNumber().toString();
objs[8] = diEx.getLinjieNumber() == null ? "0" : diEx.getLinjieNumber().toString();
objects.add(objs);
}
}
File file = ExcelUtils.exportObjectsWithoutTitle(title+pid, names, title, objects);
ExportExecUtil.showExec(file, file.getName(), response);
res.code = 200;
} catch (Exception e) {
e.printStackTrace();
message = "导出失败";
res.code = 500;
}
return res;
}

/**
* 统计采购或销售的总金额
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -161,16 +161,14 @@ public JSONArray getFunctionList(List<Function> dataList, String type, String ke
item.put("value", function.getId());
item.put("title", function.getName());
item.put("attributes", function.getName());
Boolean flag = ubValue.contains("[" + function.getId().toString() + "]");
if (flag) {
item.put("checked", true);
}
List<Function> funList = functionService.findRoleFunction(function.getNumber());
if(funList.size()>0) {
JSONArray funArr = getFunctionList(funList, type, keyId);
item.put("children", funArr);
dataArray.add(item);
} else {
Boolean flag = ubValue.contains("[" + function.getId().toString() + "]");
item.put("checked", flag);
dataArray.add(item);
}
}
Expand Down
Loading

0 comments on commit bcc6eff

Please sign in to comment.