重构华夏erp的整体ui风格

This commit is contained in:
季圣华
2019-09-13 22:16:29 +08:00
parent 4b82ad7f29
commit 9247e77398
345 changed files with 119676 additions and 620 deletions

View File

@@ -239,6 +239,8 @@ public class DepotItemController {
item.put("Unit", diEx.getMunit());
item.put("OperNumber", diEx.getOpernumber());
item.put("BasicNumber", diEx.getBasicnumber());
//统计该商品已分批出库的总数量-用于订单
item.put("finishNumber", depotItemService.getFinishNumber(diEx.getMaterialid(),diEx.getHeaderid()));
item.put("UnitPrice", diEx.getUnitprice());
item.put("TaxUnitPrice", diEx.getTaxunitprice());
item.put("AllPrice", diEx.getAllprice());

View File

@@ -37,8 +37,8 @@ public class FunctionsController {
@PostMapping(value = "/findMenu")
public JSONArray findMenu(@RequestParam(value="pNumber") String pNumber,
@RequestParam(value="hasFunctions") String hasFunctions,
HttpServletRequest request)throws Exception {
@RequestParam(value="hasFunctions") String hasFunctions,
HttpServletRequest request)throws Exception {
//存放数据json数组
JSONArray dataArray = new JSONArray();
try {
@@ -52,6 +52,7 @@ public class FunctionsController {
JSONArray dataArray1 = new JSONArray();
if (dataList1.size() != 0) {
item.put("text", functions.getName()); //是目录就没链接
item.put("icon", functions.getIcon());
for (Functions functions1 : dataList1) {
item.put("state", "open"); //如果不为空,节点展开
JSONObject item1 = new JSONObject();
@@ -61,6 +62,7 @@ public class FunctionsController {
JSONArray dataArray2 = new JSONArray();
if (dataList2.size() != 0) {
item1.put("text", functions1.getName());//是目录就没链接
item1.put("icon", functions1.getIcon());
for (Functions functions2 : dataList2) {
item1.put("state", "closed"); //如果不为空,节点不展开
JSONObject item2 = new JSONObject();
@@ -70,40 +72,46 @@ public class FunctionsController {
JSONArray dataArray3 = new JSONArray();
if (dataList3.size() != 0) {
item2.put("text", functions2.getName());//是目录就没链接
item2.put("icon", functions2.getIcon());
for (Functions functions3 : dataList3) {
item2.put("state", "closed"); //如果不为空,节点不展开
JSONObject item3 = new JSONObject();
item3.put("id", functions3.getId());
item3.put("text", functions3.getName());
item3.put("icon", functions3.getIcon());
//
dataArray3.add(item3);
item2.put("children", dataArray3);
}
} else {
//不是目录,有链接
item2.put("text", "<a onclick=\"NewTab('" + functions2.getName() + "','" + functions2.getUrl() + "','" + functions2.getId() + "')\">" + functions2.getName() + "</a>");
item2.put("text", functions2.getName());
item2.put("icon", functions2.getIcon());
item2.put("url", functions2.getUrl());
dataArray2.add(item2);
item1.put("children", dataArray2);
}
} else {
//不是目录,有链接
//item2.put("text", "<a onclick=\"NewTab('" + functions2.getName() + "','" + functions2.getUrl() + "','" + functions2.getId() + "')\">" + functions2.getName() + "</a>");
}
}
} else {
//不是目录,有链接
item1.put("text", "<a onclick=\"NewTab('" + functions1.getName() + "','" + functions1.getUrl() + "','" + functions1.getId() + "')\">" + functions1.getName() + "</a>");
item1.put("text", functions1.getName());
item1.put("icon", functions1.getIcon());
item1.put("url", functions1.getUrl());
dataArray1.add(item1);
item.put("children", dataArray1);
}
} else {
//不是目录,有链接
//item1.put("text", "<a onclick=\"NewTab('" + functions1.getName() + "','" + functions1.getUrl() + "','" + functions1.getId() + "')\">" + functions1.getName() + "</a>");
}
}
} else {
//不是目录,有链接
item.put("text", "<a onclick=\"NewTab('" + functions.getName() + "','" + functions.getUrl() + "','" + functions.getId() + "')\">" + functions.getName() + "</a>");
item.put("text", functions.getName());
item.put("icon", functions.getIcon());
item.put("url", functions.getUrl());
}
dataArray.add(item);
}

View File

@@ -0,0 +1,57 @@
package com.jsh.erp.controller;
import com.jsh.erp.datasource.entities.Msg;
import com.jsh.erp.service.msg.MsgService;
import com.jsh.erp.utils.BaseResponseInfo;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import java.util.List;
/**
* @author ji sheng hua 华夏ERP
*/
@RestController
@RequestMapping(value = "/msg")
public class MsgController {
private Logger logger = LoggerFactory.getLogger(MsgController.class);
@Resource
private MsgService msgService;
@GetMapping("/getMsgByStatus")
public BaseResponseInfo getMsgByStatus(@RequestParam("status") String status,
HttpServletRequest request)throws Exception {
BaseResponseInfo res = new BaseResponseInfo();
try {
List<Msg> list = msgService.getMsgByStatus(status);
res.code = 200;
res.data = list;
} catch(Exception e){
e.printStackTrace();
res.code = 500;
res.data = "获取数据失败";
}
return res;
}
@PostMapping("/batchUpdateStatus")
public BaseResponseInfo batchUpdateStatus(@RequestParam("ids") String ids,
@RequestParam("status") String status,
HttpServletRequest request)throws Exception {
BaseResponseInfo res = new BaseResponseInfo();
try {
msgService.batchUpdateStatus(ids, status);
res.code = 200;
res.data = "更新成功";
} catch(Exception e){
e.printStackTrace();
res.code = 500;
res.data = "获取数据失败";
}
return res;
}
}

View File

@@ -81,6 +81,14 @@ public class Functions {
*/
private String pushbtn;
/**
* This field was generated by MyBatis Generator.
* This field corresponds to the database column jsh_functions.icon
*
* @mbggenerated
*/
private String icon;
/**
* This field was generated by MyBatis Generator.
* This field corresponds to the database column jsh_functions.delete_Flag
@@ -329,6 +337,30 @@ public class Functions {
this.pushbtn = pushbtn == null ? null : pushbtn.trim();
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column jsh_functions.icon
*
* @return the value of jsh_functions.icon
*
* @mbggenerated
*/
public String getIcon() {
return icon;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column jsh_functions.icon
*
* @param icon the value for jsh_functions.icon
*
* @mbggenerated
*/
public void setIcon(String icon) {
this.icon = icon == null ? null : icon.trim();
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column jsh_functions.delete_Flag

View File

@@ -864,6 +864,76 @@ public class FunctionsExample {
return (Criteria) this;
}
public Criteria andIconIsNull() {
addCriterion("icon is null");
return (Criteria) this;
}
public Criteria andIconIsNotNull() {
addCriterion("icon is not null");
return (Criteria) this;
}
public Criteria andIconEqualTo(String value) {
addCriterion("icon =", value, "icon");
return (Criteria) this;
}
public Criteria andIconNotEqualTo(String value) {
addCriterion("icon <>", value, "icon");
return (Criteria) this;
}
public Criteria andIconGreaterThan(String value) {
addCriterion("icon >", value, "icon");
return (Criteria) this;
}
public Criteria andIconGreaterThanOrEqualTo(String value) {
addCriterion("icon >=", value, "icon");
return (Criteria) this;
}
public Criteria andIconLessThan(String value) {
addCriterion("icon <", value, "icon");
return (Criteria) this;
}
public Criteria andIconLessThanOrEqualTo(String value) {
addCriterion("icon <=", value, "icon");
return (Criteria) this;
}
public Criteria andIconLike(String value) {
addCriterion("icon like", value, "icon");
return (Criteria) this;
}
public Criteria andIconNotLike(String value) {
addCriterion("icon not like", value, "icon");
return (Criteria) this;
}
public Criteria andIconIn(List<String> values) {
addCriterion("icon in", values, "icon");
return (Criteria) this;
}
public Criteria andIconNotIn(List<String> values) {
addCriterion("icon not in", values, "icon");
return (Criteria) this;
}
public Criteria andIconBetween(String value1, String value2) {
addCriterion("icon between", value1, value2, "icon");
return (Criteria) this;
}
public Criteria andIconNotBetween(String value1, String value2) {
addCriterion("icon not between", value1, value2, "icon");
return (Criteria) this;
}
public Criteria andDeleteFlagIsNull() {
addCriterion("delete_Flag is null");
return (Criteria) this;

View File

@@ -0,0 +1,261 @@
package com.jsh.erp.datasource.entities;
import java.util.Date;
public class Msg {
/**
* This field was generated by MyBatis Generator.
* This field corresponds to the database column jsh_msg.id
*
* @mbggenerated
*/
private Long id;
/**
* This field was generated by MyBatis Generator.
* This field corresponds to the database column jsh_msg.msg_title
*
* @mbggenerated
*/
private String msgTitle;
/**
* This field was generated by MyBatis Generator.
* This field corresponds to the database column jsh_msg.msg_content
*
* @mbggenerated
*/
private String msgContent;
/**
* This field was generated by MyBatis Generator.
* This field corresponds to the database column jsh_msg.create_time
*
* @mbggenerated
*/
private Date createTime;
/**
* This field was generated by MyBatis Generator.
* This field corresponds to the database column jsh_msg.type
*
* @mbggenerated
*/
private String type;
/**
* This field was generated by MyBatis Generator.
* This field corresponds to the database column jsh_msg.status
*
* @mbggenerated
*/
private String status;
/**
* This field was generated by MyBatis Generator.
* This field corresponds to the database column jsh_msg.tenant_id
*
* @mbggenerated
*/
private Long tenantId;
/**
* This field was generated by MyBatis Generator.
* This field corresponds to the database column jsh_msg.delete_Flag
*
* @mbggenerated
*/
private String deleteFlag;
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column jsh_msg.id
*
* @return the value of jsh_msg.id
*
* @mbggenerated
*/
public Long getId() {
return id;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column jsh_msg.id
*
* @param id the value for jsh_msg.id
*
* @mbggenerated
*/
public void setId(Long id) {
this.id = id;
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column jsh_msg.msg_title
*
* @return the value of jsh_msg.msg_title
*
* @mbggenerated
*/
public String getMsgTitle() {
return msgTitle;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column jsh_msg.msg_title
*
* @param msgTitle the value for jsh_msg.msg_title
*
* @mbggenerated
*/
public void setMsgTitle(String msgTitle) {
this.msgTitle = msgTitle == null ? null : msgTitle.trim();
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column jsh_msg.msg_content
*
* @return the value of jsh_msg.msg_content
*
* @mbggenerated
*/
public String getMsgContent() {
return msgContent;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column jsh_msg.msg_content
*
* @param msgContent the value for jsh_msg.msg_content
*
* @mbggenerated
*/
public void setMsgContent(String msgContent) {
this.msgContent = msgContent == null ? null : msgContent.trim();
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column jsh_msg.create_time
*
* @return the value of jsh_msg.create_time
*
* @mbggenerated
*/
public Date getCreateTime() {
return createTime;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column jsh_msg.create_time
*
* @param createTime the value for jsh_msg.create_time
*
* @mbggenerated
*/
public void setCreateTime(Date createTime) {
this.createTime = createTime;
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column jsh_msg.type
*
* @return the value of jsh_msg.type
*
* @mbggenerated
*/
public String getType() {
return type;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column jsh_msg.type
*
* @param type the value for jsh_msg.type
*
* @mbggenerated
*/
public void setType(String type) {
this.type = type == null ? null : type.trim();
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column jsh_msg.status
*
* @return the value of jsh_msg.status
*
* @mbggenerated
*/
public String getStatus() {
return status;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column jsh_msg.status
*
* @param status the value for jsh_msg.status
*
* @mbggenerated
*/
public void setStatus(String status) {
this.status = status == null ? null : status.trim();
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column jsh_msg.tenant_id
*
* @return the value of jsh_msg.tenant_id
*
* @mbggenerated
*/
public Long getTenantId() {
return tenantId;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column jsh_msg.tenant_id
*
* @param tenantId the value for jsh_msg.tenant_id
*
* @mbggenerated
*/
public void setTenantId(Long tenantId) {
this.tenantId = tenantId;
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column jsh_msg.delete_Flag
*
* @return the value of jsh_msg.delete_Flag
*
* @mbggenerated
*/
public String getDeleteFlag() {
return deleteFlag;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column jsh_msg.delete_Flag
*
* @param deleteFlag the value for jsh_msg.delete_Flag
*
* @mbggenerated
*/
public void setDeleteFlag(String deleteFlag) {
this.deleteFlag = deleteFlag == null ? null : deleteFlag.trim();
}
}

View File

@@ -0,0 +1,833 @@
package com.jsh.erp.datasource.entities;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
public class MsgExample {
/**
* This field was generated by MyBatis Generator.
* This field corresponds to the database table jsh_msg
*
* @mbggenerated
*/
protected String orderByClause;
/**
* This field was generated by MyBatis Generator.
* This field corresponds to the database table jsh_msg
*
* @mbggenerated
*/
protected boolean distinct;
/**
* This field was generated by MyBatis Generator.
* This field corresponds to the database table jsh_msg
*
* @mbggenerated
*/
protected List<Criteria> oredCriteria;
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table jsh_msg
*
* @mbggenerated
*/
public MsgExample() {
oredCriteria = new ArrayList<Criteria>();
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table jsh_msg
*
* @mbggenerated
*/
public void setOrderByClause(String orderByClause) {
this.orderByClause = orderByClause;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table jsh_msg
*
* @mbggenerated
*/
public String getOrderByClause() {
return orderByClause;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table jsh_msg
*
* @mbggenerated
*/
public void setDistinct(boolean distinct) {
this.distinct = distinct;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table jsh_msg
*
* @mbggenerated
*/
public boolean isDistinct() {
return distinct;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table jsh_msg
*
* @mbggenerated
*/
public List<Criteria> getOredCriteria() {
return oredCriteria;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table jsh_msg
*
* @mbggenerated
*/
public void or(Criteria criteria) {
oredCriteria.add(criteria);
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table jsh_msg
*
* @mbggenerated
*/
public Criteria or() {
Criteria criteria = createCriteriaInternal();
oredCriteria.add(criteria);
return criteria;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table jsh_msg
*
* @mbggenerated
*/
public Criteria createCriteria() {
Criteria criteria = createCriteriaInternal();
if (oredCriteria.size() == 0) {
oredCriteria.add(criteria);
}
return criteria;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table jsh_msg
*
* @mbggenerated
*/
protected Criteria createCriteriaInternal() {
Criteria criteria = new Criteria();
return criteria;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table jsh_msg
*
* @mbggenerated
*/
public void clear() {
oredCriteria.clear();
orderByClause = null;
distinct = false;
}
/**
* This class was generated by MyBatis Generator.
* This class corresponds to the database table jsh_msg
*
* @mbggenerated
*/
protected abstract static class GeneratedCriteria {
protected List<Criterion> criteria;
protected GeneratedCriteria() {
super();
criteria = new ArrayList<Criterion>();
}
public boolean isValid() {
return criteria.size() > 0;
}
public List<Criterion> getAllCriteria() {
return criteria;
}
public List<Criterion> getCriteria() {
return criteria;
}
protected void addCriterion(String condition) {
if (condition == null) {
throw new RuntimeException("Value for condition cannot be null");
}
criteria.add(new Criterion(condition));
}
protected void addCriterion(String condition, Object value, String property) {
if (value == null) {
throw new RuntimeException("Value for " + property + " cannot be null");
}
criteria.add(new Criterion(condition, value));
}
protected void addCriterion(String condition, Object value1, Object value2, String property) {
if (value1 == null || value2 == null) {
throw new RuntimeException("Between values for " + property + " cannot be null");
}
criteria.add(new Criterion(condition, value1, value2));
}
public Criteria andIdIsNull() {
addCriterion("id is null");
return (Criteria) this;
}
public Criteria andIdIsNotNull() {
addCriterion("id is not null");
return (Criteria) this;
}
public Criteria andIdEqualTo(Long value) {
addCriterion("id =", value, "id");
return (Criteria) this;
}
public Criteria andIdNotEqualTo(Long value) {
addCriterion("id <>", value, "id");
return (Criteria) this;
}
public Criteria andIdGreaterThan(Long value) {
addCriterion("id >", value, "id");
return (Criteria) this;
}
public Criteria andIdGreaterThanOrEqualTo(Long value) {
addCriterion("id >=", value, "id");
return (Criteria) this;
}
public Criteria andIdLessThan(Long value) {
addCriterion("id <", value, "id");
return (Criteria) this;
}
public Criteria andIdLessThanOrEqualTo(Long value) {
addCriterion("id <=", value, "id");
return (Criteria) this;
}
public Criteria andIdIn(List<Long> values) {
addCriterion("id in", values, "id");
return (Criteria) this;
}
public Criteria andIdNotIn(List<Long> values) {
addCriterion("id not in", values, "id");
return (Criteria) this;
}
public Criteria andIdBetween(Long value1, Long value2) {
addCriterion("id between", value1, value2, "id");
return (Criteria) this;
}
public Criteria andIdNotBetween(Long value1, Long value2) {
addCriterion("id not between", value1, value2, "id");
return (Criteria) this;
}
public Criteria andMsgTitleIsNull() {
addCriterion("msg_title is null");
return (Criteria) this;
}
public Criteria andMsgTitleIsNotNull() {
addCriterion("msg_title is not null");
return (Criteria) this;
}
public Criteria andMsgTitleEqualTo(String value) {
addCriterion("msg_title =", value, "msgTitle");
return (Criteria) this;
}
public Criteria andMsgTitleNotEqualTo(String value) {
addCriterion("msg_title <>", value, "msgTitle");
return (Criteria) this;
}
public Criteria andMsgTitleGreaterThan(String value) {
addCriterion("msg_title >", value, "msgTitle");
return (Criteria) this;
}
public Criteria andMsgTitleGreaterThanOrEqualTo(String value) {
addCriterion("msg_title >=", value, "msgTitle");
return (Criteria) this;
}
public Criteria andMsgTitleLessThan(String value) {
addCriterion("msg_title <", value, "msgTitle");
return (Criteria) this;
}
public Criteria andMsgTitleLessThanOrEqualTo(String value) {
addCriterion("msg_title <=", value, "msgTitle");
return (Criteria) this;
}
public Criteria andMsgTitleLike(String value) {
addCriterion("msg_title like", value, "msgTitle");
return (Criteria) this;
}
public Criteria andMsgTitleNotLike(String value) {
addCriterion("msg_title not like", value, "msgTitle");
return (Criteria) this;
}
public Criteria andMsgTitleIn(List<String> values) {
addCriterion("msg_title in", values, "msgTitle");
return (Criteria) this;
}
public Criteria andMsgTitleNotIn(List<String> values) {
addCriterion("msg_title not in", values, "msgTitle");
return (Criteria) this;
}
public Criteria andMsgTitleBetween(String value1, String value2) {
addCriterion("msg_title between", value1, value2, "msgTitle");
return (Criteria) this;
}
public Criteria andMsgTitleNotBetween(String value1, String value2) {
addCriterion("msg_title not between", value1, value2, "msgTitle");
return (Criteria) this;
}
public Criteria andMsgContentIsNull() {
addCriterion("msg_content is null");
return (Criteria) this;
}
public Criteria andMsgContentIsNotNull() {
addCriterion("msg_content is not null");
return (Criteria) this;
}
public Criteria andMsgContentEqualTo(String value) {
addCriterion("msg_content =", value, "msgContent");
return (Criteria) this;
}
public Criteria andMsgContentNotEqualTo(String value) {
addCriterion("msg_content <>", value, "msgContent");
return (Criteria) this;
}
public Criteria andMsgContentGreaterThan(String value) {
addCriterion("msg_content >", value, "msgContent");
return (Criteria) this;
}
public Criteria andMsgContentGreaterThanOrEqualTo(String value) {
addCriterion("msg_content >=", value, "msgContent");
return (Criteria) this;
}
public Criteria andMsgContentLessThan(String value) {
addCriterion("msg_content <", value, "msgContent");
return (Criteria) this;
}
public Criteria andMsgContentLessThanOrEqualTo(String value) {
addCriterion("msg_content <=", value, "msgContent");
return (Criteria) this;
}
public Criteria andMsgContentLike(String value) {
addCriterion("msg_content like", value, "msgContent");
return (Criteria) this;
}
public Criteria andMsgContentNotLike(String value) {
addCriterion("msg_content not like", value, "msgContent");
return (Criteria) this;
}
public Criteria andMsgContentIn(List<String> values) {
addCriterion("msg_content in", values, "msgContent");
return (Criteria) this;
}
public Criteria andMsgContentNotIn(List<String> values) {
addCriterion("msg_content not in", values, "msgContent");
return (Criteria) this;
}
public Criteria andMsgContentBetween(String value1, String value2) {
addCriterion("msg_content between", value1, value2, "msgContent");
return (Criteria) this;
}
public Criteria andMsgContentNotBetween(String value1, String value2) {
addCriterion("msg_content not between", value1, value2, "msgContent");
return (Criteria) this;
}
public Criteria andCreateTimeIsNull() {
addCriterion("create_time is null");
return (Criteria) this;
}
public Criteria andCreateTimeIsNotNull() {
addCriterion("create_time is not null");
return (Criteria) this;
}
public Criteria andCreateTimeEqualTo(Date value) {
addCriterion("create_time =", value, "createTime");
return (Criteria) this;
}
public Criteria andCreateTimeNotEqualTo(Date value) {
addCriterion("create_time <>", value, "createTime");
return (Criteria) this;
}
public Criteria andCreateTimeGreaterThan(Date value) {
addCriterion("create_time >", value, "createTime");
return (Criteria) this;
}
public Criteria andCreateTimeGreaterThanOrEqualTo(Date value) {
addCriterion("create_time >=", value, "createTime");
return (Criteria) this;
}
public Criteria andCreateTimeLessThan(Date value) {
addCriterion("create_time <", value, "createTime");
return (Criteria) this;
}
public Criteria andCreateTimeLessThanOrEqualTo(Date value) {
addCriterion("create_time <=", value, "createTime");
return (Criteria) this;
}
public Criteria andCreateTimeIn(List<Date> values) {
addCriterion("create_time in", values, "createTime");
return (Criteria) this;
}
public Criteria andCreateTimeNotIn(List<Date> values) {
addCriterion("create_time not in", values, "createTime");
return (Criteria) this;
}
public Criteria andCreateTimeBetween(Date value1, Date value2) {
addCriterion("create_time between", value1, value2, "createTime");
return (Criteria) this;
}
public Criteria andCreateTimeNotBetween(Date value1, Date value2) {
addCriterion("create_time not between", value1, value2, "createTime");
return (Criteria) this;
}
public Criteria andTypeIsNull() {
addCriterion("type is null");
return (Criteria) this;
}
public Criteria andTypeIsNotNull() {
addCriterion("type is not null");
return (Criteria) this;
}
public Criteria andTypeEqualTo(String value) {
addCriterion("type =", value, "type");
return (Criteria) this;
}
public Criteria andTypeNotEqualTo(String value) {
addCriterion("type <>", value, "type");
return (Criteria) this;
}
public Criteria andTypeGreaterThan(String value) {
addCriterion("type >", value, "type");
return (Criteria) this;
}
public Criteria andTypeGreaterThanOrEqualTo(String value) {
addCriterion("type >=", value, "type");
return (Criteria) this;
}
public Criteria andTypeLessThan(String value) {
addCriterion("type <", value, "type");
return (Criteria) this;
}
public Criteria andTypeLessThanOrEqualTo(String value) {
addCriterion("type <=", value, "type");
return (Criteria) this;
}
public Criteria andTypeLike(String value) {
addCriterion("type like", value, "type");
return (Criteria) this;
}
public Criteria andTypeNotLike(String value) {
addCriterion("type not like", value, "type");
return (Criteria) this;
}
public Criteria andTypeIn(List<String> values) {
addCriterion("type in", values, "type");
return (Criteria) this;
}
public Criteria andTypeNotIn(List<String> values) {
addCriterion("type not in", values, "type");
return (Criteria) this;
}
public Criteria andTypeBetween(String value1, String value2) {
addCriterion("type between", value1, value2, "type");
return (Criteria) this;
}
public Criteria andTypeNotBetween(String value1, String value2) {
addCriterion("type not between", value1, value2, "type");
return (Criteria) this;
}
public Criteria andStatusIsNull() {
addCriterion("status is null");
return (Criteria) this;
}
public Criteria andStatusIsNotNull() {
addCriterion("status is not null");
return (Criteria) this;
}
public Criteria andStatusEqualTo(String value) {
addCriterion("status =", value, "status");
return (Criteria) this;
}
public Criteria andStatusNotEqualTo(String value) {
addCriterion("status <>", value, "status");
return (Criteria) this;
}
public Criteria andStatusGreaterThan(String value) {
addCriterion("status >", value, "status");
return (Criteria) this;
}
public Criteria andStatusGreaterThanOrEqualTo(String value) {
addCriterion("status >=", value, "status");
return (Criteria) this;
}
public Criteria andStatusLessThan(String value) {
addCriterion("status <", value, "status");
return (Criteria) this;
}
public Criteria andStatusLessThanOrEqualTo(String value) {
addCriterion("status <=", value, "status");
return (Criteria) this;
}
public Criteria andStatusLike(String value) {
addCriterion("status like", value, "status");
return (Criteria) this;
}
public Criteria andStatusNotLike(String value) {
addCriterion("status not like", value, "status");
return (Criteria) this;
}
public Criteria andStatusIn(List<String> values) {
addCriterion("status in", values, "status");
return (Criteria) this;
}
public Criteria andStatusNotIn(List<String> values) {
addCriterion("status not in", values, "status");
return (Criteria) this;
}
public Criteria andStatusBetween(String value1, String value2) {
addCriterion("status between", value1, value2, "status");
return (Criteria) this;
}
public Criteria andStatusNotBetween(String value1, String value2) {
addCriterion("status not between", value1, value2, "status");
return (Criteria) this;
}
public Criteria andTenantIdIsNull() {
addCriterion("tenant_id is null");
return (Criteria) this;
}
public Criteria andTenantIdIsNotNull() {
addCriterion("tenant_id is not null");
return (Criteria) this;
}
public Criteria andTenantIdEqualTo(Long value) {
addCriterion("tenant_id =", value, "tenantId");
return (Criteria) this;
}
public Criteria andTenantIdNotEqualTo(Long value) {
addCriterion("tenant_id <>", value, "tenantId");
return (Criteria) this;
}
public Criteria andTenantIdGreaterThan(Long value) {
addCriterion("tenant_id >", value, "tenantId");
return (Criteria) this;
}
public Criteria andTenantIdGreaterThanOrEqualTo(Long value) {
addCriterion("tenant_id >=", value, "tenantId");
return (Criteria) this;
}
public Criteria andTenantIdLessThan(Long value) {
addCriterion("tenant_id <", value, "tenantId");
return (Criteria) this;
}
public Criteria andTenantIdLessThanOrEqualTo(Long value) {
addCriterion("tenant_id <=", value, "tenantId");
return (Criteria) this;
}
public Criteria andTenantIdIn(List<Long> values) {
addCriterion("tenant_id in", values, "tenantId");
return (Criteria) this;
}
public Criteria andTenantIdNotIn(List<Long> values) {
addCriterion("tenant_id not in", values, "tenantId");
return (Criteria) this;
}
public Criteria andTenantIdBetween(Long value1, Long value2) {
addCriterion("tenant_id between", value1, value2, "tenantId");
return (Criteria) this;
}
public Criteria andTenantIdNotBetween(Long value1, Long value2) {
addCriterion("tenant_id not between", value1, value2, "tenantId");
return (Criteria) this;
}
public Criteria andDeleteFlagIsNull() {
addCriterion("delete_Flag is null");
return (Criteria) this;
}
public Criteria andDeleteFlagIsNotNull() {
addCriterion("delete_Flag is not null");
return (Criteria) this;
}
public Criteria andDeleteFlagEqualTo(String value) {
addCriterion("delete_Flag =", value, "deleteFlag");
return (Criteria) this;
}
public Criteria andDeleteFlagNotEqualTo(String value) {
addCriterion("delete_Flag <>", value, "deleteFlag");
return (Criteria) this;
}
public Criteria andDeleteFlagGreaterThan(String value) {
addCriterion("delete_Flag >", value, "deleteFlag");
return (Criteria) this;
}
public Criteria andDeleteFlagGreaterThanOrEqualTo(String value) {
addCriterion("delete_Flag >=", value, "deleteFlag");
return (Criteria) this;
}
public Criteria andDeleteFlagLessThan(String value) {
addCriterion("delete_Flag <", value, "deleteFlag");
return (Criteria) this;
}
public Criteria andDeleteFlagLessThanOrEqualTo(String value) {
addCriterion("delete_Flag <=", value, "deleteFlag");
return (Criteria) this;
}
public Criteria andDeleteFlagLike(String value) {
addCriterion("delete_Flag like", value, "deleteFlag");
return (Criteria) this;
}
public Criteria andDeleteFlagNotLike(String value) {
addCriterion("delete_Flag not like", value, "deleteFlag");
return (Criteria) this;
}
public Criteria andDeleteFlagIn(List<String> values) {
addCriterion("delete_Flag in", values, "deleteFlag");
return (Criteria) this;
}
public Criteria andDeleteFlagNotIn(List<String> values) {
addCriterion("delete_Flag not in", values, "deleteFlag");
return (Criteria) this;
}
public Criteria andDeleteFlagBetween(String value1, String value2) {
addCriterion("delete_Flag between", value1, value2, "deleteFlag");
return (Criteria) this;
}
public Criteria andDeleteFlagNotBetween(String value1, String value2) {
addCriterion("delete_Flag not between", value1, value2, "deleteFlag");
return (Criteria) this;
}
}
/**
* This class was generated by MyBatis Generator.
* This class corresponds to the database table jsh_msg
*
* @mbggenerated do_not_delete_during_merge
*/
public static class Criteria extends GeneratedCriteria {
protected Criteria() {
super();
}
}
/**
* This class was generated by MyBatis Generator.
* This class corresponds to the database table jsh_msg
*
* @mbggenerated
*/
public static class Criterion {
private String condition;
private Object value;
private Object secondValue;
private boolean noValue;
private boolean singleValue;
private boolean betweenValue;
private boolean listValue;
private String typeHandler;
public String getCondition() {
return condition;
}
public Object getValue() {
return value;
}
public Object getSecondValue() {
return secondValue;
}
public boolean isNoValue() {
return noValue;
}
public boolean isSingleValue() {
return singleValue;
}
public boolean isBetweenValue() {
return betweenValue;
}
public boolean isListValue() {
return listValue;
}
public String getTypeHandler() {
return typeHandler;
}
protected Criterion(String condition) {
super();
this.condition = condition;
this.typeHandler = null;
this.noValue = true;
}
protected Criterion(String condition, Object value, String typeHandler) {
super();
this.condition = condition;
this.value = value;
this.typeHandler = typeHandler;
if (value instanceof List<?>) {
this.listValue = true;
} else {
this.singleValue = true;
}
}
protected Criterion(String condition, Object value) {
this(condition, value, null);
}
protected Criterion(String condition, Object value, Object secondValue, String typeHandler) {
super();
this.condition = condition;
this.value = value;
this.secondValue = secondValue;
this.typeHandler = typeHandler;
this.betweenValue = true;
}
protected Criterion(String condition, Object value, Object secondValue) {
this(condition, value, secondValue, null);
}
}
}

View File

@@ -183,4 +183,6 @@ public interface DepotItemMapperEx {
@Param("rows") Integer rows, @Param("pid") Integer pid);
int findStockWarningCountTotal( @Param("pid") Integer pid);
BigDecimal getFinishNumber(@Param("mid") Long mid, @Param("linkNumber") String linkNumber);
}

View File

@@ -0,0 +1,96 @@
package com.jsh.erp.datasource.mappers;
import com.jsh.erp.datasource.entities.Msg;
import com.jsh.erp.datasource.entities.MsgExample;
import java.util.List;
import org.apache.ibatis.annotations.Param;
public interface MsgMapper {
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table jsh_msg
*
* @mbggenerated
*/
int countByExample(MsgExample example);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table jsh_msg
*
* @mbggenerated
*/
int deleteByExample(MsgExample example);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table jsh_msg
*
* @mbggenerated
*/
int deleteByPrimaryKey(Long id);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table jsh_msg
*
* @mbggenerated
*/
int insert(Msg record);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table jsh_msg
*
* @mbggenerated
*/
int insertSelective(Msg record);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table jsh_msg
*
* @mbggenerated
*/
List<Msg> selectByExample(MsgExample example);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table jsh_msg
*
* @mbggenerated
*/
Msg selectByPrimaryKey(Long id);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table jsh_msg
*
* @mbggenerated
*/
int updateByExampleSelective(@Param("record") Msg record, @Param("example") MsgExample example);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table jsh_msg
*
* @mbggenerated
*/
int updateByExample(@Param("record") Msg record, @Param("example") MsgExample example);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table jsh_msg
*
* @mbggenerated
*/
int updateByPrimaryKeySelective(Msg record);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table jsh_msg
*
* @mbggenerated
*/
int updateByPrimaryKey(Msg record);
}

View File

@@ -0,0 +1,23 @@
package com.jsh.erp.datasource.mappers;
import com.jsh.erp.datasource.entities.Msg;
import org.apache.ibatis.annotations.Param;
import java.util.List;
public interface MsgMapperEx {
List<Msg> selectByConditionMsg(
@Param("name") String name,
@Param("offset") Integer offset,
@Param("rows") Integer rows);
Long countsByMsg(
@Param("name") String name);
int batchDeleteMsgByIds(@Param("ids") String ids[]);
int insertSelectiveByTask(Msg record);
int checkIsNameExistByTask(@Param("msgTitle") String msgTitle);
}

View File

@@ -28,6 +28,7 @@ import java.lang.annotation.*;
* organization-110
* orgaUserRel-115
* tenant-120
* msg-125
*/
@Target({ElementType.TYPE, ElementType.ANNOTATION_TYPE})
@Retention(RetentionPolicy.RUNTIME)

View File

@@ -735,4 +735,18 @@ public class DepotItemService {
}
return result;
}
/**
* 统计该商品已分批出库的总数量-用于订单
* @param mid
* @param headerId
* @return
*/
@Transactional(value = "transactionManager", rollbackFor = Exception.class)
public BigDecimal getFinishNumber(Long mid, Long headerId) {
DepotHead depotHead =depotHeadMapper.selectByPrimaryKey(headerId);
String linkNumber = depotHead.getLinknumber(); //关联单号
BigDecimal count = depotItemMapperEx.getFinishNumber(mid, linkNumber);
return count;
}
}

View File

@@ -0,0 +1,71 @@
package com.jsh.erp.service.msg;
import com.jsh.erp.service.ICommonQuery;
import com.jsh.erp.utils.Constants;
import com.jsh.erp.utils.QueryUtils;
import com.jsh.erp.utils.StringUtil;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import java.util.List;
import java.util.Map;
@Service(value = "msg_component")
@MsgResource
public class MsgComponent implements ICommonQuery {
@Resource
private MsgService msgService;
@Override
public Object selectOne(Long id) throws Exception {
return msgService.getMsg(id);
}
@Override
public List<?> select(Map<String, String> map)throws Exception {
return getMsgList(map);
}
private List<?> getMsgList(Map<String, String> map) throws Exception{
String search = map.get(Constants.SEARCH);
String name = StringUtil.getInfo(search, "name");
String order = QueryUtils.order(map);
String filter = QueryUtils.filter(map);
return msgService.select(name, QueryUtils.offset(map), QueryUtils.rows(map));
}
@Override
public Long counts(Map<String, String> map) throws Exception{
String search = map.get(Constants.SEARCH);
String name = StringUtil.getInfo(search, "name");
return msgService.countMsg(name);
}
@Override
public int insert(String beanJson, HttpServletRequest request)throws Exception {
return msgService.insertMsg(beanJson, request);
}
@Override
public int update(String beanJson, Long id)throws Exception {
return msgService.updateMsg(beanJson, id);
}
@Override
public int delete(Long id)throws Exception {
return msgService.deleteMsg(id);
}
@Override
public int batchDelete(String ids)throws Exception {
return msgService.batchDeleteMsg(ids);
}
@Override
public int checkIsNameExist(Long id, String name)throws Exception {
return msgService.checkIsNameExist(id, name);
}
}

View File

@@ -0,0 +1,15 @@
package com.jsh.erp.service.msg;
import com.jsh.erp.service.ResourceInfo;
import java.lang.annotation.*;
/**
* @author jishenghua qq752718920 2019-9-7 22:52:35
*/
@ResourceInfo(value = "msg", type = 125)
@Inherited
@Target(ElementType.TYPE)
@Retention(RetentionPolicy.RUNTIME)
public @interface MsgResource {
}

View File

@@ -0,0 +1,229 @@
package com.jsh.erp.service.msg;
import com.alibaba.fastjson.JSONObject;
import com.jsh.erp.constants.BusinessConstants;
import com.jsh.erp.constants.ExceptionConstants;
import com.jsh.erp.datasource.entities.Msg;
import com.jsh.erp.datasource.entities.MsgExample;
import com.jsh.erp.datasource.mappers.MsgMapper;
import com.jsh.erp.datasource.mappers.MsgMapperEx;
import com.jsh.erp.exception.BusinessRunTimeException;
import com.jsh.erp.service.depotHead.DepotHeadService;
import com.jsh.erp.service.log.LogService;
import com.jsh.erp.utils.StringUtil;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.context.request.RequestContextHolder;
import org.springframework.web.context.request.ServletRequestAttributes;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import java.util.List;
@Service
public class MsgService {
private Logger logger = LoggerFactory.getLogger(MsgService.class);
@Resource
private MsgMapper msgMapper;
@Resource
private MsgMapperEx msgMapperEx;
@Resource
private DepotHeadService depotHeadService;
@Resource
private LogService logService;
public Msg getMsg(long id)throws Exception {
Msg result=null;
try{
result=msgMapper.selectByPrimaryKey(id);
}catch(Exception e){
logger.error("异常码[{}],异常提示[{}],异常[{}]",
ExceptionConstants.DATA_READ_FAIL_CODE, ExceptionConstants.DATA_READ_FAIL_MSG,e);
throw new BusinessRunTimeException(ExceptionConstants.DATA_READ_FAIL_CODE,
ExceptionConstants.DATA_READ_FAIL_MSG);
}
return result;
}
public List<Msg> getMsg()throws Exception {
MsgExample example = new MsgExample();
example.createCriteria().andDeleteFlagNotEqualTo(BusinessConstants.DELETE_FLAG_DELETED);
List<Msg> list=null;
try{
list=msgMapper.selectByExample(example);
}catch(Exception e){
logger.error("异常码[{}],异常提示[{}],异常[{}]",
ExceptionConstants.DATA_READ_FAIL_CODE, ExceptionConstants.DATA_READ_FAIL_MSG,e);
throw new BusinessRunTimeException(ExceptionConstants.DATA_READ_FAIL_CODE,
ExceptionConstants.DATA_READ_FAIL_MSG);
}
return list;
}
public List<Msg> select(String name, int offset, int rows)throws Exception {
List<Msg> list=null;
try{
list=msgMapperEx.selectByConditionMsg(name, offset, rows);
}catch(Exception e){
logger.error("异常码[{}],异常提示[{}],异常[{}]",
ExceptionConstants.DATA_READ_FAIL_CODE, ExceptionConstants.DATA_READ_FAIL_MSG,e);
throw new BusinessRunTimeException(ExceptionConstants.DATA_READ_FAIL_CODE,
ExceptionConstants.DATA_READ_FAIL_MSG);
}
return list;
}
public Long countMsg(String name)throws Exception {
Long result=null;
try{
result=msgMapperEx.countsByMsg(name);
}catch(Exception e){
logger.error("异常码[{}],异常提示[{}],异常[{}]",
ExceptionConstants.DATA_READ_FAIL_CODE, ExceptionConstants.DATA_READ_FAIL_MSG,e);
throw new BusinessRunTimeException(ExceptionConstants.DATA_READ_FAIL_CODE,
ExceptionConstants.DATA_READ_FAIL_MSG);
}
return result;
}
@Transactional(value = "transactionManager", rollbackFor = Exception.class)
public int insertMsg(String beanJson, HttpServletRequest request)throws Exception {
Msg msg = JSONObject.parseObject(beanJson, Msg.class);
int result=0;
try{
result=msgMapper.insertSelective(msg);
}catch(Exception e){
logger.error("异常码[{}],异常提示[{}],异常[{}]",
ExceptionConstants.DATA_WRITE_FAIL_CODE, ExceptionConstants.DATA_WRITE_FAIL_MSG,e);
throw new BusinessRunTimeException(ExceptionConstants.DATA_WRITE_FAIL_CODE,
ExceptionConstants.DATA_WRITE_FAIL_MSG);
}
return result;
}
@Transactional(value = "transactionManager", rollbackFor = Exception.class)
public int updateMsg(String beanJson, Long id) throws Exception{
Msg msg = JSONObject.parseObject(beanJson, Msg.class);
msg.setId(id);
int result=0;
try{
result=msgMapper.updateByPrimaryKeySelective(msg);
}catch(Exception e){
logger.error("异常码[{}],异常提示[{}],异常[{}]",
ExceptionConstants.DATA_WRITE_FAIL_CODE, ExceptionConstants.DATA_WRITE_FAIL_MSG,e);
throw new BusinessRunTimeException(ExceptionConstants.DATA_WRITE_FAIL_CODE,
ExceptionConstants.DATA_WRITE_FAIL_MSG);
}
return result;
}
@Transactional(value = "transactionManager", rollbackFor = Exception.class)
public int deleteMsg(Long id)throws Exception {
int result=0;
try{
result=msgMapper.deleteByPrimaryKey(id);
}catch(Exception e){
logger.error("异常码[{}],异常提示[{}],异常[{}]",
ExceptionConstants.DATA_WRITE_FAIL_CODE, ExceptionConstants.DATA_WRITE_FAIL_MSG,e);
throw new BusinessRunTimeException(ExceptionConstants.DATA_WRITE_FAIL_CODE,
ExceptionConstants.DATA_WRITE_FAIL_MSG);
}
return result;
}
@Transactional(value = "transactionManager", rollbackFor = Exception.class)
public int batchDeleteMsg(String ids) throws Exception{
List<Long> idList = StringUtil.strToLongList(ids);
MsgExample example = new MsgExample();
example.createCriteria().andIdIn(idList);
int result=0;
try{
result=msgMapper.deleteByExample(example);
}catch(Exception e){
logger.error("异常码[{}],异常提示[{}],异常[{}]",
ExceptionConstants.DATA_WRITE_FAIL_CODE, ExceptionConstants.DATA_WRITE_FAIL_MSG,e);
throw new BusinessRunTimeException(ExceptionConstants.DATA_WRITE_FAIL_CODE,
ExceptionConstants.DATA_WRITE_FAIL_MSG);
}
return result;
}
public int checkIsNameExist(Long id, String name)throws Exception {
MsgExample example = new MsgExample();
example.createCriteria().andIdNotEqualTo(id).andMsgTitleEqualTo(name).andDeleteFlagNotEqualTo(BusinessConstants.DELETE_FLAG_DELETED);
List<Msg> list=null;
try{
list= msgMapper.selectByExample(example);
}catch(Exception e){
logger.error("异常码[{}],异常提示[{}],异常[{}]",
ExceptionConstants.DATA_READ_FAIL_CODE, ExceptionConstants.DATA_READ_FAIL_MSG,e);
throw new BusinessRunTimeException(ExceptionConstants.DATA_READ_FAIL_CODE,
ExceptionConstants.DATA_READ_FAIL_MSG);
}
return list==null?0:list.size();
}
/**
* create by: qiankunpingtai
* websitehttps://qiankunpingtai.cn
* description:
* 逻辑删除角色信息
* create time: 2019/3/28 15:44
* @Param: ids
* @return int
*/
@Transactional(value = "transactionManager", rollbackFor = Exception.class)
public int batchDeleteMsgByIds(String ids) throws Exception{
logService.insertLog(BusinessConstants.LOG_INTERFACE_NAME_SERIAL_NUMBER,
new StringBuffer(BusinessConstants.LOG_OPERATION_TYPE_DELETE).append(ids).toString(),
((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest());
String [] idArray=ids.split(",");
int result=0;
try{
result=msgMapperEx.batchDeleteMsgByIds(idArray);
}catch(Exception e){
logger.error("异常码[{}],异常提示[{}],异常[{}]",
ExceptionConstants.DATA_WRITE_FAIL_CODE, ExceptionConstants.DATA_WRITE_FAIL_MSG,e);
throw new BusinessRunTimeException(ExceptionConstants.DATA_WRITE_FAIL_CODE,
ExceptionConstants.DATA_WRITE_FAIL_MSG);
}
return result;
}
public List<Msg> getMsgByStatus(String status)throws Exception {
MsgExample example = new MsgExample();
example.createCriteria().andStatusEqualTo(status).andDeleteFlagNotEqualTo(BusinessConstants.DELETE_FLAG_DELETED);
List<Msg> list=null;
try{
list=msgMapper.selectByExample(example);
}catch(Exception e){
logger.error("异常码[{}],异常提示[{}],异常[{}]",
ExceptionConstants.DATA_READ_FAIL_CODE, ExceptionConstants.DATA_READ_FAIL_MSG,e);
throw new BusinessRunTimeException(ExceptionConstants.DATA_READ_FAIL_CODE,
ExceptionConstants.DATA_READ_FAIL_MSG);
}
return list;
}
@Transactional(value = "transactionManager", rollbackFor = Exception.class)
public void batchUpdateStatus(String ids, String status) throws Exception{
List<Long> idList = StringUtil.strToLongList(ids);
Msg msg = new Msg();
msg.setStatus(status);
MsgExample example = new MsgExample();
example.createCriteria().andIdIn(idList);
try{
msgMapper.updateByExampleSelective(msg, example);
}catch(Exception e){
logger.error("异常码[{}],异常提示[{}],异常[{}]",
ExceptionConstants.DATA_WRITE_FAIL_CODE, ExceptionConstants.DATA_WRITE_FAIL_MSG,e);
throw new BusinessRunTimeException(ExceptionConstants.DATA_WRITE_FAIL_CODE,
ExceptionConstants.DATA_WRITE_FAIL_MSG);
}
}
}

View File

@@ -550,4 +550,9 @@
AND intype.BasicInNumber > 0
</select>
<select id="getFinishNumber" resultType="java.math.BigDecimal">
select sum(BasicNumber) from jsh_depotitem
where MaterialId=${mid} and headerId
in (select id from jsh_depothead where LinkNumber='${linkNumber}')
</select>
</mapper>

View File

@@ -16,6 +16,7 @@
<result column="Enabled" jdbcType="BIT" property="enabled" />
<result column="Type" jdbcType="VARCHAR" property="type" />
<result column="PushBtn" jdbcType="VARCHAR" property="pushbtn" />
<result column="icon" jdbcType="VARCHAR" property="icon" />
<result column="delete_Flag" jdbcType="VARCHAR" property="deleteFlag" />
</resultMap>
<sql id="Example_Where_Clause">
@@ -89,7 +90,7 @@
WARNING - @mbggenerated
This element is automatically generated by MyBatis Generator, do not modify.
-->
Id, Number, Name, PNumber, URL, State, Sort, Enabled, Type, PushBtn, delete_Flag
Id, Number, Name, PNumber, URL, State, Sort, Enabled, Type, PushBtn, icon, delete_Flag
</sql>
<select id="selectByExample" parameterType="com.jsh.erp.datasource.entities.FunctionsExample" resultMap="BaseResultMap">
<!--
@@ -145,11 +146,11 @@
insert into jsh_functions (Id, Number, Name,
PNumber, URL, State, Sort,
Enabled, Type, PushBtn,
delete_Flag)
icon, delete_Flag)
values (#{id,jdbcType=BIGINT}, #{number,jdbcType=VARCHAR}, #{name,jdbcType=VARCHAR},
#{pnumber,jdbcType=VARCHAR}, #{url,jdbcType=VARCHAR}, #{state,jdbcType=BIT}, #{sort,jdbcType=VARCHAR},
#{enabled,jdbcType=BIT}, #{type,jdbcType=VARCHAR}, #{pushbtn,jdbcType=VARCHAR},
#{deleteFlag,jdbcType=VARCHAR})
#{icon,jdbcType=VARCHAR}, #{deleteFlag,jdbcType=VARCHAR})
</insert>
<insert id="insertSelective" parameterType="com.jsh.erp.datasource.entities.Functions">
<!--
@@ -188,6 +189,9 @@
<if test="pushbtn != null">
PushBtn,
</if>
<if test="icon != null">
icon,
</if>
<if test="deleteFlag != null">
delete_Flag,
</if>
@@ -223,6 +227,9 @@
<if test="pushbtn != null">
#{pushbtn,jdbcType=VARCHAR},
</if>
<if test="icon != null">
#{icon,jdbcType=VARCHAR},
</if>
<if test="deleteFlag != null">
#{deleteFlag,jdbcType=VARCHAR},
</if>
@@ -275,6 +282,9 @@
<if test="record.pushbtn != null">
PushBtn = #{record.pushbtn,jdbcType=VARCHAR},
</if>
<if test="record.icon != null">
icon = #{record.icon,jdbcType=VARCHAR},
</if>
<if test="record.deleteFlag != null">
delete_Flag = #{record.deleteFlag,jdbcType=VARCHAR},
</if>
@@ -299,6 +309,7 @@
Enabled = #{record.enabled,jdbcType=BIT},
Type = #{record.type,jdbcType=VARCHAR},
PushBtn = #{record.pushbtn,jdbcType=VARCHAR},
icon = #{record.icon,jdbcType=VARCHAR},
delete_Flag = #{record.deleteFlag,jdbcType=VARCHAR}
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
@@ -338,6 +349,9 @@
<if test="pushbtn != null">
PushBtn = #{pushbtn,jdbcType=VARCHAR},
</if>
<if test="icon != null">
icon = #{icon,jdbcType=VARCHAR},
</if>
<if test="deleteFlag != null">
delete_Flag = #{deleteFlag,jdbcType=VARCHAR},
</if>
@@ -359,6 +373,7 @@
Enabled = #{enabled,jdbcType=BIT},
Type = #{type,jdbcType=VARCHAR},
PushBtn = #{pushbtn,jdbcType=VARCHAR},
icon = #{icon,jdbcType=VARCHAR},
delete_Flag = #{deleteFlag,jdbcType=VARCHAR}
where Id = #{id,jdbcType=BIGINT}
</update>

View File

@@ -0,0 +1,318 @@
<?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" >
<mapper namespace="com.jsh.erp.datasource.mappers.MsgMapper" >
<resultMap id="BaseResultMap" type="com.jsh.erp.datasource.entities.Msg" >
<!--
WARNING - @mbggenerated
This element is automatically generated by MyBatis Generator, do not modify.
-->
<id column="id" property="id" jdbcType="BIGINT" />
<result column="msg_title" property="msgTitle" jdbcType="VARCHAR" />
<result column="msg_content" property="msgContent" jdbcType="VARCHAR" />
<result column="create_time" property="createTime" jdbcType="TIMESTAMP" />
<result column="type" property="type" jdbcType="VARCHAR" />
<result column="status" property="status" jdbcType="VARCHAR" />
<result column="tenant_id" property="tenantId" jdbcType="BIGINT" />
<result column="delete_Flag" property="deleteFlag" jdbcType="VARCHAR" />
</resultMap>
<sql id="Example_Where_Clause" >
<!--
WARNING - @mbggenerated
This element is automatically generated by MyBatis Generator, do not modify.
-->
<where >
<foreach collection="oredCriteria" item="criteria" separator="or" >
<if test="criteria.valid" >
<trim prefix="(" suffix=")" prefixOverrides="and" >
<foreach collection="criteria.criteria" item="criterion" >
<choose >
<when test="criterion.noValue" >
and ${criterion.condition}
</when>
<when test="criterion.singleValue" >
and ${criterion.condition} #{criterion.value}
</when>
<when test="criterion.betweenValue" >
and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
</when>
<when test="criterion.listValue" >
and ${criterion.condition}
<foreach collection="criterion.value" item="listItem" open="(" close=")" separator="," >
#{listItem}
</foreach>
</when>
</choose>
</foreach>
</trim>
</if>
</foreach>
</where>
</sql>
<sql id="Update_By_Example_Where_Clause" >
<!--
WARNING - @mbggenerated
This element is automatically generated by MyBatis Generator, do not modify.
-->
<where >
<foreach collection="example.oredCriteria" item="criteria" separator="or" >
<if test="criteria.valid" >
<trim prefix="(" suffix=")" prefixOverrides="and" >
<foreach collection="criteria.criteria" item="criterion" >
<choose >
<when test="criterion.noValue" >
and ${criterion.condition}
</when>
<when test="criterion.singleValue" >
and ${criterion.condition} #{criterion.value}
</when>
<when test="criterion.betweenValue" >
and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
</when>
<when test="criterion.listValue" >
and ${criterion.condition}
<foreach collection="criterion.value" item="listItem" open="(" close=")" separator="," >
#{listItem}
</foreach>
</when>
</choose>
</foreach>
</trim>
</if>
</foreach>
</where>
</sql>
<sql id="Base_Column_List" >
<!--
WARNING - @mbggenerated
This element is automatically generated by MyBatis Generator, do not modify.
-->
id, msg_title, msg_content, create_time, type, status, tenant_id, delete_Flag
</sql>
<select id="selectByExample" resultMap="BaseResultMap" parameterType="com.jsh.erp.datasource.entities.MsgExample" >
<!--
WARNING - @mbggenerated
This element is automatically generated by MyBatis Generator, do not modify.
-->
select
<if test="distinct" >
distinct
</if>
<include refid="Base_Column_List" />
from jsh_msg
<if test="_parameter != null" >
<include refid="Example_Where_Clause" />
</if>
<if test="orderByClause != null" >
order by ${orderByClause}
</if>
</select>
<select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Long" >
<!--
WARNING - @mbggenerated
This element is automatically generated by MyBatis Generator, do not modify.
-->
select
<include refid="Base_Column_List" />
from jsh_msg
where id = #{id,jdbcType=BIGINT}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.Long" >
<!--
WARNING - @mbggenerated
This element is automatically generated by MyBatis Generator, do not modify.
-->
delete from jsh_msg
where id = #{id,jdbcType=BIGINT}
</delete>
<delete id="deleteByExample" parameterType="com.jsh.erp.datasource.entities.MsgExample" >
<!--
WARNING - @mbggenerated
This element is automatically generated by MyBatis Generator, do not modify.
-->
delete from jsh_msg
<if test="_parameter != null" >
<include refid="Example_Where_Clause" />
</if>
</delete>
<insert id="insert" parameterType="com.jsh.erp.datasource.entities.Msg" >
<!--
WARNING - @mbggenerated
This element is automatically generated by MyBatis Generator, do not modify.
-->
insert into jsh_msg (id, msg_title, msg_content,
create_time, type, status,
tenant_id, delete_Flag)
values (#{id,jdbcType=BIGINT}, #{msgTitle,jdbcType=VARCHAR}, #{msgContent,jdbcType=VARCHAR},
#{createTime,jdbcType=TIMESTAMP}, #{type,jdbcType=VARCHAR}, #{status,jdbcType=VARCHAR},
#{tenantId,jdbcType=BIGINT}, #{deleteFlag,jdbcType=VARCHAR})
</insert>
<insert id="insertSelective" parameterType="com.jsh.erp.datasource.entities.Msg" >
<!--
WARNING - @mbggenerated
This element is automatically generated by MyBatis Generator, do not modify.
-->
insert into jsh_msg
<trim prefix="(" suffix=")" suffixOverrides="," >
<if test="id != null" >
id,
</if>
<if test="msgTitle != null" >
msg_title,
</if>
<if test="msgContent != null" >
msg_content,
</if>
<if test="createTime != null" >
create_time,
</if>
<if test="type != null" >
type,
</if>
<if test="status != null" >
status,
</if>
<if test="tenantId != null" >
tenant_id,
</if>
<if test="deleteFlag != null" >
delete_Flag,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides="," >
<if test="id != null" >
#{id,jdbcType=BIGINT},
</if>
<if test="msgTitle != null" >
#{msgTitle,jdbcType=VARCHAR},
</if>
<if test="msgContent != null" >
#{msgContent,jdbcType=VARCHAR},
</if>
<if test="createTime != null" >
#{createTime,jdbcType=TIMESTAMP},
</if>
<if test="type != null" >
#{type,jdbcType=VARCHAR},
</if>
<if test="status != null" >
#{status,jdbcType=VARCHAR},
</if>
<if test="tenantId != null" >
#{tenantId,jdbcType=BIGINT},
</if>
<if test="deleteFlag != null" >
#{deleteFlag,jdbcType=VARCHAR},
</if>
</trim>
</insert>
<select id="countByExample" parameterType="com.jsh.erp.datasource.entities.MsgExample" resultType="java.lang.Integer" >
<!--
WARNING - @mbggenerated
This element is automatically generated by MyBatis Generator, do not modify.
-->
select count(*) from jsh_msg
<if test="_parameter != null" >
<include refid="Example_Where_Clause" />
</if>
</select>
<update id="updateByExampleSelective" parameterType="map" >
<!--
WARNING - @mbggenerated
This element is automatically generated by MyBatis Generator, do not modify.
-->
update jsh_msg
<set >
<if test="record.id != null" >
id = #{record.id,jdbcType=BIGINT},
</if>
<if test="record.msgTitle != null" >
msg_title = #{record.msgTitle,jdbcType=VARCHAR},
</if>
<if test="record.msgContent != null" >
msg_content = #{record.msgContent,jdbcType=VARCHAR},
</if>
<if test="record.createTime != null" >
create_time = #{record.createTime,jdbcType=TIMESTAMP},
</if>
<if test="record.type != null" >
type = #{record.type,jdbcType=VARCHAR},
</if>
<if test="record.status != null" >
status = #{record.status,jdbcType=VARCHAR},
</if>
<if test="record.tenantId != null" >
tenant_id = #{record.tenantId,jdbcType=BIGINT},
</if>
<if test="record.deleteFlag != null" >
delete_Flag = #{record.deleteFlag,jdbcType=VARCHAR},
</if>
</set>
<if test="_parameter != null" >
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
<update id="updateByExample" parameterType="map" >
<!--
WARNING - @mbggenerated
This element is automatically generated by MyBatis Generator, do not modify.
-->
update jsh_msg
set id = #{record.id,jdbcType=BIGINT},
msg_title = #{record.msgTitle,jdbcType=VARCHAR},
msg_content = #{record.msgContent,jdbcType=VARCHAR},
create_time = #{record.createTime,jdbcType=TIMESTAMP},
type = #{record.type,jdbcType=VARCHAR},
status = #{record.status,jdbcType=VARCHAR},
tenant_id = #{record.tenantId,jdbcType=BIGINT},
delete_Flag = #{record.deleteFlag,jdbcType=VARCHAR}
<if test="_parameter != null" >
<include refid="Update_By_Example_Where_Clause" />
</if>
</update>
<update id="updateByPrimaryKeySelective" parameterType="com.jsh.erp.datasource.entities.Msg" >
<!--
WARNING - @mbggenerated
This element is automatically generated by MyBatis Generator, do not modify.
-->
update jsh_msg
<set >
<if test="msgTitle != null" >
msg_title = #{msgTitle,jdbcType=VARCHAR},
</if>
<if test="msgContent != null" >
msg_content = #{msgContent,jdbcType=VARCHAR},
</if>
<if test="createTime != null" >
create_time = #{createTime,jdbcType=TIMESTAMP},
</if>
<if test="type != null" >
type = #{type,jdbcType=VARCHAR},
</if>
<if test="status != null" >
status = #{status,jdbcType=VARCHAR},
</if>
<if test="tenantId != null" >
tenant_id = #{tenantId,jdbcType=BIGINT},
</if>
<if test="deleteFlag != null" >
delete_Flag = #{deleteFlag,jdbcType=VARCHAR},
</if>
</set>
where id = #{id,jdbcType=BIGINT}
</update>
<update id="updateByPrimaryKey" parameterType="com.jsh.erp.datasource.entities.Msg" >
<!--
WARNING - @mbggenerated
This element is automatically generated by MyBatis Generator, do not modify.
-->
update jsh_msg
set msg_title = #{msgTitle,jdbcType=VARCHAR},
msg_content = #{msgContent,jdbcType=VARCHAR},
create_time = #{createTime,jdbcType=TIMESTAMP},
type = #{type,jdbcType=VARCHAR},
status = #{status,jdbcType=VARCHAR},
tenant_id = #{tenantId,jdbcType=BIGINT},
delete_Flag = #{deleteFlag,jdbcType=VARCHAR}
where id = #{id,jdbcType=BIGINT}
</update>
</mapper>

View File

@@ -0,0 +1,60 @@
<?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">
<mapper namespace="com.jsh.erp.datasource.mappers.MsgMapperEx">
<select id="selectByConditionMsg" resultMap="com.jsh.erp.datasource.mappers.MsgMapper.BaseResultMap">
SELECT *
FROM jsh_msg
WHERE 1=1
and ifnull(delete_Flag,'0') !='1'
<if test="name != null">
and msg_title like '%${name}%'
</if>
order by create_time desc
<if test="offset != null and rows != null">
limit #{offset},#{rows}
</if>;
</select>
<select id="countsByMsg" resultType="java.lang.Long">
SELECT
COUNT(id)
FROM jsh_msg
WHERE 1=1
and ifnull(delete_Flag,'0') !='1'
<if test="name != null">
and msg_title like '%${name}%'
</if>
</select>
<update id="batchDeleteMsgByIds">
update jsh_msg
set delete_Flag='1'
where 1=1
and id in (
<foreach collection="ids" item="id" separator=",">
#{id}
</foreach>
)
</update>
<insert id="insertSelectiveByTask" parameterType="com.jsh.erp.datasource.entities.Msg">
insert into jsh_msg(msg_title,msg_content,create_time,type,status,tenant_id)
values (
#{msgTitle,jdbcType=VARCHAR},
#{msgContent,jdbcType=VARCHAR},
#{createTime,jdbcType=TIMESTAMP},
#{type,jdbcType=VARCHAR},
#{status,jdbcType=VARCHAR},
#{tenantId,jdbcType=BIGINT}
)
</insert>
<select id="checkIsNameExistByTask" resultType="java.lang.Integer">
SELECT
COUNT(id)
FROM jsh_msg
WHERE 1=1
and ifnull(delete_Flag,'0') !='1'
<if test="msgTitle != null">
and msg_title = '${msgTitle}'
</if>
</select>
</mapper>

View File

@@ -0,0 +1,30 @@
package com.jsh.erp;
import com.alibaba.fastjson.JSON;
import com.jsh.erp.datasource.entities.Depot;
import com.jsh.erp.service.depot.DepotService;
import com.jsh.erp.service.depotItem.DepotItemService;
import lombok.extern.slf4j.Slf4j;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.junit4.SpringRunner;
import javax.annotation.Resource;
import java.math.BigDecimal;
import java.util.List;
@Slf4j
@RunWith(SpringRunner.class)
@SpringBootTest
public class DepotItemTest {
@Resource
private DepotItemService depotItemService;
@Test
public void getFinishNumber() throws Exception{
BigDecimal num = depotItemService.getFinishNumber(568l,238l);
log.info("depot result:" + JSON.toJSONString(num));
}
}

View File

@@ -64,6 +64,7 @@
<table tableName="jsh_serial_number" domainObjectName="SerialNumber"></table>
<table tableName="jsh_organization" domainObjectName="Organization"></table>
<table tableName="jsh_orga_user_rel" domainObjectName="OrgaUserRel"></table>
<table tableName="jsh_tenant" domainObjectName="Tenant"></table> -->
<table tableName="jsh_tenant" domainObjectName="Tenant"></table>
<table tableName="jsh_msg" domainObjectName="Msg"></table> -->
</context>
</generatorConfiguration>