优化用户和单据模块
This commit is contained in:
2
pom.xml
2
pom.xml
@@ -161,7 +161,7 @@
|
||||
<plugin>
|
||||
<groupId>org.mybatis.generator</groupId>
|
||||
<artifactId>mybatis-generator-maven-plugin</artifactId>
|
||||
<version>1.3.2</version>
|
||||
<version>1.4.0</version>
|
||||
<configuration>
|
||||
<configurationFile>${basedir}/src/test/resources/generatorConfig.xml</configurationFile>
|
||||
<verbose>true</verbose>
|
||||
|
||||
@@ -13,7 +13,7 @@ public class DepotHeadExample {
|
||||
protected List<Criteria> oredCriteria;
|
||||
|
||||
public DepotHeadExample() {
|
||||
oredCriteria = new ArrayList<Criteria>();
|
||||
oredCriteria = new ArrayList<>();
|
||||
}
|
||||
|
||||
public void setOrderByClause(String orderByClause) {
|
||||
@@ -70,7 +70,7 @@ public class DepotHeadExample {
|
||||
|
||||
protected GeneratedCriteria() {
|
||||
super();
|
||||
criteria = new ArrayList<Criterion>();
|
||||
criteria = new ArrayList<>();
|
||||
}
|
||||
|
||||
public boolean isValid() {
|
||||
@@ -2118,7 +2118,6 @@ public class DepotHeadExample {
|
||||
}
|
||||
|
||||
public static class Criteria extends GeneratedCriteria {
|
||||
|
||||
protected Criteria() {
|
||||
super();
|
||||
}
|
||||
|
||||
@@ -11,7 +11,7 @@ public class UserExample {
|
||||
protected List<Criteria> oredCriteria;
|
||||
|
||||
public UserExample() {
|
||||
oredCriteria = new ArrayList<Criteria>();
|
||||
oredCriteria = new ArrayList<>();
|
||||
}
|
||||
|
||||
public void setOrderByClause(String orderByClause) {
|
||||
@@ -68,7 +68,7 @@ public class UserExample {
|
||||
|
||||
protected GeneratedCriteria() {
|
||||
super();
|
||||
criteria = new ArrayList<Criterion>();
|
||||
criteria = new ArrayList<>();
|
||||
}
|
||||
|
||||
public boolean isValid() {
|
||||
@@ -1036,7 +1036,6 @@ public class UserExample {
|
||||
}
|
||||
|
||||
public static class Criteria extends GeneratedCriteria {
|
||||
|
||||
protected Criteria() {
|
||||
super();
|
||||
}
|
||||
|
||||
@@ -6,7 +6,7 @@ import java.util.List;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
public interface DepotHeadMapper {
|
||||
int countByExample(DepotHeadExample example);
|
||||
long countByExample(DepotHeadExample example);
|
||||
|
||||
int deleteByExample(DepotHeadExample example);
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@ import java.util.List;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
public interface UserMapper {
|
||||
int countByExample(UserExample example);
|
||||
long countByExample(UserExample example);
|
||||
|
||||
int deleteByExample(UserExample example);
|
||||
|
||||
|
||||
@@ -464,8 +464,6 @@ public class DepotHeadService {
|
||||
}
|
||||
|
||||
/**
|
||||
* create by: cjl
|
||||
* description:
|
||||
* 新增单据主表及单据子表信息
|
||||
* create time: 2019/1/25 14:36
|
||||
* @Param: beanJson
|
||||
@@ -493,15 +491,21 @@ public class DepotHeadService {
|
||||
}catch(Exception e){
|
||||
JshException.writeFail(logger, e);
|
||||
}
|
||||
|
||||
/**入库和出库处理预付款信息*/
|
||||
if(BusinessConstants.PAY_TYPE_PREPAID.equals(depotHead.getPaytype())){
|
||||
if(depotHead.getOrganid()!=null) {
|
||||
supplierService.updateAdvanceIn(depotHead.getOrganid(), BigDecimal.ZERO.subtract(depotHead.getTotalprice()));
|
||||
}
|
||||
}
|
||||
/**入库和出库处理单据子表信息*/
|
||||
depotItemService.saveDetials(inserted,deleted,updated,depotHead.getId(),tenantId, request);
|
||||
//根据单据编号查询单据id
|
||||
DepotHeadExample dhExample = new DepotHeadExample();
|
||||
dhExample.createCriteria().andDefaultnumberEqualTo(depotHead.getDefaultnumber()).andDeleteFlagNotEqualTo(BusinessConstants.DELETE_FLAG_DELETED);
|
||||
List<DepotHead> list = depotHeadMapper.selectByExample(dhExample);
|
||||
if(list!=null) {
|
||||
Long headId = list.get(0).getId();
|
||||
/**入库和出库处理单据子表信息*/
|
||||
depotItemService.saveDetials(inserted,deleted,updated,headId,tenantId, request);
|
||||
}
|
||||
/**如果关联单据号非空则更新订单的状态为2 */
|
||||
if(depotHead.getLinknumber()!=null) {
|
||||
DepotHead depotHeadOrders = new DepotHead();
|
||||
@@ -516,8 +520,6 @@ public class DepotHeadService {
|
||||
}
|
||||
}
|
||||
/**
|
||||
* create by: cjl
|
||||
* description:
|
||||
* 更新单据主表及单据子表信息
|
||||
* create time: 2019/1/28 14:47
|
||||
* @Param: id
|
||||
|
||||
@@ -334,8 +334,14 @@ public class UserService {
|
||||
OrgaUserRel oul=new OrgaUserRel();
|
||||
//机构id
|
||||
oul.setOrgaId(ue.getOrgaId());
|
||||
//用户id
|
||||
oul.setUserId(ue.getId());
|
||||
//用户id,根据用户名查询id
|
||||
UserExample example = new UserExample();
|
||||
example.createCriteria().andLoginameEqualTo(ue.getLoginame());
|
||||
List<User> list = userMapper.selectByExample(example);
|
||||
if(list!=null) {
|
||||
Long userId = list.get(0).getId();
|
||||
oul.setUserId(userId);
|
||||
}
|
||||
//用户在机构中的排序
|
||||
oul.setUserBlngOrgaDsplSeq(ue.getUserBlngOrgaDsplSeq());
|
||||
|
||||
|
||||
@@ -130,9 +130,6 @@
|
||||
</if>
|
||||
</delete>
|
||||
<insert id="insert" parameterType="com.jsh.erp.datasource.entities.DepotHead">
|
||||
<selectKey keyProperty="id" order="BEFORE" resultType="java.lang.Long">
|
||||
SELECT LAST_INSERT_ID()
|
||||
</selectKey>
|
||||
insert into jsh_depothead (Id, Type, SubType,
|
||||
ProjectId, DefaultNumber, Number,
|
||||
OperPersonName, CreateTime, OperTime,
|
||||
@@ -157,12 +154,11 @@
|
||||
#{deleteFlag,jdbcType=VARCHAR})
|
||||
</insert>
|
||||
<insert id="insertSelective" parameterType="com.jsh.erp.datasource.entities.DepotHead">
|
||||
<selectKey keyProperty="id" order="BEFORE" resultType="java.lang.Long">
|
||||
SELECT LAST_INSERT_ID()
|
||||
</selectKey>
|
||||
insert into jsh_depothead
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
Id,
|
||||
<if test="id != null">
|
||||
Id,
|
||||
</if>
|
||||
<if test="type != null">
|
||||
Type,
|
||||
</if>
|
||||
@@ -255,7 +251,9 @@
|
||||
</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
#{id,jdbcType=BIGINT},
|
||||
<if test="id != null">
|
||||
#{id,jdbcType=BIGINT},
|
||||
</if>
|
||||
<if test="type != null">
|
||||
#{type,jdbcType=VARCHAR},
|
||||
</if>
|
||||
@@ -348,7 +346,7 @@
|
||||
</if>
|
||||
</trim>
|
||||
</insert>
|
||||
<select id="countByExample" parameterType="com.jsh.erp.datasource.entities.DepotHeadExample" resultType="java.lang.Integer">
|
||||
<select id="countByExample" parameterType="com.jsh.erp.datasource.entities.DepotHeadExample" resultType="java.lang.Long">
|
||||
select count(*) from jsh_depothead
|
||||
<if test="_parameter != null">
|
||||
<include refid="Example_Where_Clause" />
|
||||
|
||||
@@ -110,9 +110,6 @@
|
||||
</if>
|
||||
</delete>
|
||||
<insert id="insert" parameterType="com.jsh.erp.datasource.entities.User">
|
||||
<selectKey keyProperty="id" order="BEFORE" resultType="java.lang.Long">
|
||||
SELECT LAST_INSERT_ID()
|
||||
</selectKey>
|
||||
insert into jsh_user (id, username, loginame,
|
||||
password, position, department,
|
||||
email, phonenum, ismanager,
|
||||
@@ -125,12 +122,11 @@
|
||||
#{remark,jdbcType=VARCHAR}, #{tenantId,jdbcType=BIGINT})
|
||||
</insert>
|
||||
<insert id="insertSelective" parameterType="com.jsh.erp.datasource.entities.User">
|
||||
<selectKey keyProperty="id" order="BEFORE" resultType="java.lang.Long">
|
||||
SELECT LAST_INSERT_ID()
|
||||
</selectKey>
|
||||
insert into jsh_user
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
id,
|
||||
<if test="id != null">
|
||||
id,
|
||||
</if>
|
||||
<if test="username != null">
|
||||
username,
|
||||
</if>
|
||||
@@ -172,7 +168,9 @@
|
||||
</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
#{id,jdbcType=BIGINT},
|
||||
<if test="id != null">
|
||||
#{id,jdbcType=BIGINT},
|
||||
</if>
|
||||
<if test="username != null">
|
||||
#{username,jdbcType=VARCHAR},
|
||||
</if>
|
||||
@@ -214,7 +212,7 @@
|
||||
</if>
|
||||
</trim>
|
||||
</insert>
|
||||
<select id="countByExample" parameterType="com.jsh.erp.datasource.entities.UserExample" resultType="java.lang.Integer">
|
||||
<select id="countByExample" parameterType="com.jsh.erp.datasource.entities.UserExample" resultType="java.lang.Long">
|
||||
select count(*) from jsh_user
|
||||
<if test="_parameter != null">
|
||||
<include refid="Example_Where_Clause" />
|
||||
|
||||
@@ -37,7 +37,7 @@
|
||||
<!-- generate Mapper -->
|
||||
<javaClientGenerator type="XMLMAPPER"
|
||||
targetPackage="com.jsh.erp.datasource.mappers"
|
||||
targetProject="src\main\java" implementationPackage="">
|
||||
targetProject="src\main\java">
|
||||
<property name="enableSubPackages" value="false"/>
|
||||
<property name="exampleMethodVisibility" value="public"/>
|
||||
</javaClientGenerator>
|
||||
@@ -45,9 +45,7 @@
|
||||
<table tableName="jsh_accounthead" domainObjectName="AccountHead"></table>
|
||||
<table tableName="jsh_accountitem" domainObjectName="AccountItem"></table>
|
||||
<table tableName="jsh_depot" domainObjectName="Depot"></table>
|
||||
<table tableName="jsh_depothead" domainObjectName="DepotHead">
|
||||
<generatedKey column="id" sqlStatement="SELECT LAST_INSERT_ID()"/>
|
||||
</table>
|
||||
<table tableName="jsh_depothead" domainObjectName="DepotHead"></table>
|
||||
<table tableName="jsh_depotitem" domainObjectName="DepotItem"></table>
|
||||
<table tableName="jsh_functions" domainObjectName="Functions"></table>
|
||||
<table tableName="jsh_inoutitem" domainObjectName="InOutItem"></table>
|
||||
@@ -61,9 +59,7 @@
|
||||
<table tableName="jsh_supplier" domainObjectName="Supplier"></table>
|
||||
<table tableName="jsh_systemconfig" domainObjectName="SystemConfig"></table>
|
||||
<table tableName="jsh_unit" domainObjectName="Unit"></table>
|
||||
<table tableName="jsh_user" domainObjectName="User">
|
||||
<generatedKey column="id" sqlStatement="SELECT LAST_INSERT_ID()"/>
|
||||
</table>
|
||||
<table tableName="jsh_user" domainObjectName="User"></table>
|
||||
<table tableName="jsh_userbusiness" domainObjectName="UserBusiness"></table>
|
||||
<table tableName="jsh_serial_number" domainObjectName="SerialNumber"></table>
|
||||
<table tableName="jsh_organization" domainObjectName="Organization"></table>
|
||||
|
||||
Reference in New Issue
Block a user