Commit b9fb7e2c authored by 季圣华's avatar 季圣华
Browse files

优化用户和单据模块

parent 8cfdc3dc
......@@ -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());
......
......@@ -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>
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment