Commit b83ff073 authored by reedmi's avatar reedmi

fix some errors

parent 419b27f1
package com.originspark.drp.controllers.projects.costs; package com.originspark.drp.controllers.projects.costs;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Date;
import java.util.List; import java.util.List;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
...@@ -52,10 +53,12 @@ public class StockInCostController extends BaseController{ ...@@ -52,10 +53,12 @@ public class StockInCostController extends BaseController{
return failure("抱歉,不能重复添加商品"); return failure("抱歉,不能重复添加商品");
} }
stockInCost.setCreatedBy(getCurrentUser().getName());
stockInCost.setForDate(invoice.getForDate()); stockInCost.setForDate(invoice.getForDate());
stockInCost.setCreatedOn(new Date());
stockInCost.setCreatedBy(getCurrentUser().getName());
stockInCost.setUpdatedOn(new Date());
stockInCost.setUpdatedBy(getCurrentUser().getName());
service.save(stockInCost); service.save(stockInCost);
return ok("创建成功"); return ok("创建成功");
} }
......
...@@ -18,9 +18,8 @@ import org.springframework.web.bind.annotation.ResponseBody; ...@@ -18,9 +18,8 @@ import org.springframework.web.bind.annotation.ResponseBody;
import com.fasterxml.jackson.databind.ObjectMapper; import com.fasterxml.jackson.databind.ObjectMapper;
import com.originspark.drp.controllers.BaseController; import com.originspark.drp.controllers.BaseController;
import com.originspark.drp.models.resources.Vendor; import com.originspark.drp.models.resources.Vendor;
import com.originspark.drp.util.SessionUtil;
import com.originspark.drp.util.json.IdsJson;
import com.originspark.drp.util.json.FilterRequest; import com.originspark.drp.util.json.FilterRequest;
import com.originspark.drp.util.json.IdsJson;
import com.originspark.drp.util.json.JsonUtils; import com.originspark.drp.util.json.JsonUtils;
@Controller @Controller
......
...@@ -126,10 +126,13 @@ public class VendorServiceBean extends BaseDAOSupport<Vendor> implements VendorS ...@@ -126,10 +126,13 @@ public class VendorServiceBean extends BaseDAOSupport<Vendor> implements VendorS
@Override @Override
public boolean have(Vendor vendor) { public boolean have(Vendor vendor) {
String jpql = "from Vendor where name =:name and contactMan =:contactMan"; String jpql = "from Vendor where name =:name and contactMan =:contactMan and phone =:phone and address =:address and note =:note";
TypedQuery<Vendor> query = em.createQuery(jpql, Vendor.class) TypedQuery<Vendor> query = em.createQuery(jpql, Vendor.class)
.setParameter("name", vendor.getName()) .setParameter("name", vendor.getName())
.setParameter("contactMan", vendor.getContactMan()); .setParameter("contactMan", vendor.getContactMan())
.setParameter("phone", vendor.getPhone())
.setParameter("address", vendor.getAddress())
.setParameter("note", vendor.getNote());
List<Vendor> vendors = query.getResultList(); List<Vendor> vendors = query.getResultList();
if(vendors.isEmpty()){ if(vendors.isEmpty()){
......
...@@ -138,13 +138,14 @@ public class WareServiceBean extends BaseDAOSupport<Ware> implements WareService ...@@ -138,13 +138,14 @@ public class WareServiceBean extends BaseDAOSupport<Ware> implements WareService
@Override @Override
public boolean have(Ware ware) { public boolean have(Ware ware) {
String jpql = "from Ware where name =:name and model =:model and unit =:unit and brand =:brand and category =:category"; String jpql = "from Ware where name =:name and model =:model and unit =:unit and brand =:brand and category =:category and vendor =:vendor";
TypedQuery<Ware> query = em.createQuery(jpql, Ware.class) TypedQuery<Ware> query = em.createQuery(jpql, Ware.class)
.setParameter("name", ware.getName()) .setParameter("name", ware.getName())
.setParameter("model", ware.getModel()) .setParameter("model", ware.getModel())
.setParameter("unit", ware.getUnit()) .setParameter("unit", ware.getUnit())
.setParameter("brand", ware.getBrand()) .setParameter("brand", ware.getBrand())
.setParameter("category", ware.getCategory()); .setParameter("category", ware.getCategory())
.setParameter("vendor", ware.getVendor());
List<Ware> wares = query.getResultList(); List<Ware> wares = query.getResultList();
if(wares.isEmpty()){ if(wares.isEmpty()){
......
Ext.define("drp.app.model.resources.VendorModel", { Ext.define("drp.app.model.resources.VendorModel", {
extend : "drp.app.model.AbstractModel", extend : "drp.app.model.AbstractModel",
fields : [ { fields : [ {
name : "name",// 名称 name : "name"// 名称
type : "string"
}, { }, {
name : "contactMan",// 联系人 name : "contactMan"// 联系人
type : "string"
}, { }, {
name : "address",//地址 name : "address"//地址
type : "string"
}, { }, {
name : "phone",// 联系电话 name : "phone"// 联系电话
type : "string" }, {
name : "note"// 联系电话
}, { }, {
name : 'countOfWares',// 产品供应数量 name : 'countOfWares',// 产品供应数量
type : 'int', type : 'int',
......
...@@ -22,7 +22,7 @@ Ext.define("drp.app.model.resources.WareModel", { ...@@ -22,7 +22,7 @@ Ext.define("drp.app.model.resources.WareModel", {
name : "vendor.id", name : "vendor.id",
persist : false persist : false
}, { }, {
name : "vendor.name", name : "vendor.contactMan",
persist : false persist : false
}, { }, {
name : 'note'// 备注 name : 'note'// 备注
......
...@@ -158,7 +158,7 @@ Ext.define('drp.app.view.projects.invoices.StockInInvoiceView', { ...@@ -158,7 +158,7 @@ Ext.define('drp.app.view.projects.invoices.StockInInvoiceView', {
text : '库管员' text : '库管员'
}, { }, {
xtype : 'gridcolumn', xtype : 'gridcolumn',
dataIndex : 'regulatorName', dataIndex : 'regulator',
flex : 2, flex : 2,
text : '经手人' text : '经手人'
}], }],
......
...@@ -164,7 +164,7 @@ Ext.define('drp.app.view.projects.invoices.StockOutInvoiceView', { ...@@ -164,7 +164,7 @@ Ext.define('drp.app.view.projects.invoices.StockOutInvoiceView', {
text : '库管员' text : '库管员'
}, { }, {
xtype : 'gridcolumn', xtype : 'gridcolumn',
dataIndex : 'regulatorName', dataIndex : 'regulator',
flex : 2, flex : 2,
text : '经手人' text : '经手人'
}], }],
......
...@@ -83,48 +83,34 @@ Ext.define('drp.app.view.resources.VendorView', { ...@@ -83,48 +83,34 @@ Ext.define('drp.app.view.resources.VendorView', {
autoScroll : true, autoScroll : true,
columns : [{ columns : [{
xtype : 'gridcolumn', xtype : 'gridcolumn',
width : 90, flex : 1,
dataIndex : 'contactMan', dataIndex : 'contactMan',
text : '联系人' text : '联系人'
}, { }, {
xtype : 'gridcolumn', xtype : 'gridcolumn',
width : 130, flex : 1,
dataIndex : 'phone', dataIndex : 'phone',
text : '联系电话' text : '联系电话'
}, { }, {
xtype : 'gridcolumn', xtype : 'gridcolumn',
width : 160, flex : 2,
dataIndex : 'name', dataIndex : 'name',
text : '公司名称' text : '公司名称'
}, { }, {
xtype : 'gridcolumn', xtype : 'gridcolumn',
width : 180, flex : 2,
dataIndex : 'address', dataIndex : 'address',
text : '公司地址' text : '公司地址'
}, { }, {
xtype : 'gridcolumn', xtype : 'gridcolumn',
width : 100, flex : 1,
dataIndex : 'countOfWares', dataIndex : 'countOfWares',
text : '供应商品数量' text : '供应商品数量'
}, { }, {
xtype : 'gridcolumn', xtype : 'gridcolumn',
width : 200, flex : 3,
dataIndex : 'note', dataIndex : 'note',
text : '备注' text : '备注'
}, {
xtype : 'gridcolumn',
text : '维护信息',
columns : [{
xtype : 'gridcolumn',
width : 140,
dataIndex : 'createOn',
text : '创建时间'
}, {
xtype : 'gridcolumn',
width : 140,
dataIndex : 'updateOn',
text : '更新时间'
}]
}], }],
dockedItems : [{ dockedItems : [{
xtype : 'toolbar', xtype : 'toolbar',
......
...@@ -129,7 +129,7 @@ Ext.define('drp.app.view.resources.WareView', { ...@@ -129,7 +129,7 @@ Ext.define('drp.app.view.resources.WareView', {
}, { }, {
xtype : 'gridcolumn', xtype : 'gridcolumn',
width : 100, width : 100,
dataIndex : 'vendor.name', dataIndex : 'vendor.contactMan',
text : '供应商' text : '供应商'
}, { }, {
xtype : 'gridcolumn', xtype : 'gridcolumn',
......
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