Commit a9a443da authored by 鲁鑫's avatar 鲁鑫

报价流程

parent 07af99f6
var bomGridManager = null, technologyGridManager = null;
$(document).ready(function () {
initializateUI();
initializateBomGrid();
initializateTechnologyGrid();
});
function initializateUI() {
UICtrl.layout("#layout", {leftWidth: 3});
appendTaskinstRelations(null);
}
function initializateBomGrid() {
var toolbarOptions = UICtrl.getDefaultToolbarOptions({
addHandler: function(){
UICtrl.addGridRow(bomGridManager);
},
});
bomGridManager = UICtrl.grid("#bomGrid", {
columns: [
{
display: "产品编码", name: "productCode", width: 140, minWidth: 60, type: "string", align: "left",
editor: {
data: {
type: 'system',
name: "productChoose",
back: {
productId: "productId",
productCode: "productCode",
productName: "productName",
productUnit: "productUnit",
}
},
required: true,
type: "select"
}
},
{display: "产品名称", name: "productName", width: 120, minWidth: 60, type: "string", align: "left"},
{display: "单位", name: "productUnit", width: 120, minWidth: 60, type: "string", align: "left"},
{
display: "币别", name: "currency", width: 140, minWidth: 60, type: "string", align: "left",
editor: {
required: true,
type: 'text'
}
},
{
display: "单价", name: "price", width: 120, minWidth: 60, type: "string", align: "left",
editor: {
required: true,
type: 'text',
mask: '9999999.99'
}
},
{
display: "备注", name: "remark", width: 140, minWidth: 60, type: "string", align: "left",
editor: {
required: true,
type: 'text'
}
},
],
dataAction: "server",
url: web_app.name + '/quotationItem/queryQuotationItemList.ajax',
parms: {quotationId: getId()},
pageSize: 20,
usePager: true,
toolbar: toolbarOptions,
enabledEdit: true,
width: "100%",
height: "400",
heightDiff: -8,
checkbox: true,
fixedCellHeight: true,
selectRowButtonOnly: true,
onDblClickRow: function (data, rowindex, rowobj) {
updateHandler(data.proofingMakeId);
},
onAfterShowData: function (currentData) {
setTimeout(function () {
//加载工艺
reloadTechnologyGrid();
},200)
},
onAfterEdit:function (item) {
//加载工艺
if (item.column.name == "productCode") {
reloadTechnologyGrid();
}
}
});
UICtrl.setSearchAreaToggle(bomGridManager);
}
function initializateTechnologyGrid() {
var toolbarOptions = UICtrl.getDefaultToolbarOptions({});
technologyGridManager = UICtrl.grid("#technologyGrid", {
columns: [
{display: "工艺", name: "technologyName", width: 140, minWidth: 60, type: "string", align: "left"},
{display: "工序", name: "processName", width: 120, minWidth: 60, type: "string", align: "left"},
{display: "资源", name: "resourceName", width: 120, minWidth: 60, type: "string", align: "left"},
],
dataAction: "server",
url: web_app.name + '/technology/queryTechnologyByProduct.ajax',
//parms: {productId: getId()},
pageSize: 20,
usePager: true,
toolbar: toolbarOptions,
width: "100%",
height: "400",
heightDiff: -8,
checkbox: true,
fixedCellHeight: true,
selectRowButtonOnly: true,
onDblClickRow: function (data, rowindex, rowobj) {
updateHandler(data.proofingMakeId);
}
});
UICtrl.setSearchAreaToggle(technologyGridManager);
}
function reloadGrid() {
bomGridManager.loadData();
}
function reloadTechnologyGrid(){
var datas = bomGridManager.rows;
var productIdList=[];
if (datas){
datas.forEach(data=>{
var productId = data.productId;
productIdList.push(productId);
})
}
var param = {ids:$.toJSON(productIdList)};
$('#technologyGrid').ligerGetGridManager().options.url =web_app.name + '/technology/queryTechnologyByProduct.ajax';
_grid = UICtrl.getGridManager('#technologyGrid');
UICtrl.gridSearch(_grid, param);
}
//获取数据保存的参数
function getExtendedData(processAction) {
//回退、打回、转交时,不需要验证必填项是否已经填写;
if (processAction == ProcessAction.BACK
|| processAction == ProcessAction.REPLENISH
|| processAction == ProcessAction.TRANSMIT) {
//不验证
$('#submitForm').attr('check', false);
}
const isAllData = $('#oldId') || !getId();
var extendedData = {};
var _grid = UICtrl.getGridManager('#bomGrid');
if (_grid) {
var datas = DataUtil.getGridData({
gridManager: _grid,
isAllData: isAllData
});
if (!datas) {
return false;
}
extendedData.quotationItems = Public.encodeJSONURI(datas);
}
return extendedData;
}
function getId() {
return $("#quotationId").val() || "";
}
function setId(value) {
$("#quotationId").val(value);
}
<%@ 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="date,layout,grid,combox,tree,comboDialog,attachment"/>
<x:script src="/biz/topsun/quotation/quotationDetail.js"/>
</head>
<body>
<div class="container-fluid">
<x:billTitle title="报价需求单" needStatus="false" needPerson="true"/>
<div class="blank_div clearfix"></div>
<form class="hg-form" method="post" action="" id="submitForm">
<x:hidden name="id" id="quotationId"/>
<x:hidden name="productIds"/>
<x:hidden name="billCode"/>
<x:hidden name="fillinDate"/>
<x:hidden name="fullId"/>
<x:hidden name="organId"/>
<x:hidden name="organName"/>
<x:hidden name="deptId"/>
<x:hidden name="deptName"/>
<x:hidden name="positionId"/>
<x:hidden name="positionName"/>
<x:hidden name="personMemberId"/>
<x:hidden name="personMemberName"/>
<div class="hg-form-cols">
<div class="hg-form-row">
<x:selectC name="quotationType" label="报价单类型" dictionary="quotationType" labelCol="1" fieldCol="2"/>
<x:inputC name="quotationNo" label="报价单号" readonly="true" maxLength="32" labelCol="1" fieldCol="2"/>
<x:inputC name="customerManagerId" label="客户名称" labelCol="1" fieldCol="2"/>
</div>
</div>
<x:title title="BOM信息" name="group" hideTable="#info" />
<div id="bomGrid" style="margin: 2px;"></div>
<x:title title="工艺信息" name="group" hideTable="#info" />
<div id="technologyGrid" style="margin: 2px;"></div>
</form>
</div>
</body>
</html>
\ No newline at end of file
var gridManager = null;
$(document).ready(function () {
initializateUI();
loadQuotationListGrid();
});
function initializateUI() {
UICtrl.layout("#layout", {leftWidth: 3});
}
function loadQuotationListGrid() {
var toolbarOptions = UICtrl.getDefaultToolbarOptions({
addHandler: function () {
addHandler();
},
/*updateHandler: function(){
updateHandler();
},
deleteHandler: deleteHandler,*/
});
gridManager = UICtrl.grid("#quotationListGrid", {
columns: [
{
display: "报价单类型",
name: "quotationTypeTextView",
width: 140,
minWidth: 60,
type: "string",
align: "left"
},
{
display: "品牌/工厂客户",
name: "customerManagerId",
width: 120,
minWidth: 60,
type: "string",
align: "left"
},
{display: "报价日期", name: "quotationDate", width: 120, minWidth: 60, type: "string", align: "left"},
{display: "报价单号", name: "quotationNo", width: 100, minWidth: 60, type: "string", align: "left"},
{display: "客户是否签回", name: "customerSignBackTextView", width: 100, minWidth: 60, type: "string", align: "left"},
{display: "创建人", name: "personMemberName", width: 100, minWidth: 60, type: "string", align: "left"},
],
dataAction: "server",
url: web_app.name + '/quotation/slicedQuotationList.ajax',
pageSize: 20,
usePager: true,
toolbar: toolbarOptions,
width: "100%",
height: "100%",
heightDiff: -8,
checkbox: true,
fixedCellHeight: true,
selectRowButtonOnly: true,
onDblClickRow: function (data, rowindex, rowobj) {
updateHandler(data);
}
});
UICtrl.setSearchAreaToggle(gridManager);
}
function addHandler(){
UICtrl.addTabItem({
tabid: 'addQuotation',
text: "新增报价需求单",
url: web_app.name + '/quotation/forwardAddQuotation.job'
});
}
function query(obj) {
var param = $(obj).formToJSON();
UICtrl.gridSearch(gridManager, param);
}
function reloadGrid() {
gridManager.loadData();
}
function resetForm(obj) {
$(obj).formClean();
}
<%@ page language="java" contentType="text/html; charset=utf-8"%>
<%@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/quotation/quotationList.js'/>
</head>
<body>
<div class="container-fluid">
<div class="ui-hide">
<x:select name="processType" dictionary="processType" />
<x:select name="yesorno" dictionary="yesorno" />
</div>
<div id="layout">
<div position="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="quotationNo" required="false" label="报价单号" labelCol="1"/>
<x:searchButtons />
</form>
<div class="blank_div clearfix"></div>
<div id="quotationListGrid" style="margin: 2px;"></div>
</div>
</div>
</div>
</body>
</html>
\ No newline at end of file
...@@ -15,9 +15,7 @@ import org.springframework.data.domain.PageRequest; ...@@ -15,9 +15,7 @@ import org.springframework.data.domain.PageRequest;
import org.springframework.stereotype.Controller; import org.springframework.stereotype.Controller;
import javax.annotation.Resource; import javax.annotation.Resource;
import java.util.Arrays; import java.util.*;
import java.util.List;
import java.util.Map;
/** /**
* @Auther: xin.lu * @Auther: xin.lu
...@@ -79,4 +77,36 @@ public class ResourceSearchController { ...@@ -79,4 +77,36 @@ public class ResourceSearchController {
Map<String, Object> model = memEasySearcher.search(mapList, easySearchParse, pageRequest, null); Map<String, Object> model = memEasySearcher.search(mapList, easySearchParse, pageRequest, null);
return model; return model;
} }
@EasySearch(queryName = "productChoose")
public Map<String, Object> productChoose(SDO sdo){
Integer intPage = sdo.getInteger("intPage", 1);
Integer pageSize = sdo.getInteger("pageSize",10);
PageRequest pageRequest = new PageRequest(intPage - 1, pageSize);
List<QuerySchemeField> fields =
Arrays.asList(new QuerySchemeField("productId", "productId", "hidden"),
new QuerySchemeField("产品编码", "productCode", "string", 200L),
new QuerySchemeField("产品名称", "productName", "hidden", 200L),
new QuerySchemeField("计量单位", "productUnit", "string", 100L)
);
EasySearchParse easySearchParse = new EasySearchParse();
easySearchParse.setFields(fields);
easySearchParse.setWidth(450L);
Map<String ,Object> map = new HashMap<>();
map.put("productId","1");
map.put("productCode","1");
map.put("productName","测试");
map.put("productUnit","张");
Map<String ,Object> map2 = new HashMap<>();
map2.put("productId","2");
map2.put("productCode","2");
map2.put("productName","测试2");
map2.put("productUnit","张");
List<Map<String,Object>> mapList = new ArrayList<>();
mapList.add(map);
mapList.add(map2);
MemEasySearcher<Map<String, Object>> memEasySearcher = new MemEasySearcherImpl<>();
Map<String, Object> model = memEasySearcher.search(mapList, easySearchParse, pageRequest, null);
return model;
}
} }
package com.huigou.topsun.quotation.application;
/**
* @author 16508
* @description 针对表【customer_manager(客户管理)】的数据库操作Service
* @createDate 2023-11-28 13:59:10
*/
public interface CustomerManagerApplication {
}
package com.huigou.topsun.quotation.application;
/**
* @author 16508
* @description 针对表【customer_quotation_rule(客户报价规则)】的数据库操作Service
* @createDate 2023-11-28 13:59:10
*/
public interface CustomerQuotationRuleApplication {
}
package com.huigou.topsun.quotation.application;
import com.huigou.topsun.quotation.domain.model.Quotation;
import com.huigou.topsun.quotation.domain.query.QuotationQueryRequest;
import java.util.Map;
/**
* @author 16508
* @description 针对表【quotation(报价单)】的数据库操作Service
* @createDate 2023-11-28 13:59:10
*/
public interface QuotationApplication {
public static final String QUERY_XML_FILE_PATH = "config/topsun/quotation/quotation.xml";
String PROCESS_DEFINITION_KEY = "quotationProc";
Quotation findById(String id);
Quotation saveQuotation(Quotation quotation);
Map<String,Object> slicedQuotationList(QuotationQueryRequest queryRequest);
}
package com.huigou.topsun.quotation.application;
import com.huigou.topsun.quotation.domain.model.QuotationItem;
import com.huigou.topsun.quotation.vo.QuotationItemVo;
import java.util.List;
/**
* @author 16508
* @description 针对表【quotation_item(报价单明细)】的数据库操作Service
* @createDate 2023-11-28 13:59:10
*/
public interface QuotationItemApplication {
public static final String QUERY_XML_FILE_PATH = "config/topsun/quotation/quotationItem.xml";
void saveQuotationItems(String quotationId,List<QuotationItem> quotationItem);
void deleteQuotationItem(List<String> ids);
void deleteQuotationItemByQuotationId(String quotationId);
List<QuotationItem> findQuotationItemByQuotationId(String quotationId);
QuotationItem findById(String id);
List<QuotationItemVo> queryQuotationItemList(String quotationId);
}
package com.huigou.topsun.quotation.application.impl;
import com.huigou.topsun.quotation.application.CustomerManagerApplication;
import com.huigou.uasp.bmp.common.application.BaseApplication;
import org.springframework.stereotype.Service;
/**
* @author 16508
* @description 针对表【customer_manager(客户管理)】的数据库操作Service实现
* @createDate 2023-11-28 13:59:10
*/
@Service
public class CustomerManagerApplicationImpl extends BaseApplication implements CustomerManagerApplication {
}
package com.huigou.topsun.quotation.application.impl;
import com.huigou.topsun.quotation.application.CustomerQuotationRuleApplication;
import com.huigou.uasp.bmp.common.application.BaseApplication;
import org.springframework.stereotype.Service;
/**
* @author 16508
* @description 针对表【customer_quotation_rule(客户报价规则)】的数据库操作Service实现
* @createDate 2023-11-28 13:59:10
*/
@Service
public class CustomerQuotationRuleApplicationImpl extends BaseApplication implements CustomerQuotationRuleApplication {
}
package com.huigou.topsun.quotation.application.impl;
import com.huigou.data.query.model.QueryDescriptor;
import com.huigou.topsun.quotation.application.QuotationItemApplication;
import com.huigou.topsun.quotation.domain.model.Quotation;
import com.huigou.topsun.quotation.application.QuotationApplication;
import com.huigou.topsun.quotation.domain.model.QuotationItem;
import com.huigou.topsun.quotation.domain.query.QuotationQueryRequest;
import com.huigou.topsun.quotation.repository.QuotationRepository;
import com.huigou.uasp.bmp.common.BizBillStatus;
import com.huigou.uasp.bpm.FlowBroker;
import com.huigou.util.ClassHelper;
import org.activiti.engine.delegate.DelegateExecution;
import org.activiti.engine.delegate.DelegateTask;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.List;
import java.util.Map;
/**
* @author 16508
* @description 针对表【quotation(报价单)】的数据库操作Service实现
* @createDate 2023-11-28 13:59:10
*/
@Service("quotationApplication")
public class QuotationApplicationImpl extends FlowBroker implements QuotationApplication {
@Resource
private QuotationRepository quotationRepository;
@Resource
private QuotationItemApplication quotationItemApplication;
@Override
protected String saveBizAndApprovalData() {
super.saveBizAndApprovalData();
Quotation quotation = getBizEntity(Quotation.class);
if (quotation.isNew()) {
quotation.setStatusId(BizBillStatus.APPLYING.getId());
} else {
quotation = (Quotation) commonDomainService.loadAndFillinProperties(quotation);
}
quotation = this.saveQuotation(quotation);
List<QuotationItem> quotationItems = this.getBizEntities(QuotationItem.class, "quotationItems");
quotationItemApplication.saveQuotationItems(quotation.getId(),quotationItems);
return quotation.getId();
}
@Override
protected Map<String, Object> getProcessBizParams(String bizId) {
// 返回业务数据给流程实例,
return ClassHelper.toMap(quotationRepository.getOne(bizId));
}
@Override
protected void onEnd(DelegateExecution delegateExecution) {
super.onEnd(delegateExecution);
String bizId = delegateExecution.getProcessBusinessKey();
BizBillStatus status = approvePassed() ? BizBillStatus.COMPLETED : BizBillStatus.ABORTED;
Quotation quotation = quotationRepository.findOne(bizId);
quotation.setStatusId(status.getId());
quotationRepository.save(quotation);
}
@Override
protected void onAbortProcessInstance(DelegateExecution delegateExecution) {
super.onAbortProcessInstance(delegateExecution);
String bizId = delegateExecution.getProcessBusinessKey();
Quotation quotation = quotationRepository.findOne(bizId);
quotation.setStatusId(BizBillStatus.ABORTED.getId());
quotationRepository.save(quotation);
}
/**
* @param delegateTask
* @param destActivityId 回退到的目标节点id
*/
@Override
protected void onBack(DelegateTask delegateTask, String destActivityId) {
super.onBack(delegateTask, destActivityId);
if ("Apply".equalsIgnoreCase(destActivityId)) {
String bizId = delegateTask.getExecution().getProcessBusinessKey();
Quotation quotation = quotationRepository.findOne(bizId);
quotation.setStatusId(BizBillStatus.APPLYING.getId());
quotationRepository.save(quotation);
}
}
@Override
public Quotation findById(String id) {
return quotationRepository.findOne(id);
}
@Override
public Quotation saveQuotation(Quotation quotation) {
quotation = quotationRepository.save(quotation);
quotation.setQuotationId(quotation.getId());
quotationRepository.save(quotation);
return quotation;
}
@Override
public Map<String, Object> slicedQuotationList(QuotationQueryRequest queryRequest) {
QueryDescriptor queryDescriptor = this.sqlExecutorDao.getQuery(QUERY_XML_FILE_PATH, "slicedQuotationList");
return this.sqlExecutorDao.executeSlicedQuery(queryDescriptor,queryRequest);
}
}
package com.huigou.topsun.quotation.application.impl;
import com.huigou.data.query.model.QueryDescriptor;
import com.huigou.data.query.model.QueryModel;
import com.huigou.topsun.quotation.application.QuotationItemApplication;
import com.huigou.topsun.quotation.domain.model.QuotationItem;
import com.huigou.topsun.quotation.repository.QuotationItemRepository;
import com.huigou.topsun.quotation.vo.QuotationItemVo;
import com.huigou.uasp.bmp.common.application.BaseApplication;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.List;
/**
* @author 16508
* @description 针对表【quotation_item(报价单明细)】的数据库操作Service实现
* @createDate 2023-11-28 13:59:10
*/
@Service
public class QuotationItemApplicationImpl extends BaseApplication implements QuotationItemApplication {
@Resource
private QuotationItemRepository quotationItemRepository;
@Override
public void saveQuotationItems(String quotationId,List<QuotationItem> quotationItems) {
quotationItems.forEach(quotationItem -> {
quotationItem.setQuotationId(quotationId);
});
quotationItemRepository.save(quotationItems);
}
@Override
public void deleteQuotationItem(List<String> ids) {
ids.forEach(id->{
quotationItemRepository.delete(id);
});
}
@Override
public void deleteQuotationItemByQuotationId(String quotationId) {
List<QuotationItem> itemList = this.findQuotationItemByQuotationId(quotationId);
quotationItemRepository.delete(itemList);
}
@Override
public List<QuotationItem> findQuotationItemByQuotationId(String quotationId) {
return quotationItemRepository.findByQuotationId(quotationId);
}
@Override
public QuotationItem findById(String id) {
return quotationItemRepository.findOne(id);
}
@Override
public List<QuotationItemVo> queryQuotationItemList(String quotationId) {
QueryDescriptor queryDescriptor = this.sqlExecutorDao.getQuery(QUERY_XML_FILE_PATH, "queryQuotationItemList");
return this.sqlExecutorDao.queryToList(queryDescriptor.getSql(), QuotationItemVo.class,quotationId);
}
}
package com.huigou.topsun.quotation.controller;
import com.huigou.context.Operator;
import com.huigou.context.OrgUnit;
import com.huigou.topsun.proofing.application.ProofingApplyApplication;
import com.huigou.topsun.proofing.domain.model.ProofingApply;
import com.huigou.topsun.quotation.application.QuotationApplication;
import com.huigou.topsun.quotation.domain.model.Quotation;
import com.huigou.topsun.quotation.domain.query.QuotationQueryRequest;
import com.huigou.uasp.annotation.ControllerMapping;
import com.huigou.uasp.bmp.common.BizBillStatus;
import com.huigou.uasp.client.CommonController;
import com.huigou.util.SDO;
import org.springframework.stereotype.Controller;
import javax.annotation.Resource;
/**
* @Auther: xin.lu
* @Date: 2023/11/28/14:05
* @Description:
*/
@Controller
@ControllerMapping("/quotation")
public class QuotationController extends CommonController {
@Resource
private QuotationApplication quotationApplication;
protected String getPagePath() {
return "/biz/topsun/quotation/";
}
public String forwardQuotationList(){
return forward("quotationList");
}
public String forwardAddQuotation(){
this.putAttribute("processDefinitionKey", QuotationApplication.PROCESS_DEFINITION_KEY);
this.putAttribute("procUnitId", "Apply");
Quotation quotation = new Quotation();
quotation.setStatusId(BizBillStatus.APPLYING.getId());
Operator operator = getOperator();
quotation.setDefaultValues(new OrgUnit(operator.getFullId(), operator.getFullName()));
quotation.setQuotationNo(quotation.getBillCode());
return forward("quotationDetail",quotation);
}
public String showQuotation(){
SDO sdo = this.getSDO();
String bizId = sdo.getBizId();
Quotation quotation = quotationApplication.findById(bizId);
return forward("quotationDetail",quotation);
}
public String slicedQuotationList(){
SDO sdo = this.getSDO();
QuotationQueryRequest queryRequest = sdo.toQueryRequest(QuotationQueryRequest.class);
return toResult(quotationApplication.slicedQuotationList(queryRequest));
}
}
package com.huigou.topsun.quotation.controller;
import com.huigou.topsun.quotation.application.QuotationItemApplication;
import com.huigou.topsun.quotation.vo.QuotationItemVo;
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.stereotype.Controller;
import javax.annotation.Resource;
import java.util.ArrayList;
import java.util.List;
/**
* @Auther: xin.lu
* @Date: 2023/11/28/16:10
* @Description:
*/
@Controller
@ControllerMapping("quotationItem")
public class QuotationItemController extends CommonController {
@Resource
private QuotationItemApplication quotationItemApplication;
public String findQuotationItems(){
SDO sdo = this.getSDO();
String quotationId = sdo.getString("quotationId");
return packGridDataAndResult(quotationItemApplication.findQuotationItemByQuotationId(quotationId));
}
public String queryQuotationItemList(){
SDO sdo = this.getSDO();
String quotationId = sdo.getString("quotationId");
List<QuotationItemVo> quotationItemVos = new ArrayList<>();
if (!StringUtil.isBlank(quotationId)){
quotationItemVos = quotationItemApplication.queryQuotationItemList(quotationId);
}
return packGridDataAndResult(quotationItemVos);
}
}
package com.huigou.topsun.quotation.domain.model;
import java.io.Serializable;
import javax.persistence.*;
import lombok.Data;
import org.hibernate.annotations.GenericGenerator;
/**
* 客户管理
* @TableName customer_manager
*/
@Table(name="customer_manager")
@Data
@Entity
public class CustomerManager implements Serializable {
/**
* 客户ID
*/
@Id
@GeneratedValue(generator = "system-uuid")
@GenericGenerator(name = "system-uuid", strategy = "guid")
@Column(name = "customer_manager_id")
private String customerManagerId;
/**
* 客户公司名称
*/
@Column(name = "customer_name")
private String customerName;
/**
* 客户公司名称英文
*/
@Column(name = "customer_name_en")
private String customerNameEn;
/**
* 客户公司地址
*/
private String address;
/**
* 电话
*/
@Column(name = "customer_phone")
private String customerPhone;
/**
* 传真
*/
@Column(name = "customer_fax")
private String customerFax;
/**
* 邮件
*/
@Column(name = "customer_email")
private String customerEmail;
/**
* 联系人名称
*/
@Column(name = "customer_contacts")
private String customerContacts;
/**
* 客户类型(customer_type)
*/
@Column(name = "customer_type")
private String customerType;
private static final long serialVersionUID = 1L;
@Override
public boolean equals(Object that) {
if (this == that) {
return true;
}
if (that == null) {
return false;
}
if (getClass() != that.getClass()) {
return false;
}
CustomerManager other = (CustomerManager) that;
return (this.getCustomerManagerId() == null ? other.getCustomerManagerId() == null : this.getCustomerManagerId().equals(other.getCustomerManagerId()))
&& (this.getCustomerName() == null ? other.getCustomerName() == null : this.getCustomerName().equals(other.getCustomerName()))
&& (this.getCustomerNameEn() == null ? other.getCustomerNameEn() == null : this.getCustomerNameEn().equals(other.getCustomerNameEn()))
&& (this.getAddress() == null ? other.getAddress() == null : this.getAddress().equals(other.getAddress()))
&& (this.getCustomerPhone() == null ? other.getCustomerPhone() == null : this.getCustomerPhone().equals(other.getCustomerPhone()))
&& (this.getCustomerFax() == null ? other.getCustomerFax() == null : this.getCustomerFax().equals(other.getCustomerFax()))
&& (this.getCustomerEmail() == null ? other.getCustomerEmail() == null : this.getCustomerEmail().equals(other.getCustomerEmail()))
&& (this.getCustomerContacts() == null ? other.getCustomerContacts() == null : this.getCustomerContacts().equals(other.getCustomerContacts()))
&& (this.getCustomerType() == null ? other.getCustomerType() == null : this.getCustomerType().equals(other.getCustomerType()));
}
@Override
public int hashCode() {
final int prime = 31;
int result = 1;
result = prime * result + ((getCustomerManagerId() == null) ? 0 : getCustomerManagerId().hashCode());
result = prime * result + ((getCustomerName() == null) ? 0 : getCustomerName().hashCode());
result = prime * result + ((getCustomerNameEn() == null) ? 0 : getCustomerNameEn().hashCode());
result = prime * result + ((getAddress() == null) ? 0 : getAddress().hashCode());
result = prime * result + ((getCustomerPhone() == null) ? 0 : getCustomerPhone().hashCode());
result = prime * result + ((getCustomerFax() == null) ? 0 : getCustomerFax().hashCode());
result = prime * result + ((getCustomerEmail() == null) ? 0 : getCustomerEmail().hashCode());
result = prime * result + ((getCustomerContacts() == null) ? 0 : getCustomerContacts().hashCode());
result = prime * result + ((getCustomerType() == null) ? 0 : getCustomerType().hashCode());
return result;
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append(getClass().getSimpleName());
sb.append(" [");
sb.append("Hash = ").append(hashCode());
sb.append(", customerManagerId=").append(customerManagerId);
sb.append(", customerName=").append(customerName);
sb.append(", customerNameEn=").append(customerNameEn);
sb.append(", address=").append(address);
sb.append(", customerPhone=").append(customerPhone);
sb.append(", customerFax=").append(customerFax);
sb.append(", customerEmail=").append(customerEmail);
sb.append(", customerContacts=").append(customerContacts);
sb.append(", customerType=").append(customerType);
sb.append(", serialVersionUID=").append(serialVersionUID);
sb.append("]");
return sb.toString();
}
}
\ No newline at end of file
package com.huigou.topsun.quotation.domain.model;
import java.io.Serializable;
import javax.persistence.*;
import lombok.Data;
import org.hibernate.annotations.GenericGenerator;
/**
* 客户报价规则
* @TableName customer_quotation_rule
*/
@Table(name="customer_quotation_rule")
@Data
@Entity
public class CustomerQuotationRule implements Serializable {
/**
*
*/
@Id
@GeneratedValue(generator = "system-uuid")
@GenericGenerator(name = "system-uuid", strategy = "guid")
@Column(name = "customer_quotation_rule_id")
private String customerQuotationRuleId;
/**
* 客户id
*/
@Column(name = "customer_manager_id")
private String customerManagerId;
/**
* 报价规则描述
*/
@Column(name = "rule_des")
private String ruleDes;
private static final long serialVersionUID = 1L;
@Override
public boolean equals(Object that) {
if (this == that) {
return true;
}
if (that == null) {
return false;
}
if (getClass() != that.getClass()) {
return false;
}
CustomerQuotationRule other = (CustomerQuotationRule) that;
return (this.getCustomerQuotationRuleId() == null ? other.getCustomerQuotationRuleId() == null : this.getCustomerQuotationRuleId().equals(other.getCustomerQuotationRuleId()))
&& (this.getCustomerManagerId() == null ? other.getCustomerManagerId() == null : this.getCustomerManagerId().equals(other.getCustomerManagerId()))
&& (this.getRuleDes() == null ? other.getRuleDes() == null : this.getRuleDes().equals(other.getRuleDes()));
}
@Override
public int hashCode() {
final int prime = 31;
int result = 1;
result = prime * result + ((getCustomerQuotationRuleId() == null) ? 0 : getCustomerQuotationRuleId().hashCode());
result = prime * result + ((getCustomerManagerId() == null) ? 0 : getCustomerManagerId().hashCode());
result = prime * result + ((getRuleDes() == null) ? 0 : getRuleDes().hashCode());
return result;
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append(getClass().getSimpleName());
sb.append(" [");
sb.append("Hash = ").append(hashCode());
sb.append(", customerQuotationRuleId=").append(customerQuotationRuleId);
sb.append(", customerManagerId=").append(customerManagerId);
sb.append(", ruleDes=").append(ruleDes);
sb.append(", serialVersionUID=").append(serialVersionUID);
sb.append("]");
return sb.toString();
}
}
\ No newline at end of file
package com.huigou.topsun.quotation.domain.model;
import java.util.Date;
import javax.persistence.*;
import com.huigou.data.domain.model.FlowBillAbstractEntity;
import lombok.Data;
/**
* 报价单
* @TableName quotation
*/
@Table(name="quotation")
@Data
@Entity
public class Quotation extends FlowBillAbstractEntity {
/**
* 报价单id
*/
@Column(name = "quotation_id")
private String quotationId;
/**
* 报价单类型(码表quotation_type)
*/
@Column(name = "quotation_type")
private String quotationType;
/**
* 品牌/工厂客户id
*/
@Column(name = "customer_manager_id")
private Long customerManagerId;
/**
* 报价日期
*/
@Column(name = "quotation_date")
private Date quotationDate;
/**
* 修改人id
*/
@Column(name = "update_by")
private Long updateBy;
/**
* 修改时间
*/
@Column(name = "update_time")
private Date updateTime;
/**
* 报价单流转状态(码表quotation_status)
*/
@Column(name = "quotation_status")
private String quotationStatus;
/**
* 注意事项
*/
@Column(name = "quotation_note")
private String quotationNote;
/**
* 发件人
*/
@Column(name = "quotation_from")
private String quotationFrom;
/**
* 回复
*/
@Column(name = "quotation_re")
private String quotationRe;
/**
* 前言
*/
@Column(name = "quotation_message")
private String quotationMessage;
/**
* 报价单号
*/
@Column(name = "quotation_no")
private String quotationNo;
/**
* 备注
*/
@Column(name = "quotation_remark")
private String quotationRemark;
/**
* 客户是否签回(码表quotation_sign_back)
*/
@Column(name = "customer_sign_back")
private String customerSignBack;
/**
* 主管
*/
private Long manager;
/**
* 经办人
*/
private Long handler;
/**
* 业务员
*/
private Long salesman;
private static final long serialVersionUID = 1L;
@Override
protected String getCodeRuleId() {
return "quotation";
}
}
\ No newline at end of file
package com.huigou.topsun.quotation.domain.model;
import java.io.Serializable;
import java.math.BigDecimal;
import javax.persistence.*;
import lombok.Data;
import org.hibernate.annotations.GenericGenerator;
/**
* 报价单明细
* @TableName quotation_item
*/
@Table(name="quotation_item")
@Data
@Entity
public class QuotationItem implements Serializable {
/**
*
*/
@Id
@GeneratedValue(generator = "system-uuid")
@GenericGenerator(name = "system-uuid", strategy = "guid")
@Column(name = "quotation_item_id")
private String quotationItemId;
/**
* 报价单id
*/
@Column(name = "quotation_id")
private String quotationId;
/**
* 序号/行项目
*/
private Integer sequence;
/**
* 产品id
*/
@Column(name = "product_id")
private String productId;
/**
* 单价
*/
private BigDecimal price;
/**
* 币别(码表currency)
*/
private String currency;
/**
* 备注
*/
private String remark;
/**
* 预估价
*/
@Column(name = "presale_price")
private BigDecimal presalePrice;
/**
* 正式价格
*/
@Column(name = "formal_price")
private BigDecimal formalPrice;
private static final long serialVersionUID = 1L;
@Override
public boolean equals(Object that) {
if (this == that) {
return true;
}
if (that == null) {
return false;
}
if (getClass() != that.getClass()) {
return false;
}
QuotationItem other = (QuotationItem) that;
return (this.getQuotationItemId() == null ? other.getQuotationItemId() == null : this.getQuotationItemId().equals(other.getQuotationItemId()))
&& (this.getQuotationId() == null ? other.getQuotationId() == null : this.getQuotationId().equals(other.getQuotationId()))
&& (this.getSequence() == null ? other.getSequence() == null : this.getSequence().equals(other.getSequence()))
&& (this.getProductId() == null ? other.getProductId() == null : this.getProductId().equals(other.getProductId()))
&& (this.getPrice() == null ? other.getPrice() == null : this.getPrice().equals(other.getPrice()))
&& (this.getCurrency() == null ? other.getCurrency() == null : this.getCurrency().equals(other.getCurrency()))
&& (this.getRemark() == null ? other.getRemark() == null : this.getRemark().equals(other.getRemark()))
&& (this.getPresalePrice() == null ? other.getPresalePrice() == null : this.getPresalePrice().equals(other.getPresalePrice()))
&& (this.getFormalPrice() == null ? other.getFormalPrice() == null : this.getFormalPrice().equals(other.getFormalPrice()));
}
@Override
public int hashCode() {
final int prime = 31;
int result = 1;
result = prime * result + ((getQuotationItemId() == null) ? 0 : getQuotationItemId().hashCode());
result = prime * result + ((getQuotationId() == null) ? 0 : getQuotationId().hashCode());
result = prime * result + ((getSequence() == null) ? 0 : getSequence().hashCode());
result = prime * result + ((getProductId() == null) ? 0 : getProductId().hashCode());
result = prime * result + ((getPrice() == null) ? 0 : getPrice().hashCode());
result = prime * result + ((getCurrency() == null) ? 0 : getCurrency().hashCode());
result = prime * result + ((getRemark() == null) ? 0 : getRemark().hashCode());
result = prime * result + ((getPresalePrice() == null) ? 0 : getPresalePrice().hashCode());
result = prime * result + ((getFormalPrice() == null) ? 0 : getFormalPrice().hashCode());
return result;
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append(getClass().getSimpleName());
sb.append(" [");
sb.append("Hash = ").append(hashCode());
sb.append(", quotationItemId=").append(quotationItemId);
sb.append(", quotationId=").append(quotationId);
sb.append(", sequence=").append(sequence);
sb.append(", productId=").append(productId);
sb.append(", price=").append(price);
sb.append(", currency=").append(currency);
sb.append(", remark=").append(remark);
sb.append(", presalePrice=").append(presalePrice);
sb.append(", formalPrice=").append(formalPrice);
sb.append(", serialVersionUID=").append(serialVersionUID);
sb.append("]");
return sb.toString();
}
}
\ No newline at end of file
package com.huigou.topsun.quotation.domain.query;
import com.huigou.data.domain.query.QueryAbstractRequest;
import lombok.Data;
import java.util.Date;
/**
* 报价单
* @TableName quotation
*/
@Data
public class QuotationQueryRequest extends QueryAbstractRequest {
/**
* 报价单id
*/
private String quotationId;
/**
* 报价单类型(码表quotation_type)
*/
private String quotationType;
/**
* 品牌/工厂客户id
*/
private Long customerManagerId;
/**
* 报价日期
*/
private Date quotationDate;
/**
* 创建人id
*/
private Long createBy;
/**
* 创建时间
*/
private Date createTime;
/**
* 修改人id
*/
private Long updateBy;
/**
* 修改时间
*/
private Date updateTime;
/**
* 报价单流转状态(码表quotation_status)
*/
private String quotationStatus;
/**
* 注意事项
*/
private String quotationNote;
/**
* 发件人
*/
private String quotationFrom;
/**
* 回复
*/
private String quotationRe;
/**
* 前言
*/
private String quotationMessage;
/**
* 报价单号
*/
private String quotationNo;
/**
* 备注
*/
private String quotationRemark;
/**
* 客户是否签回(码表quotation_sign_back)
*/
private String customerSignBack;
/**
* 主管
*/
private Long manager;
/**
* 经办人
*/
private Long handler;
/**
* 业务员
*/
private Long salesman;
}
\ No newline at end of file
package com.huigou.topsun.quotation.repository;
import com.huigou.topsun.quotation.domain.model.CustomerManager;
import org.springframework.data.jpa.repository.JpaRepository;
/**
* @Auther: xin.lu
* @Date: 2023/11/28/14:02
* @Description:
*/
public interface CustomerManagerRepository extends JpaRepository<CustomerManager,String> {
}
package com.huigou.topsun.quotation.repository;
import com.huigou.topsun.quotation.domain.model.CustomerQuotationRule;
import org.springframework.data.jpa.repository.JpaRepository;
/**
* @Auther: xin.lu
* @Date: 2023/11/28/14:02
* @Description:
*/
public interface CustomerQuotationRuleRepository extends JpaRepository<CustomerQuotationRule,String> {
}
package com.huigou.topsun.quotation.repository;
import com.huigou.topsun.quotation.domain.model.QuotationItem;
import org.springframework.data.jpa.repository.JpaRepository;
import java.util.List;
/**
* @Auther: xin.lu
* @Date: 2023/11/28/14:03
* @Description:
*/
public interface QuotationItemRepository extends JpaRepository<QuotationItem,String> {
List<QuotationItem> findByQuotationId(String quotationId);
}
package com.huigou.topsun.quotation.repository;
import com.huigou.topsun.quotation.domain.model.Quotation;
import org.springframework.data.jpa.repository.JpaRepository;
/**
* @Auther: xin.lu
* @Date: 2023/11/28/14:02
* @Description:
*/
public interface QuotationRepository extends JpaRepository<Quotation,String> {
}
package com.huigou.topsun.quotation.vo;
import lombok.Data;
import org.hibernate.annotations.GenericGenerator;
import javax.persistence.*;
import java.io.Serializable;
import java.math.BigDecimal;
/**
* 报价单明细
* @TableName quotation_item
*/
@Data
public class QuotationItemVo implements Serializable {
/**
*
*/
private String quotationItemId;
/**
* 报价单id
*/
private String quotationId;
/**
* 序号/行项目
*/
private Integer sequence;
/**
* 产品id
*/
private String productId;
/**
* 单价
*/
private BigDecimal price;
/**
* 币别(码表currency)
*/
private String currency;
/**
* 备注
*/
private String remark;
/**
* 预估价
*/
@Column(name = "presale_price")
private BigDecimal presalePrice;
/**
* 正式价格
*/
private BigDecimal formalPrice;
private String productCode;
private String productName;
private String productUnit;
}
\ No newline at end of file
...@@ -29,4 +29,5 @@ public interface TechnologyApplication { ...@@ -29,4 +29,5 @@ public interface TechnologyApplication {
List<Technology> findAllByProductId(String productId); List<Technology> findAllByProductId(String productId);
Map<String, Object> queryTechnologyByProduct(TechnologyQueryRequest queryRequest);
} }
...@@ -76,6 +76,13 @@ public class TechnologyApplicationImpl extends BaseApplication implements Techno ...@@ -76,6 +76,13 @@ public class TechnologyApplicationImpl extends BaseApplication implements Techno
public List<Technology> findAllByProductId(String productId) { public List<Technology> findAllByProductId(String productId) {
return technologyRepository.findAllByProductId(productId); return technologyRepository.findAllByProductId(productId);
} }
@Override
public Map<String, Object> queryTechnologyByProduct(TechnologyQueryRequest queryRequest) {
QueryDescriptor queryDescriptor = this.sqlExecutorDao.getQuery(QUERY_XML_FILE_PATH, "queryTechnologyByProduct");
QueryModel model = this.sqlExecutorDao.getQueryModel(queryDescriptor, queryRequest);
return this.sqlExecutorDao.executeSlicedQuery(model);
}
} }
......
...@@ -10,8 +10,11 @@ import com.huigou.uasp.annotation.ControllerMapping; ...@@ -10,8 +10,11 @@ import com.huigou.uasp.annotation.ControllerMapping;
import com.huigou.uasp.client.CommonController; import com.huigou.uasp.client.CommonController;
import com.huigou.util.SDO; import com.huigou.util.SDO;
import org.springframework.stereotype.Controller; import org.springframework.stereotype.Controller;
import org.springframework.util.CollectionUtils;
import javax.annotation.Resource; import javax.annotation.Resource;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
...@@ -54,6 +57,24 @@ public class TechnologyController extends CommonController { ...@@ -54,6 +57,24 @@ public class TechnologyController extends CommonController {
return toResult(technologyApplication.slicedTechnologyList(queryRequest)); return toResult(technologyApplication.slicedTechnologyList(queryRequest));
} }
public String queryTechnologyByProduct(){
SDO sdo = this.getSDO();
List<String> productIds = sdo.getStringList("ids");
TechnologyQueryRequest queryRequest = sdo.toQueryRequest(TechnologyQueryRequest.class);
Map<String, Object> map = new HashMap<>();
if (!CollectionUtils.isEmpty(productIds)){
String productId = "";
if (productIds.size() >1){
productId = String.join(",", productIds);
}else {
productId = productIds.get(0);
}
queryRequest.setProductId(productId);
map = technologyApplication.queryTechnologyByProduct(queryRequest);
}
return toResult(map);
}
/** /**
* 保存工艺 * 保存工艺
* @return * @return
......
<?xml version="1.0" encoding="UTF-8"?>
<definitions xmlns="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:activiti="http://activiti.org/bpmn" xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:omgdc="http://www.omg.org/spec/DD/20100524/DC" xmlns:omgdi="http://www.omg.org/spec/DD/20100524/DI" xmlns:xsd="http://www.w3.org/2001/XMLSchema" typeLanguage="http://www.w3.org/2001/XMLSchema" expressionLanguage="http://www.w3.org/1999/XPath" targetNamespace="http://www.activiti.org/test">
<process id="quotationProc" name="报价" isExecutable="true">
<extensionElements>
<activiti:executionListener event="start" delegateExpression="#{quotationApplication}"></activiti:executionListener>
<activiti:executionListener event="end" delegateExpression="#{quotationApplication}"></activiti:executionListener>
</extensionElements>
<startEvent id="startevent1" name="Start"></startEvent>
<endEvent id="endevent1" name="End"></endEvent>
<userTask id="Apply" name="报价申请" activiti:formKey="quotation/showQuotation.job">
<extensionElements>
<activiti:taskListener event="all" delegateExpression="#{quotationApplication}"></activiti:taskListener>
<activiti:taskListener event="saveBizData" delegateExpression="#{quotationApplication}"></activiti:taskListener>
</extensionElements>
</userTask>
<userTask id="Approve" name="报价审批" activiti:assignee="${assignee} " activiti:formKey="quotation/showQuotation.job">
<extensionElements>
<activiti:taskListener event="all" delegateExpression="#{quotationApplication}"></activiti:taskListener>
<activiti:taskListener event="saveBizData" delegateExpression="#{quotationApplication}"></activiti:taskListener>
</extensionElements>
<multiInstanceLoopCharacteristics isSequential="false" activiti:collection="handlerList" activiti:elementVariable="assignee">
<completionCondition>${chiefApprovePassed}</completionCondition>
</multiInstanceLoopCharacteristics>
</userTask>
<sequenceFlow id="flow1" sourceRef="startevent1" targetRef="Apply"></sequenceFlow>
<sequenceFlow id="flow2" sourceRef="Apply" targetRef="Approve"></sequenceFlow>
<exclusiveGateway id="ApproveFinished" name="审批结束"></exclusiveGateway>
<sequenceFlow id="flow3" name="审批通过" sourceRef="ApprovePassed" targetRef="ApproveFinished">
<conditionExpression xsi:type="tFormalExpression"><![CDATA[${approvePassed}]]></conditionExpression>
</sequenceFlow>
<sequenceFlow id="flow4" name="审批结束" sourceRef="ApproveFinished" targetRef="endevent1">
<conditionExpression xsi:type="tFormalExpression"><![CDATA[${approveFinished}]]></conditionExpression>
</sequenceFlow>
<sequenceFlow id="flow5" name="审批未结束" sourceRef="ApproveFinished" targetRef="Approve">
<conditionExpression xsi:type="tFormalExpression"><![CDATA[${!approveFinished}]]></conditionExpression>
</sequenceFlow>
<exclusiveGateway id="ApprovePassed" name="审批通过"></exclusiveGateway>
<sequenceFlow id="flow6" sourceRef="Approve" targetRef="ApprovePassed"></sequenceFlow>
<sequenceFlow id="flow9" name="审批未通过" sourceRef="ApprovePassed" targetRef="Apply">
<conditionExpression xsi:type="tFormalExpression"><![CDATA[${!approvePassed}]]></conditionExpression>
</sequenceFlow>
</process>
<bpmndi:BPMNDiagram id="BPMNDiagram_quotationProc">
<bpmndi:BPMNPlane bpmnElement="quotationProc" id="BPMNPlane_quotationProc">
<bpmndi:BPMNShape bpmnElement="startevent1" id="BPMNShape_startevent1">
<omgdc:Bounds height="35.0" width="35.0" x="355.0" y="50.0"></omgdc:Bounds>
</bpmndi:BPMNShape>
<bpmndi:BPMNShape bpmnElement="endevent1" id="BPMNShape_endevent1">
<omgdc:Bounds height="35.0" width="35.0" x="355.0" y="550.0"></omgdc:Bounds>
</bpmndi:BPMNShape>
<bpmndi:BPMNShape bpmnElement="Apply" id="BPMNShape_Apply">
<omgdc:Bounds height="55.0" width="161.0" x="292.0" y="140.0"></omgdc:Bounds>
</bpmndi:BPMNShape>
<bpmndi:BPMNShape bpmnElement="Approve" id="BPMNShape_Approve">
<omgdc:Bounds height="55.0" width="161.0" x="292.0" y="240.0"></omgdc:Bounds>
</bpmndi:BPMNShape>
<bpmndi:BPMNShape bpmnElement="ApproveFinished" id="BPMNShape_ApproveFinished">
<omgdc:Bounds height="40.0" width="40.0" x="352.0" y="440.0"></omgdc:Bounds>
</bpmndi:BPMNShape>
<bpmndi:BPMNShape bpmnElement="ApprovePassed" id="BPMNShape_ApprovePassed">
<omgdc:Bounds height="40.0" width="40.0" x="352.0" y="349.0"></omgdc:Bounds>
</bpmndi:BPMNShape>
<bpmndi:BPMNEdge bpmnElement="flow1" id="BPMNEdge_flow1">
<omgdi:waypoint x="372.0" y="85.0"></omgdi:waypoint>
<omgdi:waypoint x="372.0" y="140.0"></omgdi:waypoint>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge bpmnElement="flow2" id="BPMNEdge_flow2">
<omgdi:waypoint x="372.0" y="195.0"></omgdi:waypoint>
<omgdi:waypoint x="372.0" y="240.0"></omgdi:waypoint>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge bpmnElement="flow3" id="BPMNEdge_flow3">
<omgdi:waypoint x="372.0" y="389.0"></omgdi:waypoint>
<omgdi:waypoint x="372.0" y="440.0"></omgdi:waypoint>
<bpmndi:BPMNLabel>
<omgdc:Bounds height="14.0" width="48.0" x="320.0" y="396.0"></omgdc:Bounds>
</bpmndi:BPMNLabel>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge bpmnElement="flow4" id="BPMNEdge_flow4">
<omgdi:waypoint x="372.0" y="480.0"></omgdi:waypoint>
<omgdi:waypoint x="372.0" y="550.0"></omgdi:waypoint>
<bpmndi:BPMNLabel>
<omgdc:Bounds height="14.0" width="48.0" x="382.0" y="489.0"></omgdc:Bounds>
</bpmndi:BPMNLabel>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge bpmnElement="flow5" id="BPMNEdge_flow5">
<omgdi:waypoint x="392.0" y="460.0"></omgdi:waypoint>
<omgdi:waypoint x="519.0" y="459.0"></omgdi:waypoint>
<omgdi:waypoint x="519.0" y="317.0"></omgdi:waypoint>
<omgdi:waypoint x="519.0" y="267.0"></omgdi:waypoint>
<omgdi:waypoint x="489.0" y="267.0"></omgdi:waypoint>
<omgdi:waypoint x="453.0" y="267.0"></omgdi:waypoint>
<bpmndi:BPMNLabel>
<omgdc:Bounds height="14.0" width="60.0" x="459.0" y="411.0"></omgdc:Bounds>
</bpmndi:BPMNLabel>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge bpmnElement="flow6" id="BPMNEdge_flow6">
<omgdi:waypoint x="372.0" y="295.0"></omgdi:waypoint>
<omgdi:waypoint x="372.0" y="349.0"></omgdi:waypoint>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge bpmnElement="flow9" id="BPMNEdge_flow9">
<omgdi:waypoint x="352.0" y="369.0"></omgdi:waypoint>
<omgdi:waypoint x="231.0" y="369.0"></omgdi:waypoint>
<omgdi:waypoint x="231.0" y="167.0"></omgdi:waypoint>
<omgdi:waypoint x="292.0" y="167.0"></omgdi:waypoint>
<bpmndi:BPMNLabel>
<omgdc:Bounds height="14.0" width="60.0" x="257.0" y="376.0"></omgdc:Bounds>
</bpmndi:BPMNLabel>
</bpmndi:BPMNEdge>
</bpmndi:BPMNPlane>
</bpmndi:BPMNDiagram>
</definitions>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<query-mappings>
<query name="slicedQuotationList" label="报价表" table="quotation">
<sql-query>
select t.* from quotation t
</sql-query>
<condition column="quotation_no" name="quotationNo" type="java.lang.String" symbol="=" alias="like"/>
<condition column="full_id" name="fullId" type="java.lang.String" symbol="half_like" alias="o"/>
<condition column="rule_kind" name="ruleKind" type="java.lang.String" symbol="=" alias="t"/>
</query>
</query-mappings>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<query-mappings>
<query name="queryQuotationItemList" label="报价明细表" table="quotation_item">
<sql-query>
SELECT
qi.*,
p.product_name,
p.product_unit,
pc.product_category_code AS product_code
FROM
quotation_item qi
LEFT JOIN product p ON qi.product_id = p.product_id
LEFT JOIN product_category pc ON p.product_category_id = pc.product_category_id
where qi.quotation_id = ?
</sql-query>
</query>
</query-mappings>
\ No newline at end of file
...@@ -10,4 +10,27 @@ ...@@ -10,4 +10,27 @@
<condition column="rule_kind" name="ruleKind" type="java.lang.String" symbol="=" alias="t"/> <condition column="rule_kind" name="ruleKind" type="java.lang.String" symbol="=" alias="t"/>
</query> </query>
<query name="queryTechnologyByProduct" label="根据产品查询工艺">
<sql-query>
SELECT
t.technology_name,
p.process_name,
CASE
WHEN p.process_type = 'pakeage' THEN
( SELECT gxmc FROM res_bz t WHERE t.id = pr.resource_id )
WHEN p.process_type = 'printing' THEN
( SELECT gxmc FROM res_ys t WHERE t.id = pr.resource_id )
WHEN p.process_type = 'cropping' THEN
( SELECT gxmc FROM res_cj t WHERE t.id = pr.resource_id ) ELSE ''
END AS resource_name
FROM
technology t
LEFT JOIN technology_process tp ON t.technology_id = tp.technology_id
LEFT JOIN process p ON tp.process_id = p.process_id
LEFT JOIN process_resource pr ON pr.technology_process_id = tp.technology_process_id
where 1=1
</sql-query>
<condition column="product_id" name="productId" symbol="in" alias="t"/>
</query>
</query-mappings> </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