Commit 9d7fe8f8 authored by 鲁鑫's avatar 鲁鑫

供应商、EP销售订单修改

parent 339ef2e3
......@@ -27,14 +27,37 @@ function bindEvent(){
$('#pd').searchbox({
type: "system", name: "queryPd",
checkbox:true,
checkboxIndex:"productCode",
textIndex:"productName",
valueIndex:"productCode",
getParam: function (item) {
return {
filterValue:$("#brandCode").val()
}
},
onChange: function (value, data) {
$('#pd').val(data.productCode);
$('#productName').val(data.productName);
$('#pd').val(value.value);
$('#productName').val(value.text);
}
});
$('#process').searchbox({
type: "system", name: "queryProductAndBom",
// checkbox:true,
// checkboxIndex:"process",
// textIndex:"material,",
// valueIndex:"process",
// idIndex:"productionSolutionId",
getParam: function (item) {
return {
filterValue:$('#pd').val()
}
},
onChange: function (value, data) {
$('#process').val(data.process);
$('#material').val(value.material);
$('#productionSolutionId').val(value.productionSolutionId);
}
});
......@@ -60,17 +83,32 @@ function loadGrid() {
});
gridManager = UICtrl.grid("#maingrid", {
columns: [
{display : "部门",name : "deptName",width : 200,minWidth : 100,type : "string",align : "left",
editor: { required : true, type: "dynamic",
getEditor:function (row) {
var org = "return { type:'tree',data:{name:'org',filter:'ogn',getParam:function(){return {orgRoot:'orgRoot',orgKindId:'ogn'};}},textField:'deptName',valueField:'deptId' }";
org = (new Function(org))();
return org;
}
}
},
{
display: "部门", name: "deptName", width: 200, minWidth: 60, type: "string", align: "left",
display: "部门", name: "deptId", width: 200, minWidth: 60, type: "string", align: "left",
editor: {
type: 'tree',
required: true,
data: {
name: 'org',
filter: 'dpt',
minWidth: 250
filter: 'ogn,dpt',
minWidth: 250,
getParam:function(){
return {
orgRoot: "orgRoot",
orgKindId: "ogn,dpt"
}
},
textField: 'deptName'
},
textField: 'deptId'
}
},
{
......@@ -78,13 +116,14 @@ function loadGrid() {
editor: {
type: 'tree',
required: true,
checkbox: true,
data: {
name: 'org',
filter: 'psm',
minWidth: 250
},
textField: 'executor',
//valueField: 'userCode'
valueField: 'executorId'
}
},
{
......
......@@ -42,13 +42,14 @@
<x:inputC name="pd" required="true" label="产品代号" labelCol="2" maxLength="64" fieldCol="10" wrapper="select"/>
</div>
<div class="hg-form-row">
<x:inputC name="productName" required="true" label="产品名称" labelCol="2" fieldCol="10"/>
<x:inputC name="productName" required="true" label="产品名称" labelCol="2" fieldCol="10" readonly="true"/>
</div>
<div class="hg-form-row">
<x:inputC name="process" required="true" label="制程工艺" labelCol="2" fieldCol="10"/>
<x:inputC name="process" required="true" label="制程工艺" labelCol="2" fieldCol="10" wrapper="select"/>
<x:hidden name="productionSolutionId"/>
</div>
<div class="hg-form-row">
<x:textareaC name="material" required="true" label="原材料" labelCol="2" fieldCol="10" rows="3"/>
<x:textareaC name="material" required="true" label="原材料" labelCol="2" fieldCol="10" rows="3" readonly="true"/>
</div>
<div class="hg-form-row">
<x:inputC name="others" required="true" label="其他" labelCol="2" fieldCol="10"/>
......
......@@ -387,10 +387,10 @@ var tableArray = [
minwidth: 120,
type: "money",
align: "left",
editor: {
mask: 'nnnnnnnnn.nn',
type: 'text'
}
// editor: {
// mask: 'nnnnnnnnn.nn',
// type: 'text'
// }
},
{
display: "税额(审批-本位币)",
......@@ -399,10 +399,10 @@ var tableArray = [
minwidth: 120,
type: "money",
align: "left",
editor: {
mask: 'nnnnnnnnn.nn',
type: 'text'
}
// editor: {
// mask: 'nnnnnnnnn.nn',
// type: 'text'
// }
},
{
display: "含税金额(审批-本位币)",
......@@ -411,10 +411,10 @@ var tableArray = [
minwidth: 120,
type: "money",
align: "left",
editor: {
mask: 'nnnnnnnnn.nn',
type: 'text'
}
// editor: {
// mask: 'nnnnnnnnn.nn',
// type: 'text'
// }
},
{
display: "是否付款", name: "zepPay", width: 120, minwidth: 120, type: "string", align: "left",
......
......@@ -44,6 +44,7 @@ function bindEvent(){
$("#applyPersonName").orgTree({
checkbox : false,
tree:{autoCheckboxEven:true},
filter: 'psm',
getParam : function() {
return {
orgRoot:'orgRoot',
......
......@@ -527,9 +527,9 @@ function getExtendedData(processAction) {
}
extendedData.suppliersPayList = Public.encodeJSONURI(datas);
}
var _grid = UICtrl.getGridManager('#sapSuppliersBuyerGrid');
if (_grid) {
var rows = _grid.getData();
var buy_grid = UICtrl.getGridManager('#sapSuppliersBuyerGrid');
if (buy_grid) {
var rows = buy_grid.getData();
for (var i = 0; i < rows.length; i++) {
var row = rows[i];
if (row.Inco1 != ""&&row.Inco2L=="") {
......@@ -538,7 +538,7 @@ function getExtendedData(processAction) {
}
}
var datas = DataUtil.getGridData({
gridManager: _grid,
gridManager: buy_grid,
isAllData: isAllData
});
if (!datas) {
......@@ -546,10 +546,10 @@ function getExtendedData(processAction) {
}
extendedData.suppliersBuyerList = Public.encodeJSONURI(datas);
}
var _grid = UICtrl.getGridManager('#sapSuppliersBankGrid');
if (_grid) {
var bank_grid = UICtrl.getGridManager('#sapSuppliersBankGrid');
if (bank_grid) {
var datas = DataUtil.getGridData({
gridManager: _grid,
gridManager: bank_grid,
isAllData: isAllData
});
if (!datas) {
......@@ -577,34 +577,34 @@ function checkConstraints(){
return false;
}
}
if ("cashier" == getSubProcUnitId() || "finance" == getSubProcUnitId()){
//付款信息
var _grid = UICtrl.getGridManager('#sapSuppliersPayGrid');
if (_grid) {
//银行信息
var bank_grid = UICtrl.getGridManager('#sapSuppliersBankGrid');
if (bank_grid) {
var datas = DataUtil.getGridData({
gridManager: _grid,
gridManager: bank_grid,
isAllData: true
});
if (!datas) {
return false;
}
if (isApproveProcUnit() && datas.length == 0 && "2" != getHandleResult()){
Public.tip("供应商付款信息必填");
Public.tip("供应商银行银行信息必填");
return false;
}
}
//银行信息
var _grid = UICtrl.getGridManager('#sapSuppliersBankGrid');
if (_grid) {
if ("cashier" == getSubProcUnitId() || "finance" == getSubProcUnitId()){
//付款信息
var pay_grid = UICtrl.getGridManager('#sapSuppliersPayGrid');
if (pay_grid) {
var datas = DataUtil.getGridData({
gridManager: _grid,
gridManager: pay_grid,
isAllData: true
});
if (!datas) {
return false;
}
if (isApproveProcUnit() && datas.length == 0 && "2" != getHandleResult()){
Public.tip("供应商银行银行信息必填");
Public.tip("供应商付款信息必填");
return false;
}
}
......
......@@ -64,7 +64,7 @@
<x:inputC name="strSuppl3" label="街道4" labelCol="1" fieldCol="2"/>--%>
<x:inputC name="land1Name" label="国家" labelCol="1" fieldCol="2" required="true" wrapper="select"/>
<x:hidden name="land1"/>
<x:inputC name="regionName" label="地区" labelCol="1" fieldCol="2" required="true" wrapper="select"/>
<x:inputC name="regionName" label="地区" labelCol="1" fieldCol="2" required="false" wrapper="select"/>
<x:hidden name="region"/>
<x:inputC name="city1" label="城市" labelCol="1" fieldCol="2" required="true" />
......@@ -100,7 +100,7 @@
<div id="sapSuppliersBuyerGrid" style="margin: 2px;"></div>
<div id="cashierGrid">
<div class="blank_div clearfix"></div>
<x:title title="供应商付款信息" name="group"/>
<x:title title="供应商公司信息" name="group"/>
<div id="sapSuppliersPayGrid" style="margin: 2px;"></div>
<div class="blank_div clearfix"></div>
<x:title title="供应商银行银行信息" name="group"/>
......
......@@ -108,6 +108,12 @@ public class EpChangeForm extends FlowBillAbstractEntity {
@Column(name = "changed_others")
private String changedOthers;
/**
* 版本id
*/
@Column(name = "production_solution_id")
private String productionSolutionId;
@Override
protected String getCodeRuleId() {
return "epChangeForm";
......
......@@ -42,4 +42,13 @@ public class EpResourceSearchController {
mapList = epApplication.queryEpPd(filterValue);
return sapDictionaryApplication.initEasySearchModel( mapList, param, sdo);
}
@EasySearch(queryName = "queryProductAndBom")
public Map<String, Object> queryProductAndBom(SDO sdo) throws IOException {
String param = sdo.getString("paramValue");
String filterValue = sdo.getString("filterValue");
List<Map<String, String>> mapList = new ArrayList<>();
mapList = epApplication.queryProductAndBom(filterValue);
return sapDictionaryApplication.initEasySearchModel( mapList, param, sdo);
}
}
......@@ -12,4 +12,6 @@ public interface EpApplication {
List<Map<String, String>> queryEpBrand(String brandName);
List<Map<String, String>> queryEpPd(String brandCode);
List<Map<String, String>> queryProductAndBom(String itemCode);
}
package com.huigou.topsun.ep.epApplication.impl;
import cn.hutool.json.JSONUtil;
import com.alibaba.fastjson.JSONObject;
import com.fasterxml.jackson.core.type.TypeReference;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.huigou.topsun.ep.epApplication.EpApplication;
import com.huigou.topsun.sap.common.HttpClient;
import com.huigou.topsun.sap.common.domain.SapResult;
import com.huigou.topsun.util.SAPUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.io.IOException;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.*;
/**
* @Auther: xin.lu
......@@ -34,12 +29,12 @@ public class EpApplicationImpl implements EpApplication {
String message = "";
try {
String executeForEp = httpClient.executeForEp(map, "md/brand/queryAllEnableBrand");
Map<String, String> resultMap = JSONObject.parseObject(executeForEp, Map.class);
if ("200".equals(resultMap.get("code"))) {
Map<String, Object> resultMap = JSONObject.parseObject(executeForEp, Map.class);
if ("200".equals(resultMap.get("code").toString())) {
ObjectMapper objectMapper = SAPUtils.objectMapper();
mapList = objectMapper.readValue(com.huigou.util.JSONUtil.toString(resultMap.get("data")), new TypeReference<List<Map<String, String>>>() {});
}else {
message = resultMap.get("msg");
message = (String) resultMap.get("msg");
}
} catch (IOException e) {
throw new RuntimeException("查询品牌出错:" + message);
......@@ -50,21 +45,42 @@ public class EpApplicationImpl implements EpApplication {
@Override
public List<Map<String, String>> queryEpPd(String brandCode) {
Map<String,Object> map = new HashMap<>();
map.put("brandCode",brandCode);
//map.put("brandCode",brandCode);
List<Map<String, String>> mapList = new ArrayList<>();
String message = "";
try {
String executeForEp = httpClient.executeForEp(map, "md/mditem/queryProductByBrandCode");
Map<String, String> resultMap = JSONObject.parseObject(executeForEp, Map.class);
if ("200".equals(resultMap.get("code"))) {
String executeForEp = httpClient.executeForEp(map, "md/mdItem/queryProductByBrandCode?brandCode="+brandCode);
Map<String, Object> resultMap = JSONObject.parseObject(executeForEp, Map.class);
if ("200".equals(resultMap.get("code").toString())) {
ObjectMapper objectMapper = SAPUtils.objectMapper();
mapList = objectMapper.readValue(com.huigou.util.JSONUtil.toString(resultMap.get("data")), new TypeReference<List<Map<String, String>>>() {});
}else {
message = resultMap.get("msg");
message =(String) resultMap.get("msg");
}
} catch (IOException e) {
throw new RuntimeException("查询产品出错:" + message);
}
return mapList;
}
@Override
public List<Map<String, String>> queryProductAndBom(String itemCode) {
Map<String,Object> map = new HashMap<>();
//map.put("brandCode",brandCode);
List<Map<String, String>> mapList = new ArrayList<>();
String message = "";
try {
String executeForEp = httpClient.executeForEp(map, "md/mdItem/queryProductAndBomByItemCode?itemCode="+itemCode);
Map<String, Object> resultMap = JSONObject.parseObject(executeForEp, Map.class);
if ("200".equals(resultMap.get("code").toString())) {
ObjectMapper objectMapper = SAPUtils.objectMapper();
mapList = objectMapper.readValue(com.huigou.util.JSONUtil.toString(resultMap.get("data")), new TypeReference<List<Map<String, String>>>() {});
}else {
message =(String) resultMap.get("msg");
}
} catch (IOException e) {
throw new RuntimeException("查询制程工艺、原材料出错:" + message);
}
return mapList;
}
}
......@@ -25,6 +25,7 @@ import com.huigou.topsun.sap.common.domain.SapResult;
import com.huigou.topsun.sap.costReimbursement.domain.SapCostReimbursement;
import com.huigou.uasp.bmp.common.BizBillStatus;
import com.huigou.uasp.bmp.operator.OperatorApplication;
import com.huigou.uasp.bmp.opm.domain.model.org.Org;
import com.huigou.uasp.bpm.FlowBroker;
import com.huigou.uasp.bpm.ProcessAction;
import com.huigou.uasp.bpm.ProcessStartModel;
......@@ -205,8 +206,10 @@ public class EpSaleOrderApplicationImpl extends FlowBroker implements EpSaleOrde
BeanUtil.copyProperties(epSaleOrderVo,epSaleOrder);
//初始化用户信息
String createdById = SystemCache.getParameter("adminPersonId", String.class);
Operator operator = operatorApplication.createOperatorByPersonMemberId(createdById);
String personCode = epSaleOrderVos.get(0).getPersonCode();
Org org = orgApplication.loadMainOrgByLoginName(personCode);
//String createdById = SystemCache.getParameter("adminPersonId", String.class);
Operator operator = operatorApplication.createOperatorByPersonMemberId(org.getId());
epSaleOrder.setDefaultValues(new OrgUnit(operator.getFullId(), operator.getFullName()));
Map<String, Object> formData = BeanUtil.beanToMap(epSaleOrder);
......
......@@ -24,6 +24,7 @@ import com.huigou.topsun.sap.common.domain.EpResult;
import com.huigou.topsun.sap.costReimbursement.domain.SapCostReimbursement;
import com.huigou.uasp.bmp.common.BizBillStatus;
import com.huigou.uasp.bmp.operator.OperatorApplication;
import com.huigou.uasp.bmp.opm.domain.model.org.Org;
import com.huigou.uasp.bpm.FlowBroker;
import com.huigou.uasp.bpm.ProcessAction;
import com.huigou.uasp.bpm.ProcessStartModel;
......@@ -204,8 +205,10 @@ public class EpSaleOrderCancelApplicationImpl extends FlowBroker implements EpSa
BeanUtil.copyProperties(epSaleOrderCancelVo,epSaleOrderCancel);
//初始化用户信息
String createdById = SystemCache.getParameter("adminPersonId", String.class);
Operator operator = operatorApplication.createOperatorByPersonMemberId(createdById);
String personCode = epSaleOrderCancelVos.get(0).getPersonCode();
Org org = orgApplication.loadMainOrgByLoginName(personCode);
//String createdById = SystemCache.getParameter("adminPersonId", String.class);
Operator operator = operatorApplication.createOperatorByPersonMemberId(org.getId());
epSaleOrderCancel.setDefaultValues(new OrgUnit(operator.getFullId(), operator.getFullName()));
Map<String, Object> formData = BeanUtil.beanToMap(epSaleOrderCancel);
......
......@@ -14,6 +14,11 @@ import java.util.List;
*/
@Data
public class EpSaleOrderCancelVo implements Serializable {
/**
* 创建人
*/
@JsonProperty("personCode")
private String personCode;
/**
* 订单类型
*/
......
......@@ -13,6 +13,11 @@ import java.util.List;
*/
@Data
public class EpSaleOrderVo implements Serializable {
/**
* 创建人
*/
@JsonProperty("personCode")
private String personCode;
/**
* 订单类型
*/
......
......@@ -15,6 +15,7 @@ import com.huigou.topsun.sap.nonProducePick.domain.query.NonProducePickQueryRequ
import com.huigou.topsun.sap.nonProducePick.repository.NonProducePickRepository;
import com.huigou.topsun.sap.nonProducePick.vo.NonProducePickItemVo;
import com.huigou.topsun.sap.nonProducePick.vo.NonProducePickVo;
import com.huigou.topsun.sap.purchase.domain.SapPurchase;
import com.huigou.uasp.bmp.common.BizBillStatus;
import com.huigou.uasp.bpm.FlowBroker;
import com.huigou.util.ClassHelper;
......@@ -209,4 +210,27 @@ public class NonProducePickApplicationImpl extends FlowBroker implements NonProd
nonProducePickRepository.save(nonProducePick);
}
}
/**
* 设置任务名称
*/
@Override
protected void setTaskDescription(DelegateTask delegateTask) {
String bizId = delegateTask.getExecution().getProcessBusinessKey();
delegateTask.setDescription(this.getApprovalSubjectName(bizId));
}
/**
* 获取任务标题
*
* @param bizId
* @return
*/
private String getApprovalSubjectName(String bizId) {
NonProducePick producePick = this.nonProducePickRepository.findOne(bizId);
//查询 单据日期
String fillinDateStr = DateUtil.getDateFormat("yyyy-MM-dd HH:mm:ss", producePick.getFillinDate());
//设置标题
return String.format("%s-%s(%s)", "其他物品领发料", producePick.getBillCode(), fillinDateStr);
}
}
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