Commit c56a75de authored by 赵汉亭's avatar 赵汉亭

尺码组完成

parent 2ce04f71
......@@ -36,9 +36,12 @@ function loadSizeGroupListGrid() {
type: "string",
align: "left"
},
{display: "创建时间", name: "sizeGroupName", width: 120, minWidth: 60, type: "string", align: "left"},
{display: "修改人", name: "sizeGroupName", width: 100, minWidth: 60, type: "string", align: "left"},
{display: "修改时间", name: "sizeGroupName", width: 120, minWidth: 60, type: "string", align: "left"},
],
dataAction: "server",
url: web_app.name + '/technology/slicedTechnologyList.ajax',
url: web_app.name + '/sizeGroup/findSizeGroupList.ajax',
pageSize: 20,
usePager: true,
toolbar: toolbarOptions,
......@@ -54,3 +57,99 @@ function loadSizeGroupListGrid() {
});
UICtrl.setSearchAreaToggle(gridManager);
}
function query(obj) {
var param = $(obj).formToJSON();
UICtrl.gridSearch(gridManager, param);
}
function reloadGrid() {
gridManager.loadData();
}
function resetForm(obj) {
$(obj).formClean();
}
function addHandler() {
/*UICtrl.showAjaxDialog({
url: web_app.name + '/technology/addTechnologyDetail.load',
title: "新增工艺设置",
width: 1000,
ok: function (div) {
var _self = this;
$('#submitForm', div).ajaxSubmit({
url: web_app.name + '/technology/saveTechnology.ajax',
param: {
processList: getProcessList(),
},
success: function () {
_self.close();
reloadGrid();
}
});
}
});*/
UICtrl.addTabItem({
tabid: 'sizeGroupDetail',
text: "新增尺码组",
url: web_app.name + '/sizeGroup/addSizeGroupDetail.do'
})
}
function updateHandler(row) {
if (!row) {
row = DataUtil.getUpdateRow(gridManager);
if (!row) {
return;
}
}
/*UICtrl.showAjaxDialog({
url: web_app.name + '/technology/showTechnologyDetail.load',
title: "修改工艺设置",
width: 1000,
param: {technologyId: row.technologyId},
ok: function (div) {
var _self = this;
$('#submitForm', div).ajaxSubmit({
url: web_app.name + '/technology/updateTechnology.ajax',
param: {
processList: getProcessList(),
},
success: function () {
_self.close();
reloadGrid();
}
});
}
});*/
UICtrl.addTabItem({
tabid: 'sizeGroupDetail',
text: "修改尺码组",
url: web_app.name + '/sizeGroup/showSizeGroupDetail.do?sizeGroupId='+row.sizeGroupId
})
}
//删除按钮
function deleteHandler() {
DataUtil.del({
action: 'sizeGroup/deleteSizeGroupById.ajax',
gridManager: gridManager, idFieldName: 'sizeGroupId',
onSuccess: function () {
reloadGrid();
}
});
}
function getProcessList() {
var processList = null;
var processManager = UICtrl.getGridManager('#sizeGroupItemListGrid');
if (processManager) {
processList = DataUtil.getGridData({
gridManager: processManager,
isAllData: true
});
processList = Public.encodeJSONURI(processList);
}
return processList;
}
\ No newline at end of file
......@@ -15,19 +15,19 @@
</head>
<body>
<div class="container-fluid">
<div class="ui-hide">
<x:select name="processType" dictionary="processType" />
<x:select name="yesorno" dictionary="yesorno" />
</div>
<%-- <div class="ui-hide">--%>
<%-- <x:select name="processType" dictionary="processType" />--%>
<%-- <x:select name="yesorno" dictionary="yesorno" />--%>
<%-- </div>--%>
<div id="layout">
<div posinset="center" title="尺码组信息">
<div posinset="center" title="尺码组管理">
<x:title title="common.button.search" hideTable="queryMainForm" isHide="true" />
<form class="hg-form ui-hide" method="post" action="" id="queryMainForm">
<x:inputC name="ruleKind" required="false" label="尺码组名称" labelCol="1"/>
<x:searchButtons />
</form>
<div class="blank_div clearfix"></div>
<div id="technologyListGrid" style="margin: 2px;"></div>
<div id="sizeGroupListGrid" style="margin: 2px;"></div>
</div>
</div>
</div>
......
var sizeGroupGridManager = null;
$(document).ready(function () {
initializateUI();
loadSizeGroupListGrid();
//bindQueryEvent();
bindEvent();
});
function initializateUI() {
UICtrl.layout("#layout", {leftWidth: 3});
}
// 加载页码表格
function loadSizeGroupListGrid() {
var toolbarOptions = UICtrl.getDefaultToolbarOptions({
// 添加一行表格
addHandler: function () {
UICtrl.addGridRow(sizeGroupGridManager);
},
// 删除选中的尺码信息
deleteHandler: function () {
var _grid = UICtrl.getGridManager('#sizeGroupItemListGrid');
DataUtil.delSelectedRows({
action: 'sizeGroup/deleteSizeGroupItemById.ajax',
param: {},
gridManager: _grid,
idFieldName: 'sizeGroupItemId',
onSuccess: function () {
reloadGrid();
}
});
}
});
// 表格
sizeGroupGridManager = UICtrl.grid("#sizeGroupItemListGrid", {
gridManager: null,
columns: [
{
display: "尺码名称",
name: "sizeGroupItemName",
width: 100,
minWidth: 60,
type: "String",
align: "left",
editor: {
type: 'text',
required: true
}
},
{
display: "显示顺序",
name: "sizeGroupItemSequence",
width: 100,
minWidth: 60,
type: "String",
align: "left",
editor: {
type: 'text',
mask: 'nnn',
required: true
}
},
{
display: "备注",
name: "sizeGroupItemRemark",
width: 100,
minWidth: 60,
type: "String",
align: "left",
editor: {
type: 'text',
required: true
}
},
],
dataAction: "server",
url: web_app.name + '/sizeGroup/slicedSizeGroupItemList.ajax',
parms: {sizeGroupId: getId},
pageSize: 20,
usePager: true,
toolbar: toolbarOptions,
enabledEdit: true,
width: "98%",
height: "100%",
heightDiff: -8,
checkbox: true,
fixedCellHeight: true,
selectRowButtonOnly: true,
});
UICtrl.setSearchAreaToggle(sizeGroupGridManager);
}
function bindQueryEvent() {
$('#sizeGroupItemName').searchbox({
type: "sizeGroupItem", name: "sizeGroupItemCode",
onChange: function (value, data) {
$('#sizeGroupItemId').val(data.sizeGroupItemId);
$('#sizeGroupItemName').val(data.sizeGroupItemName);
}
});
}
// 定义点击事件
function bindEvent() {
$("#save").click(function () {
saveData("save");
})
$("#submit").click(function () {
saveData("submit");
})
$("#close").click(function () {//关闭
closeDispatchTabItem();
})
}
function getSizeGroupItemDetail(sizeGroupAction) {
//采购订单保存时数据不进行必填验证,提交时数据才进行必填验证
var op = {};
var check = true;
var sizeGroupItemList = [];
if (sizeGroupAction == "save") {
check = false;
}
op = {check: check};
var sizeGroup = $('#submitForm').formToJSON(op);
if (!sizeGroup) {
return false;
}
sizeGroupItemList = DataUtil.getGridData({
gridManager: sizeGroupGridManager, isAllData: true, onCheck: check})
if (!sizeGroupItemList) {
return false;
}
sizeGroup.sizeGroupItemList = $.toJSON(sizeGroupItemList);
return sizeGroup;
}
// 保存数据
function saveData(action) {
var sizeGroupItemDetail = getSizeGroupItemDetail("submit");
if (!sizeGroupItemDetail) {
return;
}
Public.ajax(web_app.name + '/sizeGroup/saveSizeGroup.ajax?code=' + action,sizeGroupItemDetail,
function (data) {
setId(data.sizeGroupId);
Public.successTip("数据保存成功");
sizeGroupGridManager.setParm('sizeGroupId', data.sizeGroupId);
sizeGroupGridManager.loadData();
}
);
}
// 关闭
function closeDispatchTabItem() {
UICtrl.closeCurrentTab();
}
function setId(value) {
$('#sizeGroupId').val(value);
}
function getId() {
return $("#sizeGroupId").val();
}
/**
* 刷新表格
*/
function reloadGrid(obj) {
sizeGroupGridManager.loadData();
}
<%--
Created by IntelliJ IDEA.
User: lenovo
Date: 2023/12/11
Time: 14:36
To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@taglib uri="/WEB-INF/taglib.tld" prefix="x"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<html>
<head>
<x:base include="layout,dialog,grid,tree,combox,commonTree" />
<x:script src='/biz/topsun/product/sizeGroupDetail.js'/></head>
<body>
<x:billTitle title="尺码组详情" needStatus="false" needPerson="true"/>
<div class="blank_div clearfix"></div>
<button class="btn btn-default" type="button" id="close" style="left: 200px;float:right;bottom: 10px;">关闭</button>
<button class="btn btn-warning" type="button" id="submit" style="left: 200px;float:right;bottom: 10px;">提交</button>
<button class="btn btn-success" type="button" id="save" style="left: 200px;float:right;bottom: 10px;">保存</button>
<form class="hg-form" method="post" action="" id="submitForm">
<x:hidden name="sizeGroupId" />
<x:hidden name="sizeGroupItemId"/>
<div class="hg-form-row">
<x:inputC name="sizeGroupCode" required="true" label="尺码组编码" labelCol="2" maxLength="64" fieldCol="4" />
<x:inputC name="sizeGroupName" required="true" label="尺码组名称" labelCol="2" maxLength="64" fieldCol="4" />
<x:selectC name="sizeGroupType" label="SIZE类型" labelCol="2" dictionary="sizeGroupType" fieldCol="4" />
</div>
<div class="blank_div clearfix"></div>
<x:title title="尺码设置" name="group" hideTable="#info" />
<div id="sizeGroupItemListGrid" style="margin: 2px;"></div>
</form>
</body>
</html>
package com.huigou.topsun.product.application;
import com.huigou.topsun.product.domain.SizeGroup;
import com.huigou.topsun.product.domain.query.SizeGroupQueryRequest;
import com.huigou.topsun.product.domain.vo.SizeGroupItemVo;
import com.huigou.topsun.product.domain.vo.SizeGroupVo;
import java.util.List;
import java.util.Map;
/**
......@@ -20,4 +22,18 @@ public interface SizeGroupApplication {
* 获取页码组列表
*/
Map<String,Object> getSizeGroupList(SizeGroupQueryRequest queryRequest);
SizeGroupVo saveSizeGroup(SizeGroupVo sizeGroupVo, List<SizeGroupItemVo> sizeGroupItemList);
void updateSizeGroup(SizeGroupVo sizeGroupVo, List<SizeGroupItemVo> sizeGroupItemList);
SizeGroupVo findSIzeGroupBySizeGroupId(String sizeGroupId);
void deleteSizeGroup(List<String> ids);
// Object slicedSizeGroupItemList(String sizeGroupId);
Object findBySizeGroupId(String sizeGroupId);
void deleteSizeGroupItemById(List<String> ids);
}
......@@ -4,14 +4,21 @@ import com.huigou.cache.DictUtil;
import com.huigou.data.query.model.QueryDescriptor;
import com.huigou.data.query.model.QueryModel;
import com.huigou.topsun.product.application.SizeGroupApplication;
import com.huigou.topsun.product.domain.SizeGroup;
import com.huigou.topsun.product.domain.SizeGroupItem;
import com.huigou.topsun.product.domain.query.SizeGroupQueryRequest;
import com.huigou.topsun.product.domain.vo.SizeGroupItemVo;
import com.huigou.topsun.product.domain.vo.SizeGroupVo;
import com.huigou.topsun.product.repository.SizeGroupItemRepository;
import com.huigou.topsun.product.repository.SizeGroupRepository;
import com.huigou.uasp.bmp.common.application.BaseApplication;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.Date;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
/**
* title:
......@@ -37,4 +44,136 @@ public class SizeGroupApplicationImpl extends BaseApplication implements SizeGro
model.putDictionary("sizeGroupType", DictUtil.getDictionary("sizeGroupType"));
return this.sqlExecutorDao.executeSlicedQuery(model);
}
/**
* 保存尺码组信息及尺码信息
*
* @param sizeGroupVo 尺码组信息
* @param sizeGroupItemList 尺码列表
* @return
*/
@Override
public SizeGroupVo saveSizeGroup(SizeGroupVo sizeGroupVo, List<SizeGroupItemVo> sizeGroupItemList) {
// 获取尺码组对象
SizeGroup sizeGroup = SizeGroupVo.getSizeGroup(sizeGroupVo);
// 封装时间信息
// SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
long timestamp = System.currentTimeMillis();
sizeGroup.setCreatedDate(new Date(timestamp));
sizeGroup = save(sizeGroupItemList, sizeGroup);
sizeGroupVo.setSizeGroupId(sizeGroup.getSizeGroupId());
return sizeGroupVo;
}
/**
* 修改尺码组信息
*
* @param sizeGroupVo
* @param sizeGroupItemList
*/
@Override
public void updateSizeGroup(SizeGroupVo sizeGroupVo, List<SizeGroupItemVo> sizeGroupItemList) {
// 获取尺码组对象
SizeGroup sizeGroup = SizeGroupVo.getSizeGroup(sizeGroupVo);
// 封装时间信息
// SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
long timestamp = System.currentTimeMillis();
sizeGroup.setLastModifiedDate(new Date(timestamp));
// 获取原有信息
SizeGroup old = sizeGroupRepository.findOne(sizeGroup.getSizeGroupId());
// 封装原有创建人信息到VO对象中
sizeGroup.setCreatedById(old.getCreatedById());
sizeGroup.setCreatedByName(old.getCreatedByName());
sizeGroup.setCreatedDate(old.getCreatedDate());
// 保存修改的信息
save(sizeGroupItemList, sizeGroup);
}
/**
* 根据sizeGroupId获取尺码组信息
* @param sizeGroupId
* @return
*/
@Override
public SizeGroupVo findSIzeGroupBySizeGroupId(String sizeGroupId) {
SizeGroup sizeGroup = sizeGroupRepository.findOne(sizeGroupId);
return SizeGroupVo.getSizeGroupVo(sizeGroup);
}
/**
* 删除尺码组信息及相关尺码
* @param ids
*/
@Override
public void deleteSizeGroup(List<String> ids) {
ids.forEach(sizeGroupId->{
List<SizeGroupItem> sizeGroupItemList = findBySizeGroupId(sizeGroupId);
List<String> sizeGroupItemIds = sizeGroupItemList
.stream()
.map(SizeGroupItem::getSizeGroupItemId)
.collect(Collectors.toList());
//删除尺码组相关的尺码信息
deleteBySizeGroupItemIds(sizeGroupItemIds);
//删除尺码组
sizeGroupRepository.delete(sizeGroupId);
});
}
// @Override
// public Object slicedSizeGroupItemList(String sizeGroupId) {
// QueryDescriptor queryDescriptor = this.sqlExecutorDao.getQuery(QUERY_XML_FILE_PATH, "slicedTechnologyProcessList");
// String sql = queryDescriptor.getSql();
// return this.sqlExecutorDao.queryToListMap(sql,sizeGroupId);
// return findBySizeGroupId(sizeGroupId);
// }
/**
* 提取方法--保存尺码组信息、尺码列表信息到数据库
*/
private SizeGroup save(List<SizeGroupItemVo> sizeGroupItemList, SizeGroup sizeGroup) {
// 保存
sizeGroup = sizeGroupRepository.saveAndFlush(sizeGroup);
// 保存尺码信息
if (!sizeGroupItemList.isEmpty()) {
// 尺码信息不为空,保存尺码列表
String sizeGroupId = sizeGroup.getSizeGroupId();
for (SizeGroupItemVo sizeGroupItemVo : sizeGroupItemList) {
SizeGroupItem sizeGroupItem = SizeGroupItemVo.getSizeGroupItem(sizeGroupItemVo);
sizeGroupItem.setSizeGroupId(sizeGroupId);
sizeGroupItemRepository.saveAndFlush(sizeGroupItem);
}
}
return sizeGroup;
}
/**
* 删除尺码列表
*/
public void deleteBySizeGroupItemIds(List<String> sizeGroupItemIds) {
List<SizeGroupItem> sizeGroupItemList = sizeGroupItemRepository.findAll(sizeGroupItemIds);
sizeGroupItemRepository.delete(sizeGroupItemList);
}
/**
* 查找尺码组下的尺码列表
*/
@Override
public List<SizeGroupItem> findBySizeGroupId(String sizeGroupId) {
QueryDescriptor queryDescriptor = this.sqlExecutorDao.getQuery(QUERY_XML_FILE_PATH, "findBySizeGroupId");
String sql = queryDescriptor.getSql();
return this.sqlExecutorDao.queryToList(sql,SizeGroupItem.class,sizeGroupId);
// return sizeGroupItemRepository.findBySizeGroupId(sizeGroupId);
}
@Override
public void deleteSizeGroupItemById(List<String> ids) {
for (String id : ids) {
sizeGroupItemRepository.delete(id);
}
}
}
package com.huigou.topsun.product.controller;
import com.huigou.cache.DictUtil;
import com.huigou.topsun.product.application.SizeGroupApplication;
import com.huigou.topsun.product.domain.SizeGroup;
import com.huigou.topsun.product.domain.query.SizeGroupQueryRequest;
import com.huigou.topsun.product.domain.vo.SizeGroupItemVo;
import com.huigou.topsun.product.domain.vo.SizeGroupVo;
import com.huigou.uasp.annotation.ControllerMapping;
import com.huigou.uasp.client.CommonController;
import com.huigou.util.SDO;
import com.huigou.util.StringUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
......@@ -28,15 +30,29 @@ public class SizeGroupController extends CommonController {
@Override
protected String getPagePath() {
return "/biz/topsun/sizeGroup/";
return "/biz/topsun/product/";
}
/**
* 跳转到尺码组页面
*/
public String forwardSizeGroupList() {
Map<String, String> processType = DictUtil.getDictionary("processType");
this.putAttribute("processType", processType);
return forward("sizeGroup");
}
/**
* 跳转到尺码组添加/修改/明细页面
*/
public String addSizeGroupDetail(){
return forward("sizeGroupDetail");
}
/**
* 获取尺码组列表(分页)
*/
public String findSizeGroupList(){
// TODO
public String findSizeGroupList() {
SDO sdo = this.getSDO();
SizeGroupQueryRequest sizeGroupQueryRequest = sdo.toQueryRequest(SizeGroupQueryRequest.class);
......@@ -46,59 +62,92 @@ public class SizeGroupController extends CommonController {
/**
* 添加新的尺码组信息
*/
public String addSizeGroup(){
//TODO
return "";
public String saveSizeGroup() {
SDO sdo = this.getSDO();
SizeGroupVo sizeGroupVo = sdo.toObject(SizeGroupVo.class);
List<SizeGroupItemVo> sizeGroupItemList = sdo.getList("sizeGroupItemList", SizeGroupItemVo.class);
// 获取操作人信息
String personMemberId = sdo.getOperator().getPersonMemberId();
String personMemberName = sdo.getOperator().getPersonMemberName();
if (StringUtil.isNotBlank(sizeGroupVo.getSizeGroupId())) {
// 封装修改人信息
sizeGroupVo.setLastModifiedById(personMemberId);
sizeGroupVo.setLastModifiedByName(personMemberName);
// 修改尺码组信息和尺码信息
sizeGroupApplication.updateSizeGroup(sizeGroupVo, sizeGroupItemList);
} else {
// 封装创建人信息
sizeGroupVo.setCreatedById(personMemberId);
sizeGroupVo.setCreatedByName(personMemberName);
sizeGroupVo = sizeGroupApplication.saveSizeGroup(sizeGroupVo, sizeGroupItemList);
}
return success(sizeGroupVo);
}
/**
* 编辑选中的尺码组信息
*/
public String updateSizeGroup(){
//TODO
return "";
}
// public String updateSizeGroup() {
// return "";
// }
/**
* 删除选中的尺码组
*/
public String deleteSizeGroupById(){
//TODO
return "";
public String deleteSizeGroupById() {
SDO sdo = this.getSDO();
List<String> ids = sdo.getIds();
sizeGroupApplication.deleteSizeGroup(ids);
return success();
}
/**
* 根据尺码组id获取尺码列表
*/
public String findSizeGroupItemByGroupId(){
//TODO
public String findSizeGroupItemByGroupId() {
return "";
}
/**
* 添加尺码
*/
public String addSizeGroupItem(){
//TODO
public String saveSizeGroupItem() {
return "";
}
/**
* 修改尺码
*/
public String updateSizeGroupItem(){
//TODO
public String updateSizeGroupItem() {
return "";
}
/**
* 删除尺码
*/
public String deleteSizeGroupItemById(){
//TODO
return "";
}
public String deleteSizeGroupItemById() {
SDO sdo = this.getSDO();
List<String> ids = sdo.getIds();
sizeGroupApplication.deleteSizeGroupItemById(ids);
return success();
}
/**
* 查看尺码组明细
*/
public String showSizeGroupDetail() {
SDO sdo = this.getSDO();
String sizeGroupId = sdo.getString("sizeGroupId");
// this.putAttribute("productName", "1");
SizeGroupVo sizeGroupVo = sizeGroupApplication.findSIzeGroupBySizeGroupId(sizeGroupId);
return forward("sizeGroupDetail", sizeGroupVo);
}
public String slicedSizeGroupItemList(){
SDO sdo = this.getSDO();
String sizeGroupId = sdo.getString("sizeGroupId");
return packGridDataAndResult(sizeGroupApplication.findBySizeGroupId(sizeGroupId));
}
}
......@@ -7,11 +7,16 @@ import javax.persistence.*;
import lombok.Data;
import org.hibernate.annotations.GenericGenerator;
import javax.persistence.*;
import java.io.Serializable;
import java.util.Date;
/**
* 尺码组主表
*
* @TableName size_group
*/
@Table(name="size_group")
@Table(name = "size_group")
@Data
@Entity
public class SizeGroup implements Serializable {
......@@ -79,4 +84,58 @@ public class SizeGroup implements Serializable {
private Date lastModifiedDate;
private static final long serialVersionUID = 1L;
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
SizeGroup other = (SizeGroup) o;
return (this.getSizeGroupId() == null ? other.getSizeGroupId() == null : this.getSizeGroupId().equals(other.getSizeGroupId()))
&& (this.getSizeGroupName() == null ? other.getSizeGroupName() == null : this.getSizeGroupName().equals(other.getSizeGroupName()))
&& (this.getSizeGroupCode() == null ? other.getSizeGroupCode() == null : this.getSizeGroupCode().equals(other.getSizeGroupCode()))
&& (this.getSizeGroupType() == null ? other.getSizeGroupType() == null : this.getSizeGroupType().equals(other.getSizeGroupType()))
&& (this.getCreatedDate() == null ? other.getCreatedDate() == null : this.getCreatedDate().equals(other.getCreatedDate()))
&& (this.getCreatedByName() == null ? other.getCreatedByName() == null : this.getCreatedByName().equals(other.getCreatedByName()))
&& (this.getCreatedById() == null ? other.getCreatedById() == null : this.getCreatedById().equals(other.getCreatedById()))
&& (this.getLastModifiedDate() == null ? other.getLastModifiedDate() == null : this.getLastModifiedDate().equals(other.getLastModifiedDate()))
&& (this.getLastModifiedById() == null ? other.getLastModifiedById() == null : this.getLastModifiedById().equals(other.getLastModifiedById()))
&& (this.getLastModifiedByName() == null ? other.getLastModifiedByName() == null : this.getLastModifiedByName().equals(other.getLastModifiedByName()));
}
@Override
public int hashCode() {
final int prime = 1;
int result = 1;
result = prime * result + ((getSizeGroupId() == null) ? 0 : getSizeGroupId().hashCode());
result = prime * result + ((getSizeGroupCode() == null) ? 0 : getSizeGroupCode().hashCode());
result = prime * result + ((getSizeGroupName() == null) ? 0 : getSizeGroupName().hashCode());
result = prime * result + ((getSizeGroupType() == null) ? 0 : getSizeGroupType().hashCode());
result = prime * result + ((getCreatedDate() == null) ? 0 : getCreatedDate().hashCode());
result = prime * result + ((getCreatedById() == null) ? 0 : getCreatedById().hashCode());
result = prime * result + ((getCreatedByName() == null) ? 0 : getCreatedByName().hashCode());
result = prime * result + ((getLastModifiedDate() == null) ? 0 : getLastModifiedDate().hashCode());
result = prime * result + ((getLastModifiedById() == null) ? 0 : getLastModifiedById().hashCode());
result = prime * result + ((getLastModifiedByName() == null) ? 0 : getLastModifiedByName().hashCode());
return result;
}
@Override
public String toString() {
StringBuilder stringBuilder = new StringBuilder();
stringBuilder.append(getClass().getSimpleName());
stringBuilder.append(" [");
stringBuilder.append("Hash = ").append(hashCode());
stringBuilder.append("sizeGroupId=").append(sizeGroupId);
stringBuilder.append(", sizeGroupName=").append(sizeGroupName);
stringBuilder.append(", sizeGroupCode=").append(sizeGroupCode);
stringBuilder.append(", sizeGroupType=").append(sizeGroupType);
stringBuilder.append(", createdByName=").append(createdByName);
stringBuilder.append(", createdById=").append(createdById);
stringBuilder.append(", createdDate=").append(createdDate);
stringBuilder.append(", lastModifiedById=").append(lastModifiedById);
stringBuilder.append(", lastModifiedByName=").append(lastModifiedByName);
stringBuilder.append(", lastModifiedDate=").append(lastModifiedDate);
stringBuilder.append("]");
return stringBuilder.toString();
}
}
\ No newline at end of file
package com.huigou.topsun.product.domain.vo;
import com.alibaba.fastjson.JSON;
import com.huigou.topsun.product.domain.SizeGroupItem;
import com.huigou.topsun.technology.vo.TechnologyProcessVo;
import lombok.Data;
import java.io.Serializable;
/**
* title:
* author:ZHT
* date:2023/12/12
* description:
*/
@Data
public class SizeGroupItemVo implements Serializable{
/**
* 尺码id
*/
private String sizeGroupItemId;
/**
* 尺码组id
*/
private String sizeGroupId;
/**
* 尺码名称
*/
private String sizeGroupItemName;
/**
* 显示顺序
*/
private Integer sizeGroupItemSequence;
/**
* 备注
*/
private String sizeGroupItemRemark;
public static SizeGroupItem getSizeGroupItem(SizeGroupItemVo sizeGroupItemVo){
return JSON.parseObject(JSON.toJSONString(sizeGroupItemVo), SizeGroupItem.class);
}
public static SizeGroupItemVo getProcessVo(SizeGroupItem process){
return JSON.parseObject(JSON.toJSONString(process), SizeGroupItemVo.class);
}
}
package com.huigou.topsun.product.domain.vo;
import com.alibaba.fastjson.JSON;
import com.huigou.topsun.product.domain.SizeGroup;
import lombok.Data;
import java.io.Serializable;
import java.util.Date;
/**
* title:
* author:ZHT
* date:2023/12/11
* description:
*/
@Data
public class SizeGroupVo implements Serializable {
/**
* 尺码组id
*/
private String sizeGroupId;
/**
* 尺码组名称
*/
private String sizeGroupName;
/**
* 尺码组编码
*/
private String sizeGroupCode;
/**
* 尺码组类型
*/
private String sizeGroupType;
/**
* 录入人
*/
private String createdByName;
/**
* 录入人id
*/
private String createdById;
/**
* 录入时间
*/
private Date createdDate;
/**
* 修改人id
*/
private String lastModifiedById;
/**
* 修改人
*/
private String lastModifiedByName;
/**
* 修改日期
*/
private Date lastModifiedDate;
public static SizeGroupVo getSizeGroupVo(SizeGroup sizeGroup){
return JSON.parseObject(JSON.toJSONString(sizeGroup), SizeGroupVo.class);
}
public static SizeGroup getSizeGroup(SizeGroupVo sizeGroupVo){
return JSON.parseObject(JSON.toJSONString(sizeGroupVo),SizeGroup.class);
}
}
......@@ -3,6 +3,8 @@ package com.huigou.topsun.product.repository;
import com.huigou.topsun.product.domain.SizeGroupItem;
import org.springframework.data.jpa.repository.JpaRepository;
import java.util.List;
/**
* title:
* author:ZHT
......@@ -10,4 +12,5 @@ import org.springframework.data.jpa.repository.JpaRepository;
* description:
*/
public interface SizeGroupItemRepository extends JpaRepository<SizeGroupItem,String> {
List<SizeGroupItem> findBySizeGroupId(String sizeGroupId);
}
......@@ -6,4 +6,16 @@
select t.* from size_group t
</sql-query>
</query>
<query name="findBySizeGroupId" label="页码表" table="size_group_item">
<sql-query>
SELECT
t.*
FROM size_group_item t
WHERE
size_group_id = ?
ORDER BY size_group_item_sequence
</sql-query>
</query>
</query-mappings>
\ No newline at end of file
Markdown is supported
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