Commit 86b9ae90 authored by qiankunpingtai's avatar qiankunpingtai
Browse files

仓库添加负责人字段

parent c6056838
......@@ -76,6 +76,14 @@
data-options="min:0,precision:2" style="width: 215px;height: 20px"/> 
</td>
</tr>
<tr>
<td>负责人</td>
<td style="padding:5px">
<input name="principalName" id="principalName"
style="width: 230px;height: 20px" readonly="readonly"/>
<input name="principal" id="principal" type="hidden"/>
</td>
</tr>
<tr>
<td>排序</td>
<td style="padding:5px">
......@@ -145,7 +153,7 @@
formatter: function (value, rec) {
var str = '';
var rowInfo = rec.id + 'AaBb' + rec.name + 'AaBb' + rec.sort + 'AaBb' + rec.remark + 'AaBb'
+ rec.address + 'AaBb' + rec.warehousing + 'AaBb' + rec.truckage;
+ rec.address + 'AaBb' + rec.warehousing + 'AaBb' + rec.truckage+rec.principalName+rec.principal;
str += '<img title="编辑" src="/js/easyui-1.3.5/themes/icons/pencil.png" style="cursor: pointer;" onclick="editDepot(\'' + rowInfo + '\');"/>&nbsp;&nbsp;&nbsp;';
str += '<img title="删除" src="/js/easyui-1.3.5/themes/icons/edit_remove.png" style="cursor: pointer;" onclick="deleteDepot(' + rec.id + ');"/>';
return str;
......@@ -155,6 +163,7 @@
{title: '仓库地址', field: 'address', width: 200},
{title: '仓储费', field: 'warehousing', width: 60},
{title: '搬运费', field: 'truckage', width: 60},
{title: '负责人', field: 'principalName', width: 60},
{title: '排序', field: 'sort', width: 60},
{title: '描述', field: 'remark', width: 120}
]],
......@@ -419,7 +428,7 @@
var remark = $.trim($("#searchRemark").val());
$.ajax({
type: "get",
url: "/depot/list",
url: "/depot/getDepotList",
dataType: "json",
data: ({
search: JSON.stringify({
......
......@@ -98,6 +98,11 @@
<version>1.7.25</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>com.github.pagehelper</groupId>
<artifactId>pagehelper-spring-boot-starter</artifactId>
<version>1.2.10</version>
</dependency>
</dependencies>
<repositories>
......
......@@ -1240,4 +1240,16 @@ insert into `jsh_functions`(`Number`, `Name`, `PNumber`, `URL`, `State`, `Sort`,
-- ----------------------------
update jsh_userbusiness SET Type = 'RoleFunctions', KeyId = '4',
Value = '[13][12][16][14][15][234][236][22][23][220][240][25][217][218][26][194][195][31][59][207][208][209][226][227][228][229][235][237][210][211][242][33][199][243][41][200][201][202][40][232][233][197][203][204][205][206][212]'
where Id = 5;
\ No newline at end of file
where Id = 5;
-- ----------------------------
-- 时间:2019年2月25日
-- version:1.0.4
-- 此次更新仓库添加负责人信息,负责人信息从用户表获取
-- 特别提醒:之后的sql都是在之前基础上迭代,可以对已存在的系统进行数据保留更新
-- ----------------------------
-- ----------------------------
-- 仓库表添加字段principal,负责人
-- ----------------------------
alter table jsh_depot add principal bigint(20) DEFAULT null COMMENT '负责人';
......@@ -16,11 +16,15 @@ public class BusinessConstants {
/**
* 默认的分页起始页页码
*/
public static final String DEFAULT_PAGINATION_PAGE_NUMBER = "1";
public static final Integer DEFAULT_PAGINATION_PAGE_NUMBER = 1;
/**
* 默认的分页页
* 无数据时列表返回的默认数据条
*/
public static final String DEFAULT_PAGINATION_PAGE_SIZE = "10";
public static final Long DEFAULT_LIST_NULL_NUMBER = 0L;
/**
* 默认的分页条数
*/
public static final Integer DEFAULT_PAGINATION_PAGE_SIZE = 10;
/**
* 单据主表出入库类型 type 入库 出库
* depothead
......
package com.jsh.erp.controller;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.github.pagehelper.Page;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.jsh.erp.constants.BusinessConstants;
import com.jsh.erp.datasource.entities.Depot;
import com.jsh.erp.datasource.entities.DepotEx;
import com.jsh.erp.service.depot.DepotService;
import com.jsh.erp.service.userBusiness.UserBusinessService;
import com.jsh.erp.utils.BaseResponseInfo;
import com.jsh.erp.utils.*;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.dao.DataAccessException;
......@@ -14,7 +20,9 @@ import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import java.io.IOException;
import java.util.List;
import java.util.*;
import static com.jsh.erp.utils.ResponseJsonUtil.returnJson;
/**
* @author ji sheng hua 752*718*920
......@@ -121,4 +129,49 @@ public class DepotController {
}
return arr;
}
/**
* create by: cjl
* description:
* 查询仓库列表信息
* create time: 2019/2/25 14:32
* @Param: pageSize
 * @Param: currentPage
 * @Param: search
* @return java.lang.String
*/
@RequestMapping(value = "/getDepotList")
public String getDepotList(
@RequestParam(value = Constants.PAGE_SIZE, required = false) Integer pageSize,
@RequestParam(value = Constants.CURRENT_PAGE, required = false) Integer currentPage,
@RequestParam(value = Constants.SEARCH, required = false) String search) {
Map<String, Object> parameterMap = new HashMap<String, Object>();
//查询参数
JSONObject obj=JSON.parseObject(search);
Set<String> key= obj.keySet();
for(String keyEach: key){
parameterMap.put(keyEach,obj.getString(keyEach));
}
PageQueryInfo queryInfo = new PageQueryInfo();
Map<String, Object> objectMap = new HashMap<String, Object>();
if (pageSize == null || pageSize <= 0) {
pageSize = BusinessConstants.DEFAULT_PAGINATION_PAGE_SIZE;
}
if (currentPage == null || currentPage <= 0) {
currentPage = BusinessConstants.DEFAULT_PAGINATION_PAGE_NUMBER;
}
PageHelper.startPage(currentPage,pageSize,false);
List<DepotEx> list = depotService.getDepotList(parameterMap);
//获取分页查询后的数据
PageInfo<DepotEx> pageInfo = new PageInfo<>(list);
objectMap.put("page", queryInfo);
if (list == null) {
queryInfo.setRows(new ArrayList<Object>());
queryInfo.setTotal(BusinessConstants.DEFAULT_LIST_NULL_NUMBER);
return returnJson(objectMap, "查找不到数据", ErpInfo.OK.code);
}
queryInfo.setRows(list);
queryInfo.setTotal(pageInfo.getTotal());
return returnJson(objectMap, ErpInfo.OK.name, ErpInfo.OK.code);
}
}
......@@ -2,6 +2,7 @@ package com.jsh.erp.controller;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.jsh.erp.constants.BusinessConstants;
import com.jsh.erp.datasource.entities.*;
import com.jsh.erp.service.depotItem.DepotItemService;
import com.jsh.erp.service.material.MaterialService;
......@@ -113,7 +114,7 @@ public class DepotItemController {
objectMap.put("page", queryInfo);
if (list == null) {
queryInfo.setRows(new ArrayList<Object>());
queryInfo.setTotal(0);
queryInfo.setTotal(BusinessConstants.DEFAULT_LIST_NULL_NUMBER);
return returnJson(objectMap, "查找不到数据", ErpInfo.OK.code);
}
queryInfo.setRows(dataArray);
......@@ -169,7 +170,7 @@ public class DepotItemController {
objectMap.put("page", dataArray);
if (list == null) {
queryInfo.setRows(new ArrayList<Object>());
queryInfo.setTotal(0);
queryInfo.setTotal(BusinessConstants.DEFAULT_LIST_NULL_NUMBER);
return returnJson(objectMap, "查找不到数据", ErpInfo.OK.code);
}
queryInfo.setRows(list);
......@@ -223,7 +224,7 @@ public class DepotItemController {
objectMap.put("page", dataArray);
if (list == null) {
queryInfo.setRows(new ArrayList<Object>());
queryInfo.setTotal(0);
queryInfo.setTotal(BusinessConstants.DEFAULT_LIST_NULL_NUMBER);
return returnJson(objectMap, "查找不到数据", ErpInfo.OK.code);
}
queryInfo.setRows(list);
......
package com.jsh.erp.controller;
import com.alibaba.fastjson.JSONObject;
import com.jsh.erp.constants.BusinessConstants;
import com.jsh.erp.service.CommonQueryManager;
import com.jsh.erp.utils.*;
......@@ -49,7 +50,7 @@ public class ResourceController {
objectMap.put("page", queryInfo);
if (list == null) {
queryInfo.setRows(new ArrayList<Object>());
queryInfo.setTotal(0);
queryInfo.setTotal(BusinessConstants.DEFAULT_LIST_NULL_NUMBER);
return returnJson(objectMap, "查找不到数据", ErpInfo.OK.code);
}
queryInfo.setRows(list);
......
......@@ -67,6 +67,14 @@ public class Depot {
*/
private String remark;
/**
* This field was generated by MyBatis Generator.
* This field corresponds to the database column jsh_depot.principal
*
* @mbggenerated
*/
private Long principal;
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column jsh_depot.id
......@@ -258,4 +266,28 @@ public class Depot {
public void setRemark(String remark) {
this.remark = remark == null ? null : remark.trim();
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column jsh_depot.principal
*
* @return the value of jsh_depot.principal
*
* @mbggenerated
*/
public Long getPrincipal() {
return principal;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column jsh_depot.principal
*
* @param principal the value for jsh_depot.principal
*
* @mbggenerated
*/
public void setPrincipal(Long principal) {
this.principal = principal;
}
}
\ No newline at end of file
package com.jsh.erp.datasource.entities;
/**
* Description
*
* @Author: cjl
* @Date: 2019/2/25 11:40
*/
public class DepotEx extends Depot{
//负责人名字
private String principalName;
public String getPrincipalName() {
return principalName;
}
public void setPrincipalName(String principalName) {
this.principalName = principalName;
}
}
......@@ -714,6 +714,66 @@ public class DepotExample {
addCriterion("remark not between", value1, value2, "remark");
return (Criteria) this;
}
public Criteria andPrincipalIsNull() {
addCriterion("principal is null");
return (Criteria) this;
}
public Criteria andPrincipalIsNotNull() {
addCriterion("principal is not null");
return (Criteria) this;
}
public Criteria andPrincipalEqualTo(Long value) {
addCriterion("principal =", value, "principal");
return (Criteria) this;
}
public Criteria andPrincipalNotEqualTo(Long value) {
addCriterion("principal <>", value, "principal");
return (Criteria) this;
}
public Criteria andPrincipalGreaterThan(Long value) {
addCriterion("principal >", value, "principal");
return (Criteria) this;
}
public Criteria andPrincipalGreaterThanOrEqualTo(Long value) {
addCriterion("principal >=", value, "principal");
return (Criteria) this;
}
public Criteria andPrincipalLessThan(Long value) {
addCriterion("principal <", value, "principal");
return (Criteria) this;
}
public Criteria andPrincipalLessThanOrEqualTo(Long value) {
addCriterion("principal <=", value, "principal");
return (Criteria) this;
}
public Criteria andPrincipalIn(List<Long> values) {
addCriterion("principal in", values, "principal");
return (Criteria) this;
}
public Criteria andPrincipalNotIn(List<Long> values) {
addCriterion("principal not in", values, "principal");
return (Criteria) this;
}
public Criteria andPrincipalBetween(Long value1, Long value2) {
addCriterion("principal between", value1, value2, "principal");
return (Criteria) this;
}
public Criteria andPrincipalNotBetween(Long value1, Long value2) {
addCriterion("principal not between", value1, value2, "principal");
return (Criteria) this;
}
}
/**
......
......@@ -18,7 +18,7 @@ public interface AccountHeadMapperEx {
@Param("offset") Integer offset,
@Param("rows") Integer rows);
int countsByAccountHead(
Long countsByAccountHead(
@Param("type") String type,
@Param("billNo") String billNo,
@Param("beginTime") String beginTime,
......
......@@ -16,7 +16,7 @@ public interface AccountItemMapperEx {
@Param("offset") Integer offset,
@Param("rows") Integer rows);
int countsByAccountItem(
Long countsByAccountItem(
@Param("name") String name,
@Param("type") Integer type,
@Param("remark") String remark);
......
......@@ -17,7 +17,7 @@ public interface AccountMapperEx {
@Param("offset") Integer offset,
@Param("rows") Integer rows);
int countsByAccount(
Long countsByAccount(
@Param("name") String name,
@Param("serialNo") String serialNo,
@Param("remark") String remark);
......
......@@ -14,7 +14,7 @@ public interface AppMapperEx {
@Param("offset") Integer offset,
@Param("rows") Integer rows);
int countsByApp(
Long countsByApp(
@Param("name") String name,
@Param("type") String type);
}
\ No newline at end of file
......@@ -27,7 +27,7 @@ public interface DepotHeadMapperEx {
@Param("offset") Integer offset,
@Param("rows") Integer rows);
int countsByDepotHead(
Long countsByDepotHead(
@Param("type") String type,
@Param("subType") String subType,
@Param("number") String number,
......
......@@ -20,7 +20,7 @@ public interface DepotItemMapperEx {
@Param("offset") Integer offset,
@Param("rows") Integer rows);
int countsByDepotItem(
Long countsByDepotItem(
@Param("name") String name,
@Param("type") Integer type,
@Param("remark") String remark);
......@@ -34,7 +34,7 @@ public interface DepotItemMapperEx {
@Param("offset") Integer offset,
@Param("rows") Integer rows);
int findDetailByTypeAndMaterialIdCounts(
Long findDetailByTypeAndMaterialIdCounts(
@Param("mId") Long mId);
List<DepotItemVo4Material> findStockNumByMaterialIdList(
......@@ -43,7 +43,7 @@ public interface DepotItemMapperEx {
@Param("offset") Integer offset,
@Param("rows") Integer rows);
int findStockNumByMaterialIdCounts(
Long findStockNumByMaterialIdCounts(
@Param("mId") Long mId,
@Param("monthTime") String monthTime);
......
package com.jsh.erp.datasource.mappers;
import com.jsh.erp.datasource.entities.Depot;
import com.jsh.erp.datasource.entities.DepotEx;
import com.jsh.erp.datasource.entities.DepotExample;
import org.apache.ibatis.annotations.Param;
import java.util.List;
import java.util.Map;
public interface DepotMapperEx {
......@@ -15,8 +17,11 @@ public interface DepotMapperEx {
@Param("offset") Integer offset,
@Param("rows") Integer rows);
int countsByDepot(
Long countsByDepot(
@Param("name") String name,
@Param("type") Integer type,
@Param("remark") String remark);
List<DepotEx> getDepotList(Map<String, Object> params);
Long getDepotListCount(Map<String, Object> params);
}
\ No newline at end of file
......@@ -14,7 +14,7 @@ public interface FunctionsMapperEx {
@Param("offset") Integer offset,
@Param("rows") Integer rows);
int countsByFunctions(
Long countsByFunctions(
@Param("name") String name,
@Param("type") String type);
}
\ No newline at end of file
......@@ -15,7 +15,7 @@ public interface InOutItemMapperEx {
@Param("offset") Integer offset,
@Param("rows") Integer rows);
int countsByInOutItem(
Long countsByInOutItem(
@Param("name") String name,
@Param("type") String type,
@Param("remark") String remark);
......
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