Commit 2539f768 authored by 季圣华's avatar 季圣华
Browse files

!20 添加新增序列号功能

Merge pull request !20 from 乾坤平台/master
parents dd6f7d8a e5262b09
This diff is collapsed.
......@@ -90,6 +90,16 @@
</td>
<td></td>
</tr>
<tr>
<td style="width:80px;">序列号</td>
<td style="padding:5px;width:180px;">
<select name="enableSerialNumber" id="enableSerialNumber" style="width:152px;height: 20px">
<option value="1">启用</option>
<option value="0">禁用</option>
</select>
</td>
<td></td>
</tr>
<tr>
<td style="height:30px;">备注</td>
<td style="padding:5px" colspan="3">
......@@ -611,7 +621,7 @@
+ 'AaBb' + rec.lowprice + 'AaBb' + rec.presetpriceone + 'AaBb' + rec.presetpricetwo + 'AaBb' + rec.remark + 'AaBb' + rec.standard
+ 'AaBb' + rec.color + 'AaBb' + rec.packing + 'AaBb' + rec.safetystock + 'AaBb' + rec.categoryid + 'AaBb' + rec.categoryName
+ 'AaBb' + rec.unitid + 'AaBb' + rec.unitName + 'AaBb' + rec.firstoutunit + 'AaBb' + rec.firstinunit
+ 'AaBb' + rec.mfrs + 'AaBb' + rec.otherfield1 + 'AaBb' + rec.otherfield2 + 'AaBb' + rec.otherfield3;
+ 'AaBb' + rec.mfrs + 'AaBb' + rec.otherfield1 + 'AaBb' + rec.otherfield2 + 'AaBb' + rec.otherfield3+ 'AaBb' + rec.enableSerialNumber;
str += '<img title="编辑" src="/js/easyui-1.3.5/themes/icons/pencil.png" style="cursor: pointer;" onclick="editMaterial(\'' + rowInfo + '\');"/>&nbsp;&nbsp;&nbsp;';
str += '<img title="删除" src="/js/easyui-1.3.5/themes/icons/edit_remove.png" style="cursor: pointer;" onclick="deleteMaterial(' + rec.id + ');"/>';
return str;
......@@ -671,6 +681,11 @@
title: '状态', field: 'enabled', width: 50, align: "center", formatter: function (value) {
return value ? "启用" : "禁用";
}
},
{
title: '序列号', field: 'enableSerialNumber', width: 70, align: "center", formatter: function (value) {
return value ? "启用" : "禁用";
}
}
]],
toolbar: [
......@@ -1145,6 +1160,8 @@
$('#materialFM input').val(""); //将输入框全部清空
bindMProperty(); //根据商品属性绑定
// $("#enableSerialNumber").combobox('setValue','0');
$("#enableSerialNumber").val('0');
$('#materialDlg').dialog('open').dialog('setTitle', '<img src="/js/easyui-1.3.5/themes/icons/edit_add.png"/>&nbsp;增加商品信息');
$(".window-mask").css({width: webW, height: webH});
......@@ -1271,11 +1288,13 @@
basicList.LowPrice = $("#basicLowPrice").val();
basicList.PresetPriceOne = $("#basicPresetPriceOne").val();
basicList.PresetPriceTwo = $("#basicPresetPriceTwo").val();
basicList.enableSerialNumber=$("#enableSerialNumber").val();
otherList.Unit = $("#otherUnit").text();
otherList.RetailPrice = $("#otherRetailPrice").val();
otherList.LowPrice = $("#otherLowPrice").val();
otherList.PresetPriceOne = $("#otherPresetPriceOne").val();
otherList.PresetPriceTwo = $("#otherPresetPriceTwo").val();
var basic = {};
var other = {};
basic.basic = basicList;
......@@ -1341,6 +1360,11 @@
$("#Name").focus().val(materialInfo[1]);
$("#Color").focus().val(materialInfo[11]);
// console.log("enableSerialNumber:"+(materialInfo[24]=='true'?'1':'0'));
// console.log("enableSerialNumber:"+materialInfo[24]);
// $("#enableSerialNumber").combobox('setValue',materialInfo[24]=='true'?'1':'0');
$("#enableSerialNumber").val(materialInfo[24]=='true'?'1':'0');
// console.log($("#enableSerialNumber").val());
var categoryName = ""; //类型名称
mId = materialInfo[14];
......
......@@ -101,6 +101,12 @@
<artifactId>jxl</artifactId>
<version>2.6.3</version>
</dependency>
<!-- lombok -->
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<version>1.16.12</version>
</dependency>
</dependencies>
<repositories>
......
......@@ -5179,3 +5179,23 @@ INSERT INTO `jsh_userbusiness` VALUES ('24', 'UserDepot', '65', '[1]', null);
INSERT INTO `jsh_userbusiness` VALUES ('25', 'UserCustomer', '64', '[5][2]', null);
INSERT INTO `jsh_userbusiness` VALUES ('26', 'UserCustomer', '65', '[6]', null);
INSERT INTO `jsh_userbusiness` VALUES ('27', 'UserCustomer', '63', '[5][2]', null);
--添加序列号表
DROP TABLE IF EXISTS `jsh_serial_number`;
CREATE TABLE `jsh_serial_number` (
`id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键',
`material_Id` bigint(20) DEFAULT NULL COMMENT '产品表id',
`serial_Number` varchar(64) DEFAULT NULL COMMENT '序列号',
`is_Sell` bit(1) DEFAULT 0 COMMENT '是否卖出,0未卖出,1卖出',
`remark` varchar(1024) DEFAULT NULL COMMENT '备注',
`delete_Flag` bit(1) DEFAULT 0 COMMENT '删除标记,0未删除,1删除',
`create_Time` datetime DEFAULT NULL COMMENT '创建时间',
`creator` bigint(20) DEFAULT NULL COMMENT '创建人',
`update_Time` datetime DEFAULT NULL COMMENT '更新时间',
`updater` bigint(20) DEFAULT NULL COMMENT '更新人',
PRIMARY KEY (`Id`)
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8 COMMENT='序列号表';
--产品表新增字段是否启用序列号
alter table jsh_material add enableSerialNumber bit(1) DEFAULT 0 COMMENT '是否开启序列号,0否,1是';
package com.jsh.erp;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.autoconfigure.web.servlet.DispatcherServletAutoConfiguration;
import org.springframework.context.annotation.Bean;
import org.springframework.scheduling.annotation.EnableScheduling;
import org.springframework.web.servlet.DispatcherServlet;
@SpringBootApplication
@MapperScan(basePackages = {"com.jsh.erp.datasource.mappers"})
......@@ -15,4 +19,5 @@ public class ErpApplication{
}
package com.jsh.erp.constants;
/**
* @ClassName:BusinessConstants
* @Description 业务字典类
* @Author linshengming
* @Date 2018-9-15 17:58
* @Version 1.0
**/
public class BusinessConstants {
/**
* 默认的日期格式
*/
public static final String DEFAULT_DATETIME_FORMAT = "yyyy-MM-dd HH:mm:ss";
/**
* 默认的分页起始页页码
*/
public static final String DEFAULT_PAGINATION_PAGE_NUMBER = "1";
/**
* 默认的分页页数
*/
public static final String DEFAULT_PAGINATION_PAGE_SIZE = "10";
}
package com.jsh.erp.constants;
import com.alibaba.fastjson.JSONObject;
public class ExceptionConstants {
/**
* code 格式 type+五位数字,例如3500000
* ResourceInfo(value = "inOutItem", type = 35)
*
* */
public static final String GLOBAL_RETURNS_CODE = "code";
public static final String GLOBAL_RETURNS_MESSAGE = "msg";
public static final String GLOBAL_RETURNS_DATA = "data";
/**
* 正常返回/操作成功
**/
public static final int SERVICE_SUCCESS_CODE = 200;
public static final String SERVICE_SUCCESS_MSG = "操作成功";
/**
* 系统运行时未知错误
**/
public static final int SERVICE_SYSTEM_ERROR_CODE = 500;
public static final String SERVICE_SYSTEM_ERROR_MSG = "未知异常";
/**
* 序列号
* type = 105
* */
/**序列号已存在*/
public static final int SERIAL_NUMBERE_ALREADY_EXISTS_CODE = 10500000;
public static final String SERIAL_NUMBERE_ALREADY_EXISTS_MSG = "序列号已存在";
/**序列号不能为为空*/
public static final int SERIAL_NUMBERE_NOT_BE_EMPTY_CODE = 10500000;
public static final String SERIAL_NUMBERE_NOT_BE_EMPTY_MSG = "序列号不能为为空";
/**
* 商品信息
* type = 80
* */
//商品信息不存在
public static final int MATERIAL_NOT_EXISTS_CODE = 8000000;
public static final String MATERIAL_NOT_EXISTS__MSG = "商品信息不存在";
//商品信息不唯一
public static final int MATERIAL_NOT_ONLY_CODE = 8000001;
public static final String MATERIAL_NOT_ONLY__MSG = "商品信息不唯一";
/**
* 标准正常返回/操作成功返回
* @return
*/
public static JSONObject standardSuccess () {
JSONObject success = new JSONObject();
success.put(GLOBAL_RETURNS_CODE, SERVICE_SUCCESS_CODE);
success.put(GLOBAL_RETURNS_MESSAGE, SERVICE_SUCCESS_MSG);
return success;
}
}
package com.jsh.erp.controller;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.jsh.erp.constants.ExceptionConstants;
import com.jsh.erp.datasource.entities.SerialNumberEx;
import com.jsh.erp.exception.BusinessParamCheckingException;
import com.jsh.erp.service.serialNumber.SerialNumberService;
import com.jsh.erp.utils.StringUtil;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
/**
* Description
*
* @Author: cjl
* @Date: 2019/1/22 10:29
*/
@RestController
public class SerialNumberController {
private Logger logger = LoggerFactory.getLogger(SerialNumberController.class);
@Resource
private SerialNumberService serialNumberService;
/**
* create by: cjl
* description:
* 检查序列号是否存在
* create time: 2019/1/22 11:02
* @Param: id
 * @Param: materialName
 * @Param: serialNumber
 * @Param: request
* @return java.lang.Object
*/
@PostMapping("/serialNumber/checkIsExist")
@ResponseBody
public Object checkIsExist(@RequestParam("id") Long id, @RequestParam("materialName") String materialName,
@RequestParam("serialNumber") String serialNumber, HttpServletRequest request) throws Exception{
JSONObject result = ExceptionConstants.standardSuccess();
if(StringUtil.isEmpty(serialNumber)){
throw new BusinessParamCheckingException(ExceptionConstants.SERIAL_NUMBERE_NOT_BE_EMPTY_CODE,
ExceptionConstants.SERIAL_NUMBERE_NOT_BE_EMPTY_MSG);
}
serialNumberService.checkIsExist(id, materialName, serialNumber);
return result;
}
/**
* create by: cjl
* description:
* 新增序列号信息
* create time: 2019/1/22 17:10
* @Param: beanJson
 * @Param: request
* @return java.lang.Object
*/
@PostMapping("/serialNumber/addSerialNumber")
@ResponseBody
public Object addSerialNumber(@RequestParam("info") String beanJson){
JSONObject result = ExceptionConstants.standardSuccess();
SerialNumberEx sne= JSON.parseObject(beanJson, SerialNumberEx.class);
serialNumberService.addSerialNumber(sne);
return result;
}
/**
* create by: cjl
* description:
* 修改序列号信息
* create time: 2019/1/23 13:56
* @Param: beanJson
* @return java.lang.Object
*/
@PostMapping("/serialNumber/updateSerialNumber")
@ResponseBody
public Object updateSerialNumber(@RequestParam("info") String beanJson){
JSONObject result = ExceptionConstants.standardSuccess();
SerialNumberEx sne= JSON.parseObject(beanJson, SerialNumberEx.class);
serialNumberService.updateSerialNumber(sne);
return result;
}
}
......@@ -186,6 +186,11 @@ public class Material {
* @mbggenerated
*/
private String otherfield3;
/**
* 2019-01-21新增字段enableSerialNumber
*是否开启序列号
* */
private Boolean enableSerialNumber;
/**
* This method was generated by MyBatis Generator.
......@@ -738,4 +743,12 @@ public class Material {
public void setOtherfield3(String otherfield3) {
this.otherfield3 = otherfield3 == null ? null : otherfield3.trim();
}
public Boolean getEnableSerialNumber() {
return enableSerialNumber;
}
public void setEnableSerialNumber(Boolean enableSerialNumber) {
this.enableSerialNumber = enableSerialNumber;
}
}
\ No newline at end of file
......@@ -55,6 +55,11 @@ public class MaterialVo4Unit {
private String categoryName;
private String materialOther;
/**
* 2019-01-21新增字段enableSerialNumber
*是否开启序列号
* */
private Boolean enableSerialNumber;
public Long getId() {
return id;
......@@ -263,4 +268,12 @@ public class MaterialVo4Unit {
public void setMaterialOther(String materialOther) {
this.materialOther = materialOther;
}
public Boolean getEnableSerialNumber() {
return enableSerialNumber;
}
public void setEnableSerialNumber(Boolean enableSerialNumber) {
this.enableSerialNumber = enableSerialNumber;
}
}
\ No newline at end of file
package com.jsh.erp.datasource.entities;
import java.util.Date;
public class SerialNumber {
/**
* This field was generated by MyBatis Generator.
* This field corresponds to the database column jsh_serial_number.id
*
* @mbggenerated
*/
private Long id;
/**
* This field was generated by MyBatis Generator.
* This field corresponds to the database column jsh_serial_number.material_Id
*
* @mbggenerated
*/
private Long materialId;
/**
* This field was generated by MyBatis Generator.
* This field corresponds to the database column jsh_serial_number.serial_Number
*
* @mbggenerated
*/
private String serialNumber;
/**
* This field was generated by MyBatis Generator.
* This field corresponds to the database column jsh_serial_number.is_Sell
*
* @mbggenerated
*/
private Boolean isSell;
/**
* This field was generated by MyBatis Generator.
* This field corresponds to the database column jsh_serial_number.remark
*
* @mbggenerated
*/
private String remark;
/**
* This field was generated by MyBatis Generator.
* This field corresponds to the database column jsh_serial_number.delete_Flag
*
* @mbggenerated
*/
private Boolean deleteFlag;
/**
* This field was generated by MyBatis Generator.
* This field corresponds to the database column jsh_serial_number.create_Time
*
* @mbggenerated
*/
private Date createTime;
/**
* This field was generated by MyBatis Generator.
* This field corresponds to the database column jsh_serial_number.creator
*
* @mbggenerated
*/
private Long creator;
/**
* This field was generated by MyBatis Generator.
* This field corresponds to the database column jsh_serial_number.update_Time
*
* @mbggenerated
*/
private Date updateTime;
/**
* This field was generated by MyBatis Generator.
* This field corresponds to the database column jsh_serial_number.updater
*
* @mbggenerated
*/
private Long updater;
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column jsh_serial_number.id
*
* @return the value of jsh_serial_number.id
*
* @mbggenerated
*/
public Long getId() {
return id;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column jsh_serial_number.id
*
* @param id the value for jsh_serial_number.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_serial_number.material_Id
*
* @return the value of jsh_serial_number.material_Id
*
* @mbggenerated
*/
public Long getMaterialId() {
return materialId;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column jsh_serial_number.material_Id
*
* @param materialId the value for jsh_serial_number.material_Id
*
* @mbggenerated
*/
public void setMaterialId(Long materialId) {
this.materialId = materialId;
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column jsh_serial_number.serial_Number
*
* @return the value of jsh_serial_number.serial_Number
*
* @mbggenerated
*/
public String getSerialNumber() {
return serialNumber;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column jsh_serial_number.serial_Number
*
* @param serialNumber the value for jsh_serial_number.serial_Number
*
* @mbggenerated
*/
public void setSerialNumber(String serialNumber) {
this.serialNumber = serialNumber == null ? null : serialNumber.trim();
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column jsh_serial_number.is_Sell
*
* @return the value of jsh_serial_number.is_Sell
*
* @mbggenerated
*/
public Boolean getIsSell() {
return isSell;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column jsh_serial_number.is_Sell
*
* @param isSell the value for jsh_serial_number.is_Sell
*
* @mbggenerated
*/
public void setIsSell(Boolean isSell) {
this.isSell = isSell;
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column jsh_serial_number.remark
*
* @return the value of jsh_serial_number.remark
*
* @mbggenerated
*/
public String getRemark() {
return remark;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column jsh_serial_number.remark
*
* @param remark the value for jsh_serial_number.remark
*
* @mbggenerated
*/
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_serial_number.delete_Flag
*
* @return the value of jsh_serial_number.delete_Flag
*
* @mbggenerated
*/
public Boolean getDeleteFlag() {
return deleteFlag;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column jsh_serial_number.delete_Flag
*
* @param deleteFlag the value for jsh_serial_number.delete_Flag
*
* @mbggenerated
*/
public void setDeleteFlag(Boolean deleteFlag) {
this.deleteFlag = deleteFlag;
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column jsh_serial_number.create_Time
*
* @return the value of jsh_serial_number.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_serial_number.create_Time
*
* @param createTime the value for jsh_serial_number.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_serial_number.creator
*
* @return the value of jsh_serial_number.creator
*
* @mbggenerated
*/
public Long getCreator() {
return creator;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column jsh_serial_number.creator
*
* @param creator the value for jsh_serial_number.creator
*
* @mbggenerated
*/
public void setCreator(Long creator) {
this.creator = creator;
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column jsh_serial_number.update_Time
*
* @return the value of jsh_serial_number.update_Time
*
* @mbggenerated
*/
public Date getUpdateTime() {
return updateTime;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column jsh_serial_number.update_Time
*
* @param updateTime the value for jsh_serial_number.update_Time
*
* @mbggenerated
*/
public void setUpdateTime(Date updateTime) {
this.updateTime = updateTime;
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column jsh_serial_number.updater
*
* @return the value of jsh_serial_number.updater
*
* @mbggenerated
*/
public Long getUpdater() {
return updater;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column jsh_serial_number.updater
*
* @param updater the value for jsh_serial_number.updater
*
* @mbggenerated
*/
public void setUpdater(Long updater) {
this.updater = updater;
}
}
\ No newline at end of file
package com.jsh.erp.datasource.entities;
/**
* Description
*
* @Author: cjl
* @Date: 2019/1/21 17:32
*/
public class SerialNumberEx extends SerialNumber{
/**
* 商品名称
* */
private String materialName;
/**
* 创建者名称
* */
private String creatorName;
/**
* 更新者名称
* */
private String updaterName;
public String getMaterialName() {
return materialName;
}
public void setMaterialName(String materialName) {
this.materialName = materialName;
}
public String getCreatorName() {
return creatorName;
}
public void setCreatorName(String creatorName) {
this.creatorName = creatorName;
}
public String getUpdaterName() {
return updaterName;
}
public void setUpdaterName(String updaterName) {
this.updaterName = updaterName;
}
}
......@@ -96,35 +96,5 @@ public interface MaterialMapper {
*/
int updateByPrimaryKey(Material record);
List<MaterialVo4Unit> selectByConditionMaterial(
@Param("name") String name,
@Param("model") String model,
@Param("categoryId") Long categoryId,
@Param("categoryIds") String categoryIds,
@Param("mpList") String mpList,
@Param("offset") Integer offset,
@Param("rows") Integer rows);
int countsByMaterial(
@Param("name") String name,
@Param("model") String model,
@Param("categoryId") Long categoryId,
@Param("categoryIds") String categoryIds,
@Param("mpList") String mpList);
String findUnitName(@Param("mId") Long mId);
List<MaterialVo4Unit> findById(@Param("id") Long id);
List<MaterialVo4Unit> findBySelect();
int updatePriceNullByPrimaryKey(Long id);
int updateUnitIdNullByPrimaryKey(Long id);
List<MaterialVo4Unit> findByAll(
@Param("name") String name,
@Param("model") String model,
@Param("categoryId") Long categoryId,
@Param("categoryIds") String categoryIds);
}
\ No newline at end of file
package com.jsh.erp.datasource.mappers;
import com.jsh.erp.datasource.entities.Material;
import com.jsh.erp.datasource.entities.MaterialVo4Unit;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* Description
*
* @Author: cjl
* @Date: 2019/1/22 14:54
*/
public interface MaterialMapperEx {
List<MaterialVo4Unit> selectByConditionMaterial(
@Param("name") String name,
@Param("model") String model,
@Param("categoryId") Long categoryId,
@Param("categoryIds") String categoryIds,
@Param("mpList") String mpList,
@Param("offset") Integer offset,
@Param("rows") Integer rows);
int countsByMaterial(
@Param("name") String name,
@Param("model") String model,
@Param("categoryId") Long categoryId,
@Param("categoryIds") String categoryIds,
@Param("mpList") String mpList);
String findUnitName(@Param("mId") Long mId);
List<MaterialVo4Unit> findById(@Param("id") Long id);
List<MaterialVo4Unit> findBySelect();
int updatePriceNullByPrimaryKey(Long id);
int updateUnitIdNullByPrimaryKey(Long id);
List<MaterialVo4Unit> findByAll(
@Param("name") String name,
@Param("model") String model,
@Param("categoryId") Long categoryId,
@Param("categoryIds") String categoryIds);
/**
* 通过商品名称查询商品信息
* */
List<Material> findByMaterialName(@Param("name") String name);
}
package com.jsh.erp.datasource.mappers;
import com.jsh.erp.datasource.entities.SerialNumber;
import com.jsh.erp.datasource.entities.SerialNumberExample;
import java.util.List;
import org.apache.ibatis.annotations.Param;
public interface SerialNumberMapper {
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table jsh_serial_number
*
* @mbggenerated
*/
int countByExample(SerialNumberExample example);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table jsh_serial_number
*
* @mbggenerated
*/
int deleteByExample(SerialNumberExample example);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table jsh_serial_number
*
* @mbggenerated
*/
int deleteByPrimaryKey(Long id);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table jsh_serial_number
*
* @mbggenerated
*/
int insert(SerialNumber record);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table jsh_serial_number
*
* @mbggenerated
*/
int insertSelective(SerialNumber record);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table jsh_serial_number
*
* @mbggenerated
*/
List<SerialNumber> selectByExample(SerialNumberExample example);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table jsh_serial_number
*
* @mbggenerated
*/
SerialNumber selectByPrimaryKey(Long id);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table jsh_serial_number
*
* @mbggenerated
*/
int updateByExampleSelective(@Param("record") SerialNumber record, @Param("example") SerialNumberExample example);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table jsh_serial_number
*
* @mbggenerated
*/
int updateByExample(@Param("record") SerialNumber record, @Param("example") SerialNumberExample example);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table jsh_serial_number
*
* @mbggenerated
*/
int updateByPrimaryKeySelective(SerialNumber record);
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table jsh_serial_number
*
* @mbggenerated
*/
int updateByPrimaryKey(SerialNumber record);
}
\ No newline at end of file
package com.jsh.erp.datasource.mappers;
import com.jsh.erp.datasource.entities.SerialNumber;
import com.jsh.erp.datasource.entities.SerialNumberEx;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* Description
*
* @Author: cjl
* @Date: 2019/1/21 17:09
*/
public interface SerialNumberMapperEx {
/**
* 根据条件查询序列号列表
* */
List<SerialNumberEx> selectByConditionSerialNumber(@Param("serialNumber") String serialNumber, @Param("materialName") String materialName,@Param("offset") Integer offset,@Param("rows") Integer rows);
/**
* 根据条件查询序列号数量
* */
int countSerialNumber(@Param("serialNumber")String serialNumber,@Param("materialName")String materialName);
/**
* 通过id查询序列号复合信息
* */
List<SerialNumberEx> findById(Long id);
/**
* 通过序列号查询序列号实体信息
* */
List<SerialNumberEx> findBySerialNumber(@Param("serialNumber") String serialNumber);
/**
* 新增序列号信息
* */
int addSerialNumber(SerialNumberEx serialNumberEx);
/**
* 修改序列号信息
* */
int updateSerialNumber(SerialNumberEx serialNumberEx);
}
package com.jsh.erp.exception;
import lombok.Getter;
import lombok.extern.slf4j.Slf4j;
@Slf4j
@Getter
public class BusinessParamCheckingException extends Exception {
private static final long serialVersionUID = 1L;
private int code;
private String reason;
public BusinessParamCheckingException(int code, String reason) {
super(reason);
this.code = code;
this.reason = reason;
}
public BusinessParamCheckingException(int code, String reason, Throwable throwable) {
super(reason, throwable);
this.code = code;
this.reason = reason;
}
}
package com.jsh.erp.exception;
import lombok.Getter;
import lombok.extern.slf4j.Slf4j;
@Slf4j
@Getter
public class BusinessRunTimeException extends RuntimeException {
private static final long serialVersionUID = 1L;
private int code;
private String reason;
public BusinessRunTimeException(int code, String reason) {
super(reason);
this.code = code;
this.reason = reason;
}
public BusinessRunTimeException(int code, String reason, Throwable throwable) {
super(reason, throwable);
this.code = code;
this.reason = reason;
}
}
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