增加租户界面、单据优化
This commit is contained in:
@@ -1759,7 +1759,7 @@ CREATE TABLE `jsh_tenant` (
|
|||||||
-- ----------------------------
|
-- ----------------------------
|
||||||
-- Records of jsh_tenant
|
-- Records of jsh_tenant
|
||||||
-- ----------------------------
|
-- ----------------------------
|
||||||
INSERT INTO `jsh_tenant` VALUES ('13', '63', 'jsh', '20', '2000', null);
|
INSERT INTO `jsh_tenant` VALUES ('13', '63', 'jsh', '20', '2000', '2021-02-17 23:19:17');
|
||||||
INSERT INTO `jsh_tenant` VALUES ('14', '137', 'alibaba', '1000000', '100000000', '2021-02-17 23:19:17');
|
INSERT INTO `jsh_tenant` VALUES ('14', '137', 'alibaba', '1000000', '100000000', '2021-02-17 23:19:17');
|
||||||
INSERT INTO `jsh_tenant` VALUES ('15', '138', 'xiaomi', '1000000', '100000000', '2021-02-17 23:21:25');
|
INSERT INTO `jsh_tenant` VALUES ('15', '138', 'xiaomi', '1000000', '100000000', '2021-02-17 23:21:25');
|
||||||
INSERT INTO `jsh_tenant` VALUES ('16', '139', 'tenxun', '1000000', '100000000', '2021-02-17 23:23:09');
|
INSERT INTO `jsh_tenant` VALUES ('16', '139', 'tenxun', '1000000', '100000000', '2021-02-17 23:23:09');
|
||||||
|
|||||||
@@ -1070,3 +1070,10 @@ alter table jsh_material_category drop column creator;
|
|||||||
alter table jsh_material_category drop column updater;
|
alter table jsh_material_category drop column updater;
|
||||||
alter table jsh_material_category change status delete_flag varchar(1) DEFAULT '0' COMMENT '删除标记,0未删除,1删除';
|
alter table jsh_material_category change status delete_flag varchar(1) DEFAULT '0' COMMENT '删除标记,0未删除,1删除';
|
||||||
update jsh_material_category set delete_flag='0';
|
update jsh_material_category set delete_flag='0';
|
||||||
|
|
||||||
|
-- --------------------------------------------------------
|
||||||
|
-- 时间 2021年6月1日
|
||||||
|
-- by jishenghua
|
||||||
|
-- 增加租户管理菜单
|
||||||
|
-- --------------------------------------------------------
|
||||||
|
INSERT INTO `jsh_erp`.`jsh_function` (`id`, `number`, `name`, `parent_number`, `url`, `component`, `state`, `sort`, `enabled`, `type`, `push_btn`, `icon`, `delete_flag`) VALUES ('18', '000109', '租户管理', '0001', '/system/tenant', '/system/TenantList', b'0', '0167', b'1', '电脑版', '1', 'profile', '0');
|
||||||
|
|||||||
@@ -309,6 +309,9 @@ public class ExceptionConstants {
|
|||||||
//单据录入-明细不能为空
|
//单据录入-明细不能为空
|
||||||
public static final int DEPOT_HEAD_ROW_FAILED_CODE = 8500006;
|
public static final int DEPOT_HEAD_ROW_FAILED_CODE = 8500006;
|
||||||
public static final String DEPOT_HEAD_ROW_FAILED_MSG = "单据明细不能为空";
|
public static final String DEPOT_HEAD_ROW_FAILED_MSG = "单据明细不能为空";
|
||||||
|
//单据录入-账户不能为空
|
||||||
|
public static final int DEPOT_HEAD_ACCOUNT_FAILED_CODE = 8500007;
|
||||||
|
public static final String DEPOT_HEAD_ACCOUNT_FAILED_MSG = "结算账户不能为空";
|
||||||
/**
|
/**
|
||||||
* 单据明细信息
|
* 单据明细信息
|
||||||
* type = 90
|
* type = 90
|
||||||
|
|||||||
@@ -439,6 +439,7 @@ public class MaterialController {
|
|||||||
@GetMapping(value = "/getMaterialByBarCode")
|
@GetMapping(value = "/getMaterialByBarCode")
|
||||||
public BaseResponseInfo getMaterialByBarCode(@RequestParam("barCode") String barCode,
|
public BaseResponseInfo getMaterialByBarCode(@RequestParam("barCode") String barCode,
|
||||||
@RequestParam("mpList") String mpList,
|
@RequestParam("mpList") String mpList,
|
||||||
|
@RequestParam(required = false, value = "prefixNo") String prefixNo,
|
||||||
HttpServletRequest request) throws Exception {
|
HttpServletRequest request) throws Exception {
|
||||||
BaseResponseInfo res = new BaseResponseInfo();
|
BaseResponseInfo res = new BaseResponseInfo();
|
||||||
try {
|
try {
|
||||||
@@ -463,6 +464,16 @@ public class MaterialController {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
mu.setMaterialOther(expand);
|
mu.setMaterialOther(expand);
|
||||||
|
if("LSCK".equals(prefixNo) || "LSTH".equals(prefixNo)) {
|
||||||
|
//零售价
|
||||||
|
mu.setBillPrice(mu.getCommodityDecimal());
|
||||||
|
} else if("CGDD".equals(prefixNo) || "CGRK".equals(prefixNo) || "CGTH".equals(prefixNo) || "QTRK".equals(prefixNo) || "DBCK".equals(prefixNo)) {
|
||||||
|
//采购价
|
||||||
|
mu.setBillPrice(mu.getPurchaseDecimal());
|
||||||
|
} else if("XSDD".equals(prefixNo) || "XSCK".equals(prefixNo) || "XSTH".equals(prefixNo) || "QTCK".equals(prefixNo)) {
|
||||||
|
//销售价
|
||||||
|
mu.setBillPrice(mu.getWholesaleDecimal());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
res.code = 200;
|
res.code = 200;
|
||||||
res.data = mu;
|
res.data = mu;
|
||||||
|
|||||||
@@ -20,6 +20,8 @@ public class MaterialVo4Unit extends Material{
|
|||||||
|
|
||||||
private BigDecimal lowDecimal;
|
private BigDecimal lowDecimal;
|
||||||
|
|
||||||
|
private BigDecimal billPrice;
|
||||||
|
|
||||||
private String mBarCode;
|
private String mBarCode;
|
||||||
|
|
||||||
private String commodityUnit;
|
private String commodityUnit;
|
||||||
@@ -90,6 +92,14 @@ public class MaterialVo4Unit extends Material{
|
|||||||
this.lowDecimal = lowDecimal;
|
this.lowDecimal = lowDecimal;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public BigDecimal getBillPrice() {
|
||||||
|
return billPrice;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setBillPrice(BigDecimal billPrice) {
|
||||||
|
this.billPrice = billPrice;
|
||||||
|
}
|
||||||
|
|
||||||
public String getmBarCode() {
|
public String getmBarCode() {
|
||||||
return mBarCode;
|
return mBarCode;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,14 @@
|
|||||||
|
package com.jsh.erp.datasource.entities;
|
||||||
|
|
||||||
|
public class TenantEx extends Tenant{
|
||||||
|
|
||||||
|
private String createTimeStr;
|
||||||
|
|
||||||
|
public String getCreateTimeStr() {
|
||||||
|
return createTimeStr;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCreateTimeStr(String createTimeStr) {
|
||||||
|
this.createTimeStr = createTimeStr;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -22,6 +22,10 @@ public class UserEx extends User{
|
|||||||
|
|
||||||
private String userType;
|
private String userType;
|
||||||
|
|
||||||
|
private String userNumLimit;
|
||||||
|
|
||||||
|
private String billsNumLimit;
|
||||||
|
|
||||||
public String getOrgAbr() {
|
public String getOrgAbr() {
|
||||||
return orgAbr;
|
return orgAbr;
|
||||||
}
|
}
|
||||||
@@ -77,4 +81,20 @@ public class UserEx extends User{
|
|||||||
public void setUserType(String userType) {
|
public void setUserType(String userType) {
|
||||||
this.userType = userType;
|
this.userType = userType;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public String getUserNumLimit() {
|
||||||
|
return userNumLimit;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setUserNumLimit(String userNumLimit) {
|
||||||
|
this.userNumLimit = userNumLimit;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getBillsNumLimit() {
|
||||||
|
return billsNumLimit;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setBillsNumLimit(String billsNumLimit) {
|
||||||
|
this.billsNumLimit = billsNumLimit;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,13 +1,14 @@
|
|||||||
package com.jsh.erp.datasource.mappers;
|
package com.jsh.erp.datasource.mappers;
|
||||||
|
|
||||||
import com.jsh.erp.datasource.entities.Tenant;
|
import com.jsh.erp.datasource.entities.Tenant;
|
||||||
|
import com.jsh.erp.datasource.entities.TenantEx;
|
||||||
import org.apache.ibatis.annotations.Param;
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
public interface TenantMapperEx {
|
public interface TenantMapperEx {
|
||||||
|
|
||||||
List<Tenant> selectByConditionTenant(
|
List<TenantEx> selectByConditionTenant(
|
||||||
@Param("loginName") String loginName,
|
@Param("loginName") String loginName,
|
||||||
@Param("offset") Integer offset,
|
@Param("offset") Integer offset,
|
||||||
@Param("rows") Integer rows);
|
@Param("rows") Integer rows);
|
||||||
|
|||||||
@@ -531,6 +531,10 @@ public class DepotHeadService {
|
|||||||
HttpServletRequest request) throws Exception {
|
HttpServletRequest request) throws Exception {
|
||||||
/**处理单据主表数据*/
|
/**处理单据主表数据*/
|
||||||
DepotHead depotHead = JSONObject.parseObject(beanJson, DepotHead.class);
|
DepotHead depotHead = JSONObject.parseObject(beanJson, DepotHead.class);
|
||||||
|
if(StringUtil.isEmpty(depotHead.getAccountIdList()) && depotHead.getAccountId()==null) {
|
||||||
|
throw new BusinessRunTimeException(ExceptionConstants.DEPOT_HEAD_ACCOUNT_FAILED_CODE,
|
||||||
|
String.format(ExceptionConstants.DEPOT_HEAD_ACCOUNT_FAILED_MSG));
|
||||||
|
}
|
||||||
//判断用户是否已经登录过,登录过不再处理
|
//判断用户是否已经登录过,登录过不再处理
|
||||||
User userInfo=userService.getCurrentUser();
|
User userInfo=userService.getCurrentUser();
|
||||||
depotHead.setCreator(userInfo==null?null:userInfo.getId());
|
depotHead.setCreator(userInfo==null?null:userInfo.getId());
|
||||||
@@ -594,6 +598,10 @@ public class DepotHeadService {
|
|||||||
BigDecimal preTotalPrice, Long tenantId,HttpServletRequest request)throws Exception {
|
BigDecimal preTotalPrice, Long tenantId,HttpServletRequest request)throws Exception {
|
||||||
/**更新单据主表信息*/
|
/**更新单据主表信息*/
|
||||||
DepotHead depotHead = JSONObject.parseObject(beanJson, DepotHead.class);
|
DepotHead depotHead = JSONObject.parseObject(beanJson, DepotHead.class);
|
||||||
|
if(StringUtil.isEmpty(depotHead.getAccountIdList()) && depotHead.getAccountId()==null) {
|
||||||
|
throw new BusinessRunTimeException(ExceptionConstants.DEPOT_HEAD_ACCOUNT_FAILED_CODE,
|
||||||
|
String.format(ExceptionConstants.DEPOT_HEAD_ACCOUNT_FAILED_MSG));
|
||||||
|
}
|
||||||
if(StringUtil.isNotEmpty(depotHead.getAccountIdList())){
|
if(StringUtil.isNotEmpty(depotHead.getAccountIdList())){
|
||||||
depotHead.setAccountIdList(depotHead.getAccountIdList().replace("[", "").replace("]", "").replaceAll("\"", ""));
|
depotHead.setAccountIdList(depotHead.getAccountIdList().replace("[", "").replace("]", "").replaceAll("\"", ""));
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
package com.jsh.erp.service.tenant;
|
package com.jsh.erp.service.tenant;
|
||||||
|
|
||||||
import com.alibaba.fastjson.JSONObject;
|
import com.alibaba.fastjson.JSONObject;
|
||||||
|
import com.jsh.erp.constants.BusinessConstants;
|
||||||
import com.jsh.erp.constants.ExceptionConstants;
|
import com.jsh.erp.constants.ExceptionConstants;
|
||||||
import com.jsh.erp.datasource.entities.*;
|
import com.jsh.erp.datasource.entities.*;
|
||||||
import com.jsh.erp.datasource.mappers.TenantMapper;
|
import com.jsh.erp.datasource.mappers.TenantMapper;
|
||||||
@@ -8,6 +9,7 @@ import com.jsh.erp.datasource.mappers.TenantMapperEx;
|
|||||||
import com.jsh.erp.exception.BusinessRunTimeException;
|
import com.jsh.erp.exception.BusinessRunTimeException;
|
||||||
import com.jsh.erp.exception.JshException;
|
import com.jsh.erp.exception.JshException;
|
||||||
import com.jsh.erp.utils.StringUtil;
|
import com.jsh.erp.utils.StringUtil;
|
||||||
|
import com.jsh.erp.utils.Tools;
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
import org.springframework.beans.factory.annotation.Value;
|
import org.springframework.beans.factory.annotation.Value;
|
||||||
@@ -56,10 +58,15 @@ public class TenantService {
|
|||||||
return list;
|
return list;
|
||||||
}
|
}
|
||||||
|
|
||||||
public List<Tenant> select(String loginName, int offset, int rows)throws Exception {
|
public List<TenantEx> select(String loginName, int offset, int rows)throws Exception {
|
||||||
List<Tenant> list=null;
|
List<TenantEx> list= new ArrayList<>();
|
||||||
try{
|
try{
|
||||||
list=tenantMapperEx.selectByConditionTenant(loginName, offset, rows);
|
list = tenantMapperEx.selectByConditionTenant(loginName, offset, rows);
|
||||||
|
if (null != list) {
|
||||||
|
for (TenantEx tenantEx : list) {
|
||||||
|
tenantEx.setCreateTimeStr(Tools.getCenternTime(tenantEx.getCreateTime()));
|
||||||
|
}
|
||||||
|
}
|
||||||
}catch(Exception e){
|
}catch(Exception e){
|
||||||
JshException.readFail(logger, e);
|
JshException.readFail(logger, e);
|
||||||
}
|
}
|
||||||
@@ -81,8 +88,12 @@ public class TenantService {
|
|||||||
Tenant tenant = JSONObject.parseObject(obj.toJSONString(), Tenant.class);
|
Tenant tenant = JSONObject.parseObject(obj.toJSONString(), Tenant.class);
|
||||||
int result=0;
|
int result=0;
|
||||||
try{
|
try{
|
||||||
tenant.setUserNumLimit(userNumLimit); //默认用户限制数量
|
if(tenant.getUserNumLimit()==null) {
|
||||||
tenant.setBillsNumLimit(billsNumLimit); //默认单据限制数量
|
tenant.setUserNumLimit(userNumLimit); //默认用户限制数量
|
||||||
|
}
|
||||||
|
if(tenant.getBillsNumLimit()==null) {
|
||||||
|
tenant.setBillsNumLimit(billsNumLimit); //默认单据限制数量
|
||||||
|
}
|
||||||
tenant.setCreateTime(new Date());
|
tenant.setCreateTime(new Date());
|
||||||
result=tenantMapper.insertSelective(tenant);
|
result=tenantMapper.insertSelective(tenant);
|
||||||
}catch(Exception e){
|
}catch(Exception e){
|
||||||
@@ -130,7 +141,7 @@ public class TenantService {
|
|||||||
|
|
||||||
public int checkIsNameExist(Long id, String name)throws Exception {
|
public int checkIsNameExist(Long id, String name)throws Exception {
|
||||||
TenantExample example = new TenantExample();
|
TenantExample example = new TenantExample();
|
||||||
example.createCriteria().andIdEqualTo(id);
|
example.createCriteria().andIdNotEqualTo(id).andLoginNameEqualTo(name);
|
||||||
List<Tenant> list=null;
|
List<Tenant> list=null;
|
||||||
try{
|
try{
|
||||||
list= tenantMapper.selectByExample(example);
|
list= tenantMapper.selectByExample(example);
|
||||||
|
|||||||
@@ -511,6 +511,8 @@ public class UserService {
|
|||||||
JSONObject tenantObj = new JSONObject();
|
JSONObject tenantObj = new JSONObject();
|
||||||
tenantObj.put("tenantId", ue.getId());
|
tenantObj.put("tenantId", ue.getId());
|
||||||
tenantObj.put("loginName",ue.getLoginName());
|
tenantObj.put("loginName",ue.getLoginName());
|
||||||
|
tenantObj.put("userNumLimit",ue.getUserNumLimit());
|
||||||
|
tenantObj.put("billsNumLimit",ue.getBillsNumLimit());
|
||||||
tenantService.insertTenant(tenantObj, request);
|
tenantService.insertTenant(tenantObj, request);
|
||||||
logger.info("===============创建租户信息完成===============");
|
logger.info("===============创建租户信息完成===============");
|
||||||
if (result > 0) {
|
if (result > 0) {
|
||||||
|
|||||||
@@ -1,13 +1,18 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||||
<mapper namespace="com.jsh.erp.datasource.mappers.TenantMapperEx">
|
<mapper namespace="com.jsh.erp.datasource.mappers.TenantMapperEx">
|
||||||
<select id="selectByConditionTenant" parameterType="com.jsh.erp.datasource.entities.TenantExample" resultMap="com.jsh.erp.datasource.mappers.TenantMapper.BaseResultMap">
|
|
||||||
|
<resultMap extends="com.jsh.erp.datasource.mappers.LogMapper.BaseResultMap" id="ResultMapEx" type="com.jsh.erp.datasource.entities.TenantEx">
|
||||||
|
</resultMap>
|
||||||
|
|
||||||
|
<select id="selectByConditionTenant" parameterType="com.jsh.erp.datasource.entities.TenantExample" resultMap="ResultMapEx">
|
||||||
select *
|
select *
|
||||||
FROM jsh_tenant
|
FROM jsh_tenant
|
||||||
where 1=1
|
where 1=1
|
||||||
<if test="loginName != null">
|
<if test="loginName != null">
|
||||||
and login_name like '%${loginName}%'
|
and login_name like '%${loginName}%'
|
||||||
</if>
|
</if>
|
||||||
|
order by id desc
|
||||||
<if test="offset != null and rows != null">
|
<if test="offset != null and rows != null">
|
||||||
limit #{offset},#{rows}
|
limit #{offset},#{rows}
|
||||||
</if>
|
</if>
|
||||||
|
|||||||
Reference in New Issue
Block a user