Merge branch 'feature_day_1113' into 'main'
数字农机编码规则 See merge request likehai/ytr-god!30
This commit is contained in:
commit
e3b94b29d9
@ -0,0 +1,98 @@
|
||||
package com.god.web.controller.machinery;
|
||||
|
||||
import java.util.List;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.PutMapping;
|
||||
import org.springframework.web.bind.annotation.DeleteMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import com.god.common.annotation.Log;
|
||||
import com.god.common.core.controller.BaseController;
|
||||
import com.god.common.core.domain.AjaxResult;
|
||||
import com.god.common.enums.BusinessType;
|
||||
import com.god.passenger.machinery.domain.CqygMachineCodeInfo;
|
||||
import com.god.passenger.machinery.service.ICqygMachineCodeInfoService;
|
||||
import com.god.common.utils.poi.ExcelUtil;
|
||||
import com.god.common.core.page.TableDataInfo;
|
||||
|
||||
/**
|
||||
* 数字农机编码管理Controller
|
||||
*
|
||||
* @author wangyan
|
||||
* @date 2023-11-13
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/machinery/info")
|
||||
public class CqygMachineCodeInfoController extends BaseController {
|
||||
@Autowired
|
||||
private ICqygMachineCodeInfoService cqygMachineCodeInfoService;
|
||||
|
||||
/**
|
||||
* 查询数字农机编码管理列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('machinery:info:list')")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(CqygMachineCodeInfo cqygMachineCodeInfo) {
|
||||
startPage();
|
||||
List<CqygMachineCodeInfo> list = cqygMachineCodeInfoService.selectCqygMachineCodeInfoList(cqygMachineCodeInfo);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出数字农机编码管理列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('machinery:info:export')")
|
||||
@Log(title = "数字农机编码管理", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, CqygMachineCodeInfo cqygMachineCodeInfo) {
|
||||
List<CqygMachineCodeInfo> list = cqygMachineCodeInfoService.selectCqygMachineCodeInfoList(cqygMachineCodeInfo);
|
||||
ExcelUtil<CqygMachineCodeInfo> util = new ExcelUtil<CqygMachineCodeInfo>(CqygMachineCodeInfo.class);
|
||||
util.exportExcel(response, list, "数字农机编码管理数据");
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取数字农机编码管理详细信息
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('machinery:info:query')")
|
||||
@GetMapping(value = "/{id}")
|
||||
public AjaxResult getInfo(@PathVariable("id") String id) {
|
||||
return success(cqygMachineCodeInfoService.selectCqygMachineCodeInfoById(id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增数字农机编码管理
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('machinery:info:add')")
|
||||
@Log(title = "数字农机编码管理", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public AjaxResult add(@RequestBody CqygMachineCodeInfo cqygMachineCodeInfo) {
|
||||
return toAjax(cqygMachineCodeInfoService.insertCqygMachineCodeInfo(cqygMachineCodeInfo));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改数字农机编码管理
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('machinery:info:edit')")
|
||||
@Log(title = "数字农机编码管理", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public AjaxResult edit(@RequestBody CqygMachineCodeInfo cqygMachineCodeInfo) {
|
||||
return toAjax(cqygMachineCodeInfoService.updateCqygMachineCodeInfo(cqygMachineCodeInfo));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除数字农机编码管理
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('machinery:info:remove')")
|
||||
@Log(title = "数字农机编码管理", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{ids}")
|
||||
public AjaxResult remove(@PathVariable String[] ids) {
|
||||
return toAjax(cqygMachineCodeInfoService.deleteCqygMachineCodeInfoByIds(ids));
|
||||
}
|
||||
}
|
@ -0,0 +1,98 @@
|
||||
package com.god.web.controller.machinery;
|
||||
|
||||
import java.util.List;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.PutMapping;
|
||||
import org.springframework.web.bind.annotation.DeleteMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import com.god.common.annotation.Log;
|
||||
import com.god.common.core.controller.BaseController;
|
||||
import com.god.common.core.domain.AjaxResult;
|
||||
import com.god.common.enums.BusinessType;
|
||||
import com.god.passenger.machinery.domain.CqygMachineryCodeRule;
|
||||
import com.god.passenger.machinery.service.ICqygMachineryCodeRuleService;
|
||||
import com.god.common.utils.poi.ExcelUtil;
|
||||
import com.god.common.core.page.TableDataInfo;
|
||||
|
||||
/**
|
||||
* 数字农机编码规则Controller
|
||||
*
|
||||
* @author wangyan
|
||||
* @date 2023-11-13
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/machinery/rule")
|
||||
public class CqygMachineryCodeRuleController extends BaseController {
|
||||
@Autowired
|
||||
private ICqygMachineryCodeRuleService cqygMachineryCodeRuleService;
|
||||
|
||||
/**
|
||||
* 查询数字农机编码规则列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('machinery:rule:list')")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(CqygMachineryCodeRule cqygMachineryCodeRule) {
|
||||
startPage();
|
||||
List<CqygMachineryCodeRule> list = cqygMachineryCodeRuleService.selectCqygMachineryCodeRuleList(cqygMachineryCodeRule);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出数字农机编码规则列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('machinery:rule:export')")
|
||||
@Log(title = "数字农机编码规则", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, CqygMachineryCodeRule cqygMachineryCodeRule) {
|
||||
List<CqygMachineryCodeRule> list = cqygMachineryCodeRuleService.selectCqygMachineryCodeRuleList(cqygMachineryCodeRule);
|
||||
ExcelUtil<CqygMachineryCodeRule> util = new ExcelUtil<CqygMachineryCodeRule>(CqygMachineryCodeRule.class);
|
||||
util.exportExcel(response, list, "数字农机编码规则数据");
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取数字农机编码规则详细信息
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('machinery:rule:query')")
|
||||
@GetMapping(value = "/{id}")
|
||||
public AjaxResult getInfo(@PathVariable("id") String id) {
|
||||
return success(cqygMachineryCodeRuleService.selectCqygMachineryCodeRuleById(id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增数字农机编码规则
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('machinery:rule:add')")
|
||||
@Log(title = "数字农机编码规则", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public AjaxResult add(@RequestBody CqygMachineryCodeRule cqygMachineryCodeRule) {
|
||||
return toAjax(cqygMachineryCodeRuleService.insertCqygMachineryCodeRule(cqygMachineryCodeRule));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改数字农机编码规则
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('machinery:rule:edit')")
|
||||
@Log(title = "数字农机编码规则", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public AjaxResult edit(@RequestBody CqygMachineryCodeRule cqygMachineryCodeRule) {
|
||||
return toAjax(cqygMachineryCodeRuleService.updateCqygMachineryCodeRule(cqygMachineryCodeRule));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除数字农机编码规则
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('machinery:rule:remove')")
|
||||
@Log(title = "数字农机编码规则", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{ids}")
|
||||
public AjaxResult remove(@PathVariable String[] ids) {
|
||||
return toAjax(cqygMachineryCodeRuleService.deleteCqygMachineryCodeRuleByIds(ids));
|
||||
}
|
||||
}
|
@ -0,0 +1,122 @@
|
||||
package com.god.passenger.machinery.domain;
|
||||
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
import com.god.common.annotation.Excel;
|
||||
import com.god.common.core.domain.BaseEntity;
|
||||
|
||||
/**
|
||||
* 数字农机编码管理对象 cqyg_machine_code_info
|
||||
*
|
||||
* @author wangyan
|
||||
* @date 2023-11-13
|
||||
*/
|
||||
public class CqygMachineCodeInfo extends BaseEntity
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 主键 */
|
||||
private String id;
|
||||
|
||||
/** 机器编码 */
|
||||
@Excel(name = "机器编码")
|
||||
private String machineCode;
|
||||
|
||||
/** 出厂编号 */
|
||||
@Excel(name = "出厂编号")
|
||||
private String factoryNumber;
|
||||
|
||||
/** 农机型号 */
|
||||
@Excel(name = "农机型号")
|
||||
private String machineModel;
|
||||
|
||||
/** 农机名称 */
|
||||
@Excel(name = "农机名称")
|
||||
private String machineName;
|
||||
|
||||
/** 农机类型 */
|
||||
@Excel(name = "农机类型")
|
||||
private String machineTypeCode;
|
||||
|
||||
/** 发码时间 */
|
||||
@Excel(name = "发码时间")
|
||||
private String codeSendTime;
|
||||
|
||||
public void setId(String id)
|
||||
{
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public String getId()
|
||||
{
|
||||
return id;
|
||||
}
|
||||
public void setMachineCode(String machineCode)
|
||||
{
|
||||
this.machineCode = machineCode;
|
||||
}
|
||||
|
||||
public String getMachineCode()
|
||||
{
|
||||
return machineCode;
|
||||
}
|
||||
public void setFactoryNumber(String factoryNumber)
|
||||
{
|
||||
this.factoryNumber = factoryNumber;
|
||||
}
|
||||
|
||||
public String getFactoryNumber()
|
||||
{
|
||||
return factoryNumber;
|
||||
}
|
||||
public void setMachineModel(String machineModel)
|
||||
{
|
||||
this.machineModel = machineModel;
|
||||
}
|
||||
|
||||
public String getMachineModel()
|
||||
{
|
||||
return machineModel;
|
||||
}
|
||||
public void setMachineName(String machineName)
|
||||
{
|
||||
this.machineName = machineName;
|
||||
}
|
||||
|
||||
public String getMachineName()
|
||||
{
|
||||
return machineName;
|
||||
}
|
||||
public void setMachineTypeCode(String machineTypeCode)
|
||||
{
|
||||
this.machineTypeCode = machineTypeCode;
|
||||
}
|
||||
|
||||
public String getMachineTypeCode()
|
||||
{
|
||||
return machineTypeCode;
|
||||
}
|
||||
public void setCodeSendTime(String codeSendTime)
|
||||
{
|
||||
this.codeSendTime = codeSendTime;
|
||||
}
|
||||
|
||||
public String getCodeSendTime()
|
||||
{
|
||||
return codeSendTime;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
|
||||
.append("id", getId())
|
||||
.append("machineCode", getMachineCode())
|
||||
.append("factoryNumber", getFactoryNumber())
|
||||
.append("machineModel", getMachineModel())
|
||||
.append("machineName", getMachineName())
|
||||
.append("machineTypeCode", getMachineTypeCode())
|
||||
.append("codeSendTime", getCodeSendTime())
|
||||
.append("remark", getRemark())
|
||||
.toString();
|
||||
}
|
||||
}
|
@ -0,0 +1,136 @@
|
||||
package com.god.passenger.machinery.domain;
|
||||
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
import com.god.common.annotation.Excel;
|
||||
import com.god.common.core.domain.BaseEntity;
|
||||
|
||||
/**
|
||||
* 数字农机编码规则对象 cqyg_machinery_code_rule
|
||||
*
|
||||
* @author wangyan
|
||||
* @date 2023-11-13
|
||||
*/
|
||||
public class CqygMachineryCodeRule extends BaseEntity
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 主键 */
|
||||
private String id;
|
||||
|
||||
/** 大类编码 */
|
||||
@Excel(name = "大类编码")
|
||||
private String largeCategoryCode;
|
||||
|
||||
/** 大类名称 */
|
||||
@Excel(name = "大类名称")
|
||||
private String largeCategoryName;
|
||||
|
||||
/** 小类编码 */
|
||||
@Excel(name = "小类编码")
|
||||
private String subclassCode;
|
||||
|
||||
/** 小类名称 */
|
||||
@Excel(name = "小类名称")
|
||||
private String subclassName;
|
||||
|
||||
/** 物品编码 */
|
||||
@Excel(name = "物品编码")
|
||||
private String codeInfo;
|
||||
|
||||
/** 物品名称 */
|
||||
@Excel(name = "物品名称")
|
||||
private String nameInfo;
|
||||
|
||||
/** 数据类型 */
|
||||
@Excel(name = "数据类型")
|
||||
private String dataType;
|
||||
|
||||
public void setId(String id)
|
||||
{
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public String getId()
|
||||
{
|
||||
return id;
|
||||
}
|
||||
public void setLargeCategoryCode(String largeCategoryCode)
|
||||
{
|
||||
this.largeCategoryCode = largeCategoryCode;
|
||||
}
|
||||
|
||||
public String getLargeCategoryCode()
|
||||
{
|
||||
return largeCategoryCode;
|
||||
}
|
||||
public void setLargeCategoryName(String largeCategoryName)
|
||||
{
|
||||
this.largeCategoryName = largeCategoryName;
|
||||
}
|
||||
|
||||
public String getLargeCategoryName()
|
||||
{
|
||||
return largeCategoryName;
|
||||
}
|
||||
public void setSubclassCode(String subclassCode)
|
||||
{
|
||||
this.subclassCode = subclassCode;
|
||||
}
|
||||
|
||||
public String getSubclassCode()
|
||||
{
|
||||
return subclassCode;
|
||||
}
|
||||
public void setSubclassName(String subclassName)
|
||||
{
|
||||
this.subclassName = subclassName;
|
||||
}
|
||||
|
||||
public String getSubclassName()
|
||||
{
|
||||
return subclassName;
|
||||
}
|
||||
public void setCodeInfo(String codeInfo)
|
||||
{
|
||||
this.codeInfo = codeInfo;
|
||||
}
|
||||
|
||||
public String getCodeInfo()
|
||||
{
|
||||
return codeInfo;
|
||||
}
|
||||
public void setNameInfo(String nameInfo)
|
||||
{
|
||||
this.nameInfo = nameInfo;
|
||||
}
|
||||
|
||||
public String getNameInfo()
|
||||
{
|
||||
return nameInfo;
|
||||
}
|
||||
public void setDataType(String dataType)
|
||||
{
|
||||
this.dataType = dataType;
|
||||
}
|
||||
|
||||
public String getDataType()
|
||||
{
|
||||
return dataType;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
|
||||
.append("id", getId())
|
||||
.append("largeCategoryCode", getLargeCategoryCode())
|
||||
.append("largeCategoryName", getLargeCategoryName())
|
||||
.append("subclassCode", getSubclassCode())
|
||||
.append("subclassName", getSubclassName())
|
||||
.append("codeInfo", getCodeInfo())
|
||||
.append("nameInfo", getNameInfo())
|
||||
.append("remark", getRemark())
|
||||
.append("dataType", getDataType())
|
||||
.toString();
|
||||
}
|
||||
}
|
@ -0,0 +1,61 @@
|
||||
package com.god.passenger.machinery.mapper;
|
||||
|
||||
import java.util.List;
|
||||
import com.god.passenger.machinery.domain.CqygMachineCodeInfo;
|
||||
|
||||
/**
|
||||
* 数字农机编码管理Mapper接口
|
||||
*
|
||||
* @author wangyan
|
||||
* @date 2023-11-13
|
||||
*/
|
||||
public interface CqygMachineCodeInfoMapper
|
||||
{
|
||||
/**
|
||||
* 查询数字农机编码管理
|
||||
*
|
||||
* @param id 数字农机编码管理主键
|
||||
* @return 数字农机编码管理
|
||||
*/
|
||||
public CqygMachineCodeInfo selectCqygMachineCodeInfoById(String id);
|
||||
|
||||
/**
|
||||
* 查询数字农机编码管理列表
|
||||
*
|
||||
* @param cqygMachineCodeInfo 数字农机编码管理
|
||||
* @return 数字农机编码管理集合
|
||||
*/
|
||||
public List<CqygMachineCodeInfo> selectCqygMachineCodeInfoList(CqygMachineCodeInfo cqygMachineCodeInfo);
|
||||
|
||||
/**
|
||||
* 新增数字农机编码管理
|
||||
*
|
||||
* @param cqygMachineCodeInfo 数字农机编码管理
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertCqygMachineCodeInfo(CqygMachineCodeInfo cqygMachineCodeInfo);
|
||||
|
||||
/**
|
||||
* 修改数字农机编码管理
|
||||
*
|
||||
* @param cqygMachineCodeInfo 数字农机编码管理
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateCqygMachineCodeInfo(CqygMachineCodeInfo cqygMachineCodeInfo);
|
||||
|
||||
/**
|
||||
* 删除数字农机编码管理
|
||||
*
|
||||
* @param id 数字农机编码管理主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteCqygMachineCodeInfoById(String id);
|
||||
|
||||
/**
|
||||
* 批量删除数字农机编码管理
|
||||
*
|
||||
* @param ids 需要删除的数据主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteCqygMachineCodeInfoByIds(String[] ids);
|
||||
}
|
@ -0,0 +1,61 @@
|
||||
package com.god.passenger.machinery.mapper;
|
||||
|
||||
import java.util.List;
|
||||
import com.god.passenger.machinery.domain.CqygMachineryCodeRule;
|
||||
|
||||
/**
|
||||
* 数字农机编码规则Mapper接口
|
||||
*
|
||||
* @author wangyan
|
||||
* @date 2023-11-13
|
||||
*/
|
||||
public interface CqygMachineryCodeRuleMapper
|
||||
{
|
||||
/**
|
||||
* 查询数字农机编码规则
|
||||
*
|
||||
* @param id 数字农机编码规则主键
|
||||
* @return 数字农机编码规则
|
||||
*/
|
||||
public CqygMachineryCodeRule selectCqygMachineryCodeRuleById(String id);
|
||||
|
||||
/**
|
||||
* 查询数字农机编码规则列表
|
||||
*
|
||||
* @param cqygMachineryCodeRule 数字农机编码规则
|
||||
* @return 数字农机编码规则集合
|
||||
*/
|
||||
public List<CqygMachineryCodeRule> selectCqygMachineryCodeRuleList(CqygMachineryCodeRule cqygMachineryCodeRule);
|
||||
|
||||
/**
|
||||
* 新增数字农机编码规则
|
||||
*
|
||||
* @param cqygMachineryCodeRule 数字农机编码规则
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertCqygMachineryCodeRule(CqygMachineryCodeRule cqygMachineryCodeRule);
|
||||
|
||||
/**
|
||||
* 修改数字农机编码规则
|
||||
*
|
||||
* @param cqygMachineryCodeRule 数字农机编码规则
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateCqygMachineryCodeRule(CqygMachineryCodeRule cqygMachineryCodeRule);
|
||||
|
||||
/**
|
||||
* 删除数字农机编码规则
|
||||
*
|
||||
* @param id 数字农机编码规则主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteCqygMachineryCodeRuleById(String id);
|
||||
|
||||
/**
|
||||
* 批量删除数字农机编码规则
|
||||
*
|
||||
* @param ids 需要删除的数据主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteCqygMachineryCodeRuleByIds(String[] ids);
|
||||
}
|
@ -0,0 +1,61 @@
|
||||
package com.god.passenger.machinery.service;
|
||||
|
||||
import java.util.List;
|
||||
import com.god.passenger.machinery.domain.CqygMachineCodeInfo;
|
||||
|
||||
/**
|
||||
* 数字农机编码管理Service接口
|
||||
*
|
||||
* @author wangyan
|
||||
* @date 2023-11-13
|
||||
*/
|
||||
public interface ICqygMachineCodeInfoService
|
||||
{
|
||||
/**
|
||||
* 查询数字农机编码管理
|
||||
*
|
||||
* @param id 数字农机编码管理主键
|
||||
* @return 数字农机编码管理
|
||||
*/
|
||||
public CqygMachineCodeInfo selectCqygMachineCodeInfoById(String id);
|
||||
|
||||
/**
|
||||
* 查询数字农机编码管理列表
|
||||
*
|
||||
* @param cqygMachineCodeInfo 数字农机编码管理
|
||||
* @return 数字农机编码管理集合
|
||||
*/
|
||||
public List<CqygMachineCodeInfo> selectCqygMachineCodeInfoList(CqygMachineCodeInfo cqygMachineCodeInfo);
|
||||
|
||||
/**
|
||||
* 新增数字农机编码管理
|
||||
*
|
||||
* @param cqygMachineCodeInfo 数字农机编码管理
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertCqygMachineCodeInfo(CqygMachineCodeInfo cqygMachineCodeInfo);
|
||||
|
||||
/**
|
||||
* 修改数字农机编码管理
|
||||
*
|
||||
* @param cqygMachineCodeInfo 数字农机编码管理
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateCqygMachineCodeInfo(CqygMachineCodeInfo cqygMachineCodeInfo);
|
||||
|
||||
/**
|
||||
* 批量删除数字农机编码管理
|
||||
*
|
||||
* @param ids 需要删除的数字农机编码管理主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteCqygMachineCodeInfoByIds(String[] ids);
|
||||
|
||||
/**
|
||||
* 删除数字农机编码管理信息
|
||||
*
|
||||
* @param id 数字农机编码管理主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteCqygMachineCodeInfoById(String id);
|
||||
}
|
@ -0,0 +1,61 @@
|
||||
package com.god.passenger.machinery.service;
|
||||
|
||||
import java.util.List;
|
||||
import com.god.passenger.machinery.domain.CqygMachineryCodeRule;
|
||||
|
||||
/**
|
||||
* 数字农机编码规则Service接口
|
||||
*
|
||||
* @author wangyan
|
||||
* @date 2023-11-13
|
||||
*/
|
||||
public interface ICqygMachineryCodeRuleService
|
||||
{
|
||||
/**
|
||||
* 查询数字农机编码规则
|
||||
*
|
||||
* @param id 数字农机编码规则主键
|
||||
* @return 数字农机编码规则
|
||||
*/
|
||||
public CqygMachineryCodeRule selectCqygMachineryCodeRuleById(String id);
|
||||
|
||||
/**
|
||||
* 查询数字农机编码规则列表
|
||||
*
|
||||
* @param cqygMachineryCodeRule 数字农机编码规则
|
||||
* @return 数字农机编码规则集合
|
||||
*/
|
||||
public List<CqygMachineryCodeRule> selectCqygMachineryCodeRuleList(CqygMachineryCodeRule cqygMachineryCodeRule);
|
||||
|
||||
/**
|
||||
* 新增数字农机编码规则
|
||||
*
|
||||
* @param cqygMachineryCodeRule 数字农机编码规则
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertCqygMachineryCodeRule(CqygMachineryCodeRule cqygMachineryCodeRule);
|
||||
|
||||
/**
|
||||
* 修改数字农机编码规则
|
||||
*
|
||||
* @param cqygMachineryCodeRule 数字农机编码规则
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateCqygMachineryCodeRule(CqygMachineryCodeRule cqygMachineryCodeRule);
|
||||
|
||||
/**
|
||||
* 批量删除数字农机编码规则
|
||||
*
|
||||
* @param ids 需要删除的数字农机编码规则主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteCqygMachineryCodeRuleByIds(String[] ids);
|
||||
|
||||
/**
|
||||
* 删除数字农机编码规则信息
|
||||
*
|
||||
* @param id 数字农机编码规则主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteCqygMachineryCodeRuleById(String id);
|
||||
}
|
@ -0,0 +1,92 @@
|
||||
package com.god.passenger.machinery.service.impl;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.god.common.utils.StringUtils;
|
||||
import com.god.common.utils.uuid.IdUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.god.passenger.machinery.mapper.CqygMachineCodeInfoMapper;
|
||||
import com.god.passenger.machinery.domain.CqygMachineCodeInfo;
|
||||
import com.god.passenger.machinery.service.ICqygMachineCodeInfoService;
|
||||
|
||||
/**
|
||||
* 数字农机编码管理Service业务层处理
|
||||
*
|
||||
* @author wangyan
|
||||
* @date 2023-11-13
|
||||
*/
|
||||
@Service
|
||||
public class CqygMachineCodeInfoServiceImpl implements ICqygMachineCodeInfoService {
|
||||
@Autowired
|
||||
private CqygMachineCodeInfoMapper cqygMachineCodeInfoMapper;
|
||||
|
||||
/**
|
||||
* 查询数字农机编码管理
|
||||
*
|
||||
* @param id 数字农机编码管理主键
|
||||
* @return 数字农机编码管理
|
||||
*/
|
||||
@Override
|
||||
public CqygMachineCodeInfo selectCqygMachineCodeInfoById(String id) {
|
||||
return cqygMachineCodeInfoMapper.selectCqygMachineCodeInfoById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询数字农机编码管理列表
|
||||
*
|
||||
* @param cqygMachineCodeInfo 数字农机编码管理
|
||||
* @return 数字农机编码管理
|
||||
*/
|
||||
@Override
|
||||
public List<CqygMachineCodeInfo> selectCqygMachineCodeInfoList(CqygMachineCodeInfo cqygMachineCodeInfo) {
|
||||
return cqygMachineCodeInfoMapper.selectCqygMachineCodeInfoList(cqygMachineCodeInfo);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增数字农机编码管理
|
||||
*
|
||||
* @param cqygMachineCodeInfo 数字农机编码管理
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int insertCqygMachineCodeInfo(CqygMachineCodeInfo cqygMachineCodeInfo) {
|
||||
if (StringUtils.isBlank(cqygMachineCodeInfo.getId())){
|
||||
cqygMachineCodeInfo.setId(IdUtils.fastSimpleUUID());
|
||||
}
|
||||
return cqygMachineCodeInfoMapper.insertCqygMachineCodeInfo(cqygMachineCodeInfo);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改数字农机编码管理
|
||||
*
|
||||
* @param cqygMachineCodeInfo 数字农机编码管理
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int updateCqygMachineCodeInfo(CqygMachineCodeInfo cqygMachineCodeInfo) {
|
||||
return cqygMachineCodeInfoMapper.updateCqygMachineCodeInfo(cqygMachineCodeInfo);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除数字农机编码管理
|
||||
*
|
||||
* @param ids 需要删除的数字农机编码管理主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteCqygMachineCodeInfoByIds(String[] ids) {
|
||||
return cqygMachineCodeInfoMapper.deleteCqygMachineCodeInfoByIds(ids);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除数字农机编码管理信息
|
||||
*
|
||||
* @param id 数字农机编码管理主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteCqygMachineCodeInfoById(String id) {
|
||||
return cqygMachineCodeInfoMapper.deleteCqygMachineCodeInfoById(id);
|
||||
}
|
||||
}
|
@ -0,0 +1,92 @@
|
||||
package com.god.passenger.machinery.service.impl;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.god.common.utils.StringUtils;
|
||||
import com.god.common.utils.uuid.IdUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.god.passenger.machinery.mapper.CqygMachineryCodeRuleMapper;
|
||||
import com.god.passenger.machinery.domain.CqygMachineryCodeRule;
|
||||
import com.god.passenger.machinery.service.ICqygMachineryCodeRuleService;
|
||||
|
||||
/**
|
||||
* 数字农机编码规则Service业务层处理
|
||||
*
|
||||
* @author wangyan
|
||||
* @date 2023-11-13
|
||||
*/
|
||||
@Service
|
||||
public class CqygMachineryCodeRuleServiceImpl implements ICqygMachineryCodeRuleService {
|
||||
@Autowired
|
||||
private CqygMachineryCodeRuleMapper cqygMachineryCodeRuleMapper;
|
||||
|
||||
/**
|
||||
* 查询数字农机编码规则
|
||||
*
|
||||
* @param id 数字农机编码规则主键
|
||||
* @return 数字农机编码规则
|
||||
*/
|
||||
@Override
|
||||
public CqygMachineryCodeRule selectCqygMachineryCodeRuleById(String id) {
|
||||
return cqygMachineryCodeRuleMapper.selectCqygMachineryCodeRuleById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询数字农机编码规则列表
|
||||
*
|
||||
* @param cqygMachineryCodeRule 数字农机编码规则
|
||||
* @return 数字农机编码规则
|
||||
*/
|
||||
@Override
|
||||
public List<CqygMachineryCodeRule> selectCqygMachineryCodeRuleList(CqygMachineryCodeRule cqygMachineryCodeRule) {
|
||||
return cqygMachineryCodeRuleMapper.selectCqygMachineryCodeRuleList(cqygMachineryCodeRule);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增数字农机编码规则
|
||||
*
|
||||
* @param cqygMachineryCodeRule 数字农机编码规则
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int insertCqygMachineryCodeRule(CqygMachineryCodeRule cqygMachineryCodeRule) {
|
||||
if (StringUtils.isBlank(cqygMachineryCodeRule.getId())) {
|
||||
cqygMachineryCodeRule.setId(IdUtils.fastSimpleUUID());
|
||||
}
|
||||
return cqygMachineryCodeRuleMapper.insertCqygMachineryCodeRule(cqygMachineryCodeRule);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改数字农机编码规则
|
||||
*
|
||||
* @param cqygMachineryCodeRule 数字农机编码规则
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int updateCqygMachineryCodeRule(CqygMachineryCodeRule cqygMachineryCodeRule) {
|
||||
return cqygMachineryCodeRuleMapper.updateCqygMachineryCodeRule(cqygMachineryCodeRule);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除数字农机编码规则
|
||||
*
|
||||
* @param ids 需要删除的数字农机编码规则主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteCqygMachineryCodeRuleByIds(String[] ids) {
|
||||
return cqygMachineryCodeRuleMapper.deleteCqygMachineryCodeRuleByIds(ids);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除数字农机编码规则信息
|
||||
*
|
||||
* @param id 数字农机编码规则主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteCqygMachineryCodeRuleById(String id) {
|
||||
return cqygMachineryCodeRuleMapper.deleteCqygMachineryCodeRuleById(id);
|
||||
}
|
||||
}
|
@ -0,0 +1,87 @@
|
||||
<?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.god.passenger.machinery.mapper.CqygMachineCodeInfoMapper">
|
||||
|
||||
<resultMap type="CqygMachineCodeInfo" id="CqygMachineCodeInfoResult">
|
||||
<result property="id" column="id" />
|
||||
<result property="machineCode" column="machine_code" />
|
||||
<result property="factoryNumber" column="factory_number" />
|
||||
<result property="machineModel" column="machine_model" />
|
||||
<result property="machineName" column="machine_name" />
|
||||
<result property="machineTypeCode" column="machine_type_code" />
|
||||
<result property="codeSendTime" column="code_send_time" />
|
||||
<result property="remark" column="remark" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectCqygMachineCodeInfoVo">
|
||||
select id, machine_code, factory_number, machine_model, machine_name, machine_type_code, code_send_time, remark from cqyg_machine_code_info
|
||||
</sql>
|
||||
|
||||
<select id="selectCqygMachineCodeInfoList" parameterType="CqygMachineCodeInfo" resultMap="CqygMachineCodeInfoResult">
|
||||
<include refid="selectCqygMachineCodeInfoVo"/>
|
||||
<where>
|
||||
<if test="machineCode != null and machineCode != ''"> and machine_code = #{machineCode}</if>
|
||||
<if test="factoryNumber != null and factoryNumber != ''"> and factory_number = #{factoryNumber}</if>
|
||||
<if test="machineModel != null and machineModel != ''"> and machine_model like concat('%', #{machineModel}, '%')</if>
|
||||
<if test="machineName != null and machineName != ''"> and machine_name like concat('%', #{machineName}, '%')</if>
|
||||
<if test="machineTypeCode != null and machineTypeCode != ''"> and machine_type_code like concat('%', #{machineTypeCode}, '%')</if>
|
||||
<if test="params.beginCodeSendTime != null and params.beginCodeSendTime != '' and params.endCodeSendTime != null and params.endCodeSendTime != ''"> and code_send_time between #{params.beginCodeSendTime} and #{params.endCodeSendTime}</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectCqygMachineCodeInfoById" parameterType="String" resultMap="CqygMachineCodeInfoResult">
|
||||
<include refid="selectCqygMachineCodeInfoVo"/>
|
||||
where id = #{id}
|
||||
</select>
|
||||
|
||||
<insert id="insertCqygMachineCodeInfo" parameterType="CqygMachineCodeInfo">
|
||||
insert into cqyg_machine_code_info
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="id != null">id,</if>
|
||||
<if test="machineCode != null">machine_code,</if>
|
||||
<if test="factoryNumber != null">factory_number,</if>
|
||||
<if test="machineModel != null">machine_model,</if>
|
||||
<if test="machineName != null">machine_name,</if>
|
||||
<if test="machineTypeCode != null">machine_type_code,</if>
|
||||
<if test="codeSendTime != null">code_send_time,</if>
|
||||
<if test="remark != null">remark,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="id != null">#{id},</if>
|
||||
<if test="machineCode != null">#{machineCode},</if>
|
||||
<if test="factoryNumber != null">#{factoryNumber},</if>
|
||||
<if test="machineModel != null">#{machineModel},</if>
|
||||
<if test="machineName != null">#{machineName},</if>
|
||||
<if test="machineTypeCode != null">#{machineTypeCode},</if>
|
||||
<if test="codeSendTime != null">#{codeSendTime},</if>
|
||||
<if test="remark != null">#{remark},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateCqygMachineCodeInfo" parameterType="CqygMachineCodeInfo">
|
||||
update cqyg_machine_code_info
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="machineCode != null">machine_code = #{machineCode},</if>
|
||||
<if test="factoryNumber != null">factory_number = #{factoryNumber},</if>
|
||||
<if test="machineModel != null">machine_model = #{machineModel},</if>
|
||||
<if test="machineName != null">machine_name = #{machineName},</if>
|
||||
<if test="machineTypeCode != null">machine_type_code = #{machineTypeCode},</if>
|
||||
<if test="codeSendTime != null">code_send_time = #{codeSendTime},</if>
|
||||
<if test="remark != null">remark = #{remark},</if>
|
||||
</trim>
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
||||
<delete id="deleteCqygMachineCodeInfoById" parameterType="String">
|
||||
delete from cqyg_machine_code_info where id = #{id}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteCqygMachineCodeInfoByIds" parameterType="String">
|
||||
delete from cqyg_machine_code_info where id in
|
||||
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</delete>
|
||||
</mapper>
|
@ -0,0 +1,92 @@
|
||||
<?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.god.passenger.machinery.mapper.CqygMachineryCodeRuleMapper">
|
||||
|
||||
<resultMap type="CqygMachineryCodeRule" id="CqygMachineryCodeRuleResult">
|
||||
<result property="id" column="id" />
|
||||
<result property="largeCategoryCode" column="large_category_code" />
|
||||
<result property="largeCategoryName" column="large_category_name" />
|
||||
<result property="subclassCode" column="subclass_code" />
|
||||
<result property="subclassName" column="subclass_name" />
|
||||
<result property="codeInfo" column="code_info" />
|
||||
<result property="nameInfo" column="name_info" />
|
||||
<result property="remark" column="remark" />
|
||||
<result property="dataType" column="data_type" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectCqygMachineryCodeRuleVo">
|
||||
select id, large_category_code, large_category_name, subclass_code, subclass_name, code_info, name_info, remark, data_type from cqyg_machinery_code_rule
|
||||
</sql>
|
||||
|
||||
<select id="selectCqygMachineryCodeRuleList" parameterType="CqygMachineryCodeRule" resultMap="CqygMachineryCodeRuleResult">
|
||||
<include refid="selectCqygMachineryCodeRuleVo"/>
|
||||
<where>
|
||||
<if test="largeCategoryCode != null and largeCategoryCode != ''"> and large_category_code = #{largeCategoryCode}</if>
|
||||
<if test="largeCategoryName != null and largeCategoryName != ''"> and large_category_name like concat('%', #{largeCategoryName}, '%')</if>
|
||||
<if test="subclassCode != null and subclassCode != ''"> and subclass_code = #{subclassCode}</if>
|
||||
<if test="subclassName != null and subclassName != ''"> and subclass_name like concat('%', #{subclassName}, '%')</if>
|
||||
<if test="codeInfo != null and codeInfo != ''"> and code_info = #{codeInfo}</if>
|
||||
<if test="nameInfo != null and nameInfo != ''"> and name_info like concat('%', #{nameInfo}, '%')</if>
|
||||
<if test="dataType != null and dataType != ''"> and data_type like concat('%', #{dataType}, '%')</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectCqygMachineryCodeRuleById" parameterType="String" resultMap="CqygMachineryCodeRuleResult">
|
||||
<include refid="selectCqygMachineryCodeRuleVo"/>
|
||||
where id = #{id}
|
||||
</select>
|
||||
|
||||
<insert id="insertCqygMachineryCodeRule" parameterType="CqygMachineryCodeRule">
|
||||
insert into cqyg_machinery_code_rule
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="id != null">id,</if>
|
||||
<if test="largeCategoryCode != null">large_category_code,</if>
|
||||
<if test="largeCategoryName != null">large_category_name,</if>
|
||||
<if test="subclassCode != null">subclass_code,</if>
|
||||
<if test="subclassName != null">subclass_name,</if>
|
||||
<if test="codeInfo != null">code_info,</if>
|
||||
<if test="nameInfo != null">name_info,</if>
|
||||
<if test="remark != null">remark,</if>
|
||||
<if test="dataType != null">data_type,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="id != null">#{id},</if>
|
||||
<if test="largeCategoryCode != null">#{largeCategoryCode},</if>
|
||||
<if test="largeCategoryName != null">#{largeCategoryName},</if>
|
||||
<if test="subclassCode != null">#{subclassCode},</if>
|
||||
<if test="subclassName != null">#{subclassName},</if>
|
||||
<if test="codeInfo != null">#{codeInfo},</if>
|
||||
<if test="nameInfo != null">#{nameInfo},</if>
|
||||
<if test="remark != null">#{remark},</if>
|
||||
<if test="dataType != null">#{dataType},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateCqygMachineryCodeRule" parameterType="CqygMachineryCodeRule">
|
||||
update cqyg_machinery_code_rule
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="largeCategoryCode != null">large_category_code = #{largeCategoryCode},</if>
|
||||
<if test="largeCategoryName != null">large_category_name = #{largeCategoryName},</if>
|
||||
<if test="subclassCode != null">subclass_code = #{subclassCode},</if>
|
||||
<if test="subclassName != null">subclass_name = #{subclassName},</if>
|
||||
<if test="codeInfo != null">code_info = #{codeInfo},</if>
|
||||
<if test="nameInfo != null">name_info = #{nameInfo},</if>
|
||||
<if test="remark != null">remark = #{remark},</if>
|
||||
<if test="dataType != null">data_type = #{dataType},</if>
|
||||
</trim>
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
||||
<delete id="deleteCqygMachineryCodeRuleById" parameterType="String">
|
||||
delete from cqyg_machinery_code_rule where id = #{id}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteCqygMachineryCodeRuleByIds" parameterType="String">
|
||||
delete from cqyg_machinery_code_rule where id in
|
||||
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</delete>
|
||||
</mapper>
|
44
god-ui/src/api/machinery/info.js
Normal file
44
god-ui/src/api/machinery/info.js
Normal file
@ -0,0 +1,44 @@
|
||||
import request from '@/utils/request'
|
||||
|
||||
// 查询数字农机编码管理列表
|
||||
export function listInfo(query) {
|
||||
return request({
|
||||
url: '/machinery/info/list',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
// 查询数字农机编码管理详细
|
||||
export function getInfo(id) {
|
||||
return request({
|
||||
url: '/machinery/info/' + id,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
// 新增数字农机编码管理
|
||||
export function addInfo(data) {
|
||||
return request({
|
||||
url: '/machinery/info',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 修改数字农机编码管理
|
||||
export function updateInfo(data) {
|
||||
return request({
|
||||
url: '/machinery/info',
|
||||
method: 'put',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 删除数字农机编码管理
|
||||
export function delInfo(id) {
|
||||
return request({
|
||||
url: '/machinery/info/' + id,
|
||||
method: 'delete'
|
||||
})
|
||||
}
|
44
god-ui/src/api/machinery/rule.js
Normal file
44
god-ui/src/api/machinery/rule.js
Normal file
@ -0,0 +1,44 @@
|
||||
import request from '@/utils/request'
|
||||
|
||||
// 查询数字农机编码规则列表
|
||||
export function listRule(query) {
|
||||
return request({
|
||||
url: '/machinery/rule/list',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
// 查询数字农机编码规则详细
|
||||
export function getRule(id) {
|
||||
return request({
|
||||
url: '/machinery/rule/' + id,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
// 新增数字农机编码规则
|
||||
export function addRule(data) {
|
||||
return request({
|
||||
url: '/machinery/rule',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 修改数字农机编码规则
|
||||
export function updateRule(data) {
|
||||
return request({
|
||||
url: '/machinery/rule',
|
||||
method: 'put',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 删除数字农机编码规则
|
||||
export function delRule(id) {
|
||||
return request({
|
||||
url: '/machinery/rule/' + id,
|
||||
method: 'delete'
|
||||
})
|
||||
}
|
339
god-ui/src/views/machinery/info/index.vue
Normal file
339
god-ui/src/views/machinery/info/index.vue
Normal file
@ -0,0 +1,339 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
|
||||
<el-form-item label="机器编码" prop="machineCode">
|
||||
<el-input
|
||||
v-model="queryParams.machineCode"
|
||||
placeholder="请输入机器编码"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="出厂编号" prop="factoryNumber">
|
||||
<el-input
|
||||
v-model="queryParams.factoryNumber"
|
||||
placeholder="请输入出厂编号"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="农机型号" prop="machineModel">
|
||||
<el-input
|
||||
v-model="queryParams.machineModel"
|
||||
placeholder="请输入农机型号"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="农机名称" prop="machineName">
|
||||
<el-input
|
||||
v-model="queryParams.machineName"
|
||||
placeholder="请输入农机名称"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="农机类型" prop="machineTypeCode">
|
||||
<el-input
|
||||
v-model="queryParams.machineTypeCode"
|
||||
placeholder="请输入农机类型"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="发码时间">
|
||||
<el-date-picker
|
||||
v-model="daterangeCodeSendTime"
|
||||
style="width: 240px"
|
||||
value-format="yyyy-MM-dd"
|
||||
type="daterange"
|
||||
range-separator="-"
|
||||
start-placeholder="开始日期"
|
||||
end-placeholder="结束日期"
|
||||
></el-date-picker>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
|
||||
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
|
||||
<el-row :gutter="10" class="mb8">
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="primary"
|
||||
plain
|
||||
icon="el-icon-plus"
|
||||
size="mini"
|
||||
@click="handleAdd"
|
||||
v-hasPermi="['machinery:info:add']"
|
||||
>新增</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="success"
|
||||
plain
|
||||
icon="el-icon-edit"
|
||||
size="mini"
|
||||
:disabled="single"
|
||||
@click="handleUpdate"
|
||||
v-hasPermi="['machinery:info:edit']"
|
||||
>修改</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="danger"
|
||||
plain
|
||||
icon="el-icon-delete"
|
||||
size="mini"
|
||||
:disabled="multiple"
|
||||
@click="handleDelete"
|
||||
v-hasPermi="['machinery:info:remove']"
|
||||
>删除</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="warning"
|
||||
plain
|
||||
icon="el-icon-download"
|
||||
size="mini"
|
||||
@click="handleExport"
|
||||
v-hasPermi="['machinery:info:export']"
|
||||
>导出</el-button>
|
||||
</el-col>
|
||||
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
||||
</el-row>
|
||||
|
||||
<el-table v-loading="loading" :data="infoList" @selection-change="handleSelectionChange">
|
||||
<el-table-column type="selection" width="55" align="center" />
|
||||
<el-table-column label="机器编码" align="center" prop="machineCode" />
|
||||
<el-table-column label="出厂编号" align="center" prop="factoryNumber" />
|
||||
<el-table-column label="农机型号" align="center" prop="machineModel" />
|
||||
<el-table-column label="农机名称" align="center" prop="machineName" />
|
||||
<el-table-column label="农机类型" align="center" prop="machineTypeCode" />
|
||||
<el-table-column label="发码时间" align="center" prop="codeSendTime" width="180">
|
||||
<template slot-scope="scope">
|
||||
<span>{{ parseTime(scope.row.codeSendTime, '{y}-{m}-{d}') }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="备注" align="center" prop="remark" />
|
||||
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
||||
<template slot-scope="scope">
|
||||
<el-button
|
||||
size="mini"
|
||||
type="text"
|
||||
icon="el-icon-edit"
|
||||
@click="handleUpdate(scope.row)"
|
||||
v-hasPermi="['machinery:info:edit']"
|
||||
>修改</el-button>
|
||||
<el-button
|
||||
size="mini"
|
||||
type="text"
|
||||
icon="el-icon-delete"
|
||||
@click="handleDelete(scope.row)"
|
||||
v-hasPermi="['machinery:info:remove']"
|
||||
>删除</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
<pagination
|
||||
v-show="total>0"
|
||||
:total="total"
|
||||
:page.sync="queryParams.pageNum"
|
||||
:limit.sync="queryParams.pageSize"
|
||||
@pagination="getList"
|
||||
/>
|
||||
|
||||
<!-- 添加或修改数字农机编码管理对话框 -->
|
||||
<el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
|
||||
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
|
||||
<el-form-item label="机器编码" prop="machineCode">
|
||||
<el-input v-model="form.machineCode" placeholder="请输入机器编码" />
|
||||
</el-form-item>
|
||||
<el-form-item label="出厂编号" prop="factoryNumber">
|
||||
<el-input v-model="form.factoryNumber" placeholder="请输入出厂编号" />
|
||||
</el-form-item>
|
||||
<el-form-item label="农机型号" prop="machineModel">
|
||||
<el-input v-model="form.machineModel" placeholder="请输入农机型号" />
|
||||
</el-form-item>
|
||||
<el-form-item label="农机名称" prop="machineName">
|
||||
<el-input v-model="form.machineName" placeholder="请输入农机名称" />
|
||||
</el-form-item>
|
||||
<el-form-item label="农机类型" prop="machineTypeCode">
|
||||
<el-input v-model="form.machineTypeCode" placeholder="请输入农机类型" />
|
||||
</el-form-item>
|
||||
<el-form-item label="发码时间" prop="codeSendTime">
|
||||
<el-date-picker clearable
|
||||
v-model="form.codeSendTime"
|
||||
type="date"
|
||||
value-format="yyyy-MM-dd"
|
||||
placeholder="请选择发码时间">
|
||||
</el-date-picker>
|
||||
</el-form-item>
|
||||
<el-form-item label="备注" prop="remark">
|
||||
<el-input v-model="form.remark" placeholder="请输入备注" />
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button type="primary" @click="submitForm">确 定</el-button>
|
||||
<el-button @click="cancel">取 消</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { listInfo, getInfo, delInfo, addInfo, updateInfo } from "@/api/machinery/info";
|
||||
|
||||
export default {
|
||||
name: "Info",
|
||||
data() {
|
||||
return {
|
||||
// 遮罩层
|
||||
loading: true,
|
||||
// 选中数组
|
||||
ids: [],
|
||||
// 非单个禁用
|
||||
single: true,
|
||||
// 非多个禁用
|
||||
multiple: true,
|
||||
// 显示搜索条件
|
||||
showSearch: true,
|
||||
// 总条数
|
||||
total: 0,
|
||||
// 数字农机编码管理表格数据
|
||||
infoList: [],
|
||||
// 弹出层标题
|
||||
title: "",
|
||||
// 是否显示弹出层
|
||||
open: false,
|
||||
// 备注时间范围
|
||||
daterangeCodeSendTime: [],
|
||||
// 查询参数
|
||||
queryParams: {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
machineCode: null,
|
||||
factoryNumber: null,
|
||||
machineModel: null,
|
||||
machineName: null,
|
||||
machineTypeCode: null,
|
||||
codeSendTime: null,
|
||||
},
|
||||
// 表单参数
|
||||
form: {},
|
||||
// 表单校验
|
||||
rules: {
|
||||
}
|
||||
};
|
||||
},
|
||||
created() {
|
||||
this.getList();
|
||||
},
|
||||
methods: {
|
||||
/** 查询数字农机编码管理列表 */
|
||||
getList() {
|
||||
this.loading = true;
|
||||
this.queryParams.params = {};
|
||||
if (null != this.daterangeCodeSendTime && '' != this.daterangeCodeSendTime) {
|
||||
this.queryParams.params["beginCodeSendTime"] = this.daterangeCodeSendTime[0];
|
||||
this.queryParams.params["endCodeSendTime"] = this.daterangeCodeSendTime[1];
|
||||
}
|
||||
listInfo(this.queryParams).then(response => {
|
||||
this.infoList = response.rows;
|
||||
this.total = response.total;
|
||||
this.loading = false;
|
||||
});
|
||||
},
|
||||
// 取消按钮
|
||||
cancel() {
|
||||
this.open = false;
|
||||
this.reset();
|
||||
},
|
||||
// 表单重置
|
||||
reset() {
|
||||
this.form = {
|
||||
id: null,
|
||||
machineCode: null,
|
||||
factoryNumber: null,
|
||||
machineModel: null,
|
||||
machineName: null,
|
||||
machineTypeCode: null,
|
||||
codeSendTime: null,
|
||||
remark: null
|
||||
};
|
||||
this.resetForm("form");
|
||||
},
|
||||
/** 搜索按钮操作 */
|
||||
handleQuery() {
|
||||
this.queryParams.pageNum = 1;
|
||||
this.getList();
|
||||
},
|
||||
/** 重置按钮操作 */
|
||||
resetQuery() {
|
||||
this.daterangeCodeSendTime = [];
|
||||
this.resetForm("queryForm");
|
||||
this.handleQuery();
|
||||
},
|
||||
// 多选框选中数据
|
||||
handleSelectionChange(selection) {
|
||||
this.ids = selection.map(item => item.id)
|
||||
this.single = selection.length!==1
|
||||
this.multiple = !selection.length
|
||||
},
|
||||
/** 新增按钮操作 */
|
||||
handleAdd() {
|
||||
this.reset();
|
||||
this.open = true;
|
||||
this.title = "添加数字农机编码管理";
|
||||
},
|
||||
/** 修改按钮操作 */
|
||||
handleUpdate(row) {
|
||||
this.reset();
|
||||
const id = row.id || this.ids
|
||||
getInfo(id).then(response => {
|
||||
this.form = response.data;
|
||||
this.open = true;
|
||||
this.title = "修改数字农机编码管理";
|
||||
});
|
||||
},
|
||||
/** 提交按钮 */
|
||||
submitForm() {
|
||||
this.$refs["form"].validate(valid => {
|
||||
if (valid) {
|
||||
if (this.form.id != null) {
|
||||
updateInfo(this.form).then(response => {
|
||||
this.$modal.msgSuccess("修改成功");
|
||||
this.open = false;
|
||||
this.getList();
|
||||
});
|
||||
} else {
|
||||
addInfo(this.form).then(response => {
|
||||
this.$modal.msgSuccess("新增成功");
|
||||
this.open = false;
|
||||
this.getList();
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
/** 删除按钮操作 */
|
||||
handleDelete(row) {
|
||||
const ids = row.id || this.ids;
|
||||
this.$modal.confirm('是否确认删除数字农机编码管理编号为"' + ids + '"的数据项?').then(function() {
|
||||
return delInfo(ids);
|
||||
}).then(() => {
|
||||
this.getList();
|
||||
this.$modal.msgSuccess("删除成功");
|
||||
}).catch(() => {});
|
||||
},
|
||||
/** 导出按钮操作 */
|
||||
handleExport() {
|
||||
this.download('machinery/info/export', {
|
||||
...this.queryParams
|
||||
}, `info_${new Date().getTime()}.xlsx`)
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
372
god-ui/src/views/machinery/rule/index.vue
Normal file
372
god-ui/src/views/machinery/rule/index.vue
Normal file
@ -0,0 +1,372 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
|
||||
<el-form-item label="大类编码" prop="largeCategoryCode">
|
||||
<el-input
|
||||
v-model="queryParams.largeCategoryCode"
|
||||
placeholder="请输入大类编码"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="大类名称" prop="largeCategoryName">
|
||||
<el-input
|
||||
v-model="queryParams.largeCategoryName"
|
||||
placeholder="请输入大类名称"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="小类编码" prop="subclassCode">
|
||||
<el-input
|
||||
v-model="queryParams.subclassCode"
|
||||
placeholder="请输入小类编码"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="小类名称" prop="subclassName">
|
||||
<el-input
|
||||
v-model="queryParams.subclassName"
|
||||
placeholder="请输入小类名称"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="物品编码" prop="codeInfo">
|
||||
<el-input
|
||||
v-model="queryParams.codeInfo"
|
||||
placeholder="请输入物品编码"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="物品名称" prop="nameInfo">
|
||||
<el-input
|
||||
v-model="queryParams.nameInfo"
|
||||
placeholder="请输入物品名称"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<!-- <el-form-item label="数据类型" prop="dataType">-->
|
||||
<!-- <el-input-->
|
||||
<!-- v-model="queryParams.dataType"-->
|
||||
<!-- placeholder="请输入数据类型"-->
|
||||
<!-- clearable-->
|
||||
<!-- @keyup.enter.native="handleQuery"-->
|
||||
<!-- />-->
|
||||
<!-- </el-form-item>-->
|
||||
<el-form-item>
|
||||
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
|
||||
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
|
||||
<el-row :gutter="10" class="mb8">
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="primary"
|
||||
plain
|
||||
icon="el-icon-plus"
|
||||
size="mini"
|
||||
@click="handleAdd"
|
||||
v-hasPermi="['machinery:rule:add']"
|
||||
>新增</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="success"
|
||||
plain
|
||||
icon="el-icon-edit"
|
||||
size="mini"
|
||||
:disabled="single"
|
||||
@click="handleUpdate"
|
||||
v-hasPermi="['machinery:rule:edit']"
|
||||
>修改</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="danger"
|
||||
plain
|
||||
icon="el-icon-delete"
|
||||
size="mini"
|
||||
:disabled="multiple"
|
||||
@click="handleDelete"
|
||||
v-hasPermi="['machinery:rule:remove']"
|
||||
>删除</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="warning"
|
||||
plain
|
||||
icon="el-icon-download"
|
||||
size="mini"
|
||||
@click="handleExport"
|
||||
v-hasPermi="['machinery:rule:export']"
|
||||
>导出</el-button>
|
||||
</el-col>
|
||||
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
||||
</el-row>
|
||||
|
||||
<el-table v-loading="loading" :data="ruleList" @selection-change="handleSelectionChange" border :span-method="objectSpanMethod">
|
||||
<el-table-column type="selection" width="55" align="center" />
|
||||
<el-table-column label="大类编码" align="center" prop="largeCategoryCode" />
|
||||
<el-table-column label="大类名称" align="center" prop="largeCategoryName" />
|
||||
<el-table-column label="小类编码" align="center" prop="subclassCode" />
|
||||
<el-table-column label="小类名称" align="center" prop="subclassName" />
|
||||
<el-table-column label="物品编码" align="center" prop="codeInfo" />
|
||||
<el-table-column label="物品名称" align="center" prop="nameInfo" />
|
||||
<el-table-column label="备注" align="center" prop="remark" />
|
||||
<!-- <el-table-column label="数据类型" align="center" prop="dataType" />-->
|
||||
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
||||
<template slot-scope="scope">
|
||||
<el-button
|
||||
size="mini"
|
||||
type="text"
|
||||
icon="el-icon-edit"
|
||||
@click="handleUpdate(scope.row)"
|
||||
v-hasPermi="['machinery:rule:edit']"
|
||||
>修改</el-button>
|
||||
<el-button
|
||||
size="mini"
|
||||
type="text"
|
||||
icon="el-icon-delete"
|
||||
@click="handleDelete(scope.row)"
|
||||
v-hasPermi="['machinery:rule:remove']"
|
||||
>删除</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
<pagination
|
||||
v-show="total>0"
|
||||
:total="total"
|
||||
:page.sync="queryParams.pageNum"
|
||||
:limit.sync="queryParams.pageSize"
|
||||
@pagination="getList"
|
||||
/>
|
||||
|
||||
<!-- 添加或修改数字农机编码规则对话框 -->
|
||||
<el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
|
||||
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
|
||||
<el-form-item label="大类编码" prop="largeCategoryCode">
|
||||
<el-input v-model="form.largeCategoryCode" placeholder="请输入大类编码" />
|
||||
</el-form-item>
|
||||
<el-form-item label="大类名称" prop="largeCategoryName">
|
||||
<el-input v-model="form.largeCategoryName" placeholder="请输入大类名称" />
|
||||
</el-form-item>
|
||||
<el-form-item label="小类编码" prop="subclassCode">
|
||||
<el-input v-model="form.subclassCode" placeholder="请输入小类编码" />
|
||||
</el-form-item>
|
||||
<el-form-item label="小类名称" prop="subclassName">
|
||||
<el-input v-model="form.subclassName" placeholder="请输入小类名称" />
|
||||
</el-form-item>
|
||||
<el-form-item label="物品编码" prop="codeInfo">
|
||||
<el-input v-model="form.codeInfo" placeholder="请输入物品编码" />
|
||||
</el-form-item>
|
||||
<el-form-item label="物品名称" prop="nameInfo">
|
||||
<el-input v-model="form.nameInfo" placeholder="请输入物品名称" />
|
||||
</el-form-item>
|
||||
<el-form-item label="备注" prop="remark">
|
||||
<el-input v-model="form.remark" placeholder="请输入备注" />
|
||||
</el-form-item>
|
||||
<!-- <el-form-item label="数据类型" prop="dataType">-->
|
||||
<!-- <el-input v-model="form.dataType" placeholder="请输入数据类型" />-->
|
||||
<!-- </el-form-item>-->
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button type="primary" @click="submitForm">确 定</el-button>
|
||||
<el-button @click="cancel">取 消</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { listRule, getRule, delRule, addRule, updateRule } from "@/api/machinery/rule";
|
||||
|
||||
export default {
|
||||
name: "Rule",
|
||||
data() {
|
||||
return {
|
||||
// 遮罩层
|
||||
loading: true,
|
||||
// 选中数组
|
||||
ids: [],
|
||||
// 非单个禁用
|
||||
single: true,
|
||||
// 非多个禁用
|
||||
multiple: true,
|
||||
// 显示搜索条件
|
||||
showSearch: true,
|
||||
// 总条数
|
||||
total: 0,
|
||||
// 数字农机编码规则表格数据
|
||||
ruleList: [],
|
||||
// 弹出层标题
|
||||
title: "",
|
||||
// 是否显示弹出层
|
||||
open: false,
|
||||
// 查询参数
|
||||
queryParams: {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
largeCategoryCode: null,
|
||||
largeCategoryName: null,
|
||||
subclassCode: null,
|
||||
subclassName: null,
|
||||
codeInfo: null,
|
||||
nameInfo: null,
|
||||
dataType: null
|
||||
},
|
||||
// 表单参数
|
||||
form: {},
|
||||
// 表单校验
|
||||
rules: {
|
||||
}
|
||||
};
|
||||
},
|
||||
created() {
|
||||
this.getList();
|
||||
},
|
||||
methods: {
|
||||
//合并单元格
|
||||
objectSpanMethod({row, column, rowIndex, columnIndex}) {
|
||||
//数据来源,,和:data="originData" 相同
|
||||
const dataProvider = this.ruleList;
|
||||
const cellValue = row[column.property]
|
||||
//方式第一条错误
|
||||
if (rowIndex != 0) {
|
||||
let needMergeIndex = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11]
|
||||
if (cellValue && needMergeIndex.includes(columnIndex)) {
|
||||
// 上一条数据
|
||||
const prevRow = dataProvider[rowIndex - 1]
|
||||
// 下一条数据
|
||||
var nextRow = [];
|
||||
//该方法防止最后一条比较时 无法获取下一条
|
||||
if (rowIndex != dataProvider.length - 1) {
|
||||
nextRow = dataProvider[rowIndex + 1]
|
||||
} else {
|
||||
nextRow = dataProvider[rowIndex]
|
||||
}
|
||||
// 当上一条数据等于下一条数据,
|
||||
//row.ownerCode === prevRow.ownerCode用来限定合并依据需要加上合同编号判断
|
||||
if (prevRow && prevRow[column.property] == cellValue && row.codeInfo === prevRow.codeInfo) {
|
||||
return {rowspan: 0, colspan: 0}
|
||||
} else {
|
||||
let rowspan = 1
|
||||
//row.ownerCode === prevRow.ownerCode用来限定合并依据需要加上合同编号判断
|
||||
while (nextRow && nextRow[column.property] == cellValue && row.codeInfo === nextRow.codeInfo) {
|
||||
|
||||
rowspan++
|
||||
nextRow = dataProvider[rowspan + rowIndex]
|
||||
}
|
||||
if (rowspan > 1) {
|
||||
//返回为合并数据
|
||||
return {rowspan, colspan: 1}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
/** 查询数字农机编码规则列表 */
|
||||
getList() {
|
||||
this.loading = true;
|
||||
listRule(this.queryParams).then(response => {
|
||||
this.ruleList = response.rows;
|
||||
this.total = response.total;
|
||||
this.loading = false;
|
||||
});
|
||||
},
|
||||
// 取消按钮
|
||||
cancel() {
|
||||
this.open = false;
|
||||
this.reset();
|
||||
},
|
||||
// 表单重置
|
||||
reset() {
|
||||
this.form = {
|
||||
id: null,
|
||||
largeCategoryCode: null,
|
||||
largeCategoryName: null,
|
||||
subclassCode: null,
|
||||
subclassName: null,
|
||||
codeInfo: null,
|
||||
nameInfo: null,
|
||||
remark: null,
|
||||
dataType: null
|
||||
};
|
||||
this.resetForm("form");
|
||||
},
|
||||
/** 搜索按钮操作 */
|
||||
handleQuery() {
|
||||
this.queryParams.pageNum = 1;
|
||||
this.getList();
|
||||
},
|
||||
/** 重置按钮操作 */
|
||||
resetQuery() {
|
||||
this.resetForm("queryForm");
|
||||
this.handleQuery();
|
||||
},
|
||||
// 多选框选中数据
|
||||
handleSelectionChange(selection) {
|
||||
this.ids = selection.map(item => item.id)
|
||||
this.single = selection.length!==1
|
||||
this.multiple = !selection.length
|
||||
},
|
||||
/** 新增按钮操作 */
|
||||
handleAdd() {
|
||||
this.reset();
|
||||
this.open = true;
|
||||
this.title = "添加数字农机编码规则";
|
||||
},
|
||||
/** 修改按钮操作 */
|
||||
handleUpdate(row) {
|
||||
this.reset();
|
||||
const id = row.id || this.ids
|
||||
getRule(id).then(response => {
|
||||
this.form = response.data;
|
||||
this.open = true;
|
||||
this.title = "修改数字农机编码规则";
|
||||
});
|
||||
},
|
||||
/** 提交按钮 */
|
||||
submitForm() {
|
||||
this.$refs["form"].validate(valid => {
|
||||
if (valid) {
|
||||
if (this.form.id != null) {
|
||||
updateRule(this.form).then(response => {
|
||||
this.$modal.msgSuccess("修改成功");
|
||||
this.open = false;
|
||||
this.getList();
|
||||
});
|
||||
} else {
|
||||
addRule(this.form).then(response => {
|
||||
this.$modal.msgSuccess("新增成功");
|
||||
this.open = false;
|
||||
this.getList();
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
/** 删除按钮操作 */
|
||||
handleDelete(row) {
|
||||
const ids = row.id || this.ids;
|
||||
this.$modal.confirm('是否确认删除数字农机编码规则编号为"' + ids + '"的数据项?').then(function() {
|
||||
return delRule(ids);
|
||||
}).then(() => {
|
||||
this.getList();
|
||||
this.$modal.msgSuccess("删除成功");
|
||||
}).catch(() => {});
|
||||
},
|
||||
/** 导出按钮操作 */
|
||||
handleExport() {
|
||||
this.download('machinery/rule/export', {
|
||||
...this.queryParams
|
||||
}, `rule_${new Date().getTime()}.xlsx`)
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
Loading…
Reference in New Issue
Block a user