Commit 0f8e54d6 authored by 季圣华's avatar 季圣华
Browse files

优化出入库单据和财务的资源权限的控制

parent 4fe0fc39
This diff is collapsed.
...@@ -1011,3 +1011,13 @@ alter table jsh_depot_item change OtherField4 other_field4 varchar(50) DEFAULT N ...@@ -1011,3 +1011,13 @@ alter table jsh_depot_item change OtherField4 other_field4 varchar(50) DEFAULT N
alter table jsh_depot_item change OtherField5 other_field5 varchar(50) DEFAULT NULL COMMENT '自定义字段5-名称'; alter table jsh_depot_item change OtherField5 other_field5 varchar(50) DEFAULT NULL COMMENT '自定义字段5-名称';
alter table jsh_depot_item change MType material_type varchar(20) DEFAULT NULL COMMENT '商品类型'; alter table jsh_depot_item change MType material_type varchar(20) DEFAULT NULL COMMENT '商品类型';
alter table jsh_depot_item change delete_Flag delete_flag varchar(1) DEFAULT '0' COMMENT '删除标记,0未删除,1删除'; alter table jsh_depot_item change delete_Flag delete_flag varchar(1) DEFAULT '0' COMMENT '删除标记,0未删除,1删除';
-- --------------------------------------------------------
-- 时间 2020年09月13日
-- by jishenghua
-- 给单据表增加操作员字段,去掉经手头姓名字段
-- --------------------------------------------------------
alter table jsh_depot_head add creator bigint(20) DEFAULT NULL COMMENT '操作员' after hands_person_id;
alter table jsh_account_head add creator bigint(20) DEFAULT NULL COMMENT '操作员' after hands_person_id;
alter table jsh_depot_head drop column oper_person_name;
update jsh_depot_head set creator=hands_person_id;
\ No newline at end of file
//初始化界面 //初始化界面
var defaultAccountId = 0; //默认账户id var defaultAccountId = 0; //默认账户id
var roleType = ""; //角色类型
$(function(){ $(function(){
var accountList = null; var accountList = null;
var accountID = null; var accountID = null;
...@@ -23,6 +24,7 @@ ...@@ -23,6 +24,7 @@
var moneyType = true; //隐藏当前列 var moneyType = true; //隐藏当前列
var inOrOut = ""; //链接类型为收入或者支出 var inOrOut = ""; //链接类型为收入或者支出
getType(); getType();
getRoleType();
initSystemData_person(); //经手人数据 initSystemData_person(); //经手人数据
initSelectInfo_person(); //经手人信息 initSelectInfo_person(); //经手人信息
initSystemData_account(); //账户数据 initSystemData_account(); //账户数据
...@@ -94,6 +96,21 @@ ...@@ -94,6 +96,21 @@
amountNum = "SYF"; amountNum = "SYF";
} }
} }
function getRoleType(){
$.ajax({
type:"get",
url: "/user/getRoleTypeByUserId",
async: false,
success: function (res) {
if (res && res.code === 200) {
roleType = res.data.roleType;
}
else {
roleType = null;
}
}
});
}
//获取账户信息 //获取账户信息
function initSystemData_account(){ function initSystemData_account(){
$.ajax({ $.ajax({
...@@ -243,7 +260,7 @@ ...@@ -243,7 +260,7 @@
{ field: 'organId',width:5, hidden:true}, { field: 'organId',width:5, hidden:true},
{ title: organNameTitle,field: 'organName',width:140,hidden:organNameHidden}, { title: organNameTitle,field: 'organName',width:140,hidden:organNameHidden},
{ title: '单据编号',field: 'billNo',width:160}, { title: '单据编号',field: 'billNo',width:160},
{ title: '经手人',field: 'handsPersonName',width:80}, { title: '操作员',field: 'userName',width:80},
{ title: '单据时间 ',field: 'billTimeStr',width:160}, { title: '单据时间 ',field: 'billTimeStr',width:160},
{ title: '合计',field: 'totalPrice',width:80}, { title: '合计',field: 'totalPrice',width:80},
{ title: '备注',field: 'remark',width:100} { title: '备注',field: 'remark',width:100}
...@@ -977,6 +994,7 @@ ...@@ -977,6 +994,7 @@
data: ({ data: ({
search: JSON.stringify({ search: JSON.stringify({
type: listType, type: listType,
roleType: roleType,
billNo: $.trim($("#searchBillNo").val()), billNo: $.trim($("#searchBillNo").val()),
beginTime: beginTime, beginTime: beginTime,
endTime: endTime endTime: endTime
......
...@@ -345,7 +345,7 @@ ...@@ -345,7 +345,7 @@
if(res && res.code === 200){ if(res && res.code === 200){
var data = res.data; var data = res.data;
$("#bill .BillNoShow").text(data.billNo); $("#bill .BillNoShow").text(data.billNo);
$("#bill .BillTimeShow").text(data.billTime); $("#bill .BillTimeShow").text(data.billTimeStr);
$("#bill .RemarkShow").text(data.remark); $("#bill .RemarkShow").text(data.remark);
$("#bill .AccountIdShow").text(data.accountName); $("#bill .AccountIdShow").text(data.accountName);
$('#bill .OrganIdShow').text(data.organName); $('#bill .OrganIdShow').text(data.organName);
......
...@@ -479,7 +479,7 @@ ...@@ -479,7 +479,7 @@
} }
}, },
{ title: '单据日期',field: 'operTimeStr',width:145}, { title: '单据日期',field: 'operTimeStr',width:145},
{ title: '操作员',field: 'operPersonName',width:60}, { title: '操作员',field: 'userName',width:60},
{ title: '金额合计',field: 'totalPrice',width:70}, { title: '金额合计',field: 'totalPrice',width:70},
{ title: '含税合计',field: 'totalTaxLastMoney',hidden:isShowLastMoneyColumn,width:70,formatter:function(value,rec){ { title: '含税合计',field: 'totalTaxLastMoney',hidden:isShowLastMoneyColumn,width:70,formatter:function(value,rec){
return (rec.discountMoney + rec.discountLastMoney).toFixed(2); return (rec.discountMoney + rec.discountLastMoney).toFixed(2);
...@@ -1362,7 +1362,6 @@ ...@@ -1362,7 +1362,6 @@
$("#DiscountLastMoney").val(res.discountLastMoney); //优惠后金额 $("#DiscountLastMoney").val(res.discountLastMoney); //优惠后金额
$("#ChangeAmount").val(res.changeAmount).attr("data-changeamount", res.changeAmount); $("#ChangeAmount").val(res.changeAmount).attr("data-changeamount", res.changeAmount);
$('#OrganId').combobox('setValue', res.organId); $('#OrganId').combobox('setValue', res.organId);
$("#HandsPersonId").val(res.handsPersonId);
$("#Remark").val(res.remark); $("#Remark").val(res.remark);
$("#Discount").val(res.discount?res.discount:0); $("#Discount").val(res.discount?res.discount:0);
$("#DiscountMoney").val(res.discountMoney?res.discountMoney:0); $("#DiscountMoney").val(res.discountMoney?res.discountMoney:0);
...@@ -1451,7 +1450,6 @@ ...@@ -1451,7 +1450,6 @@
$("#NumberShow").text(res.number); $("#NumberShow").text(res.number);
$("#OperTimeShow").text(res.operTimeStr); $("#OperTimeShow").text(res.operTimeStr);
$('#OrganIdShow').text(res.organName); $('#OrganIdShow').text(res.organName);
$("#HandsPersonIdShow").text(res.handsPersonName);
if(res.accountName){ if(res.accountName){
$("#AccountIdShow").text(res.accountName); //结算账户 $("#AccountIdShow").text(res.accountName); //结算账户
} else { } else {
...@@ -1817,7 +1815,6 @@ ...@@ -1817,7 +1815,6 @@
LinkNumber: $.trim($("#LinkNumber").val()), LinkNumber: $.trim($("#LinkNumber").val()),
OperTime: $("#OperTime").val(), OperTime: $("#OperTime").val(),
OrganId: OrganId, OrganId: OrganId,
HandsPersonId: $.trim($("#HandsPersonId").val()),
Salesman: SalesmanStr, //销售人员 Salesman: SalesmanStr, //销售人员
AccountId: getAccountID, AccountId: getAccountID,
ChangeAmount: ChangeAmount, //付款/收款 ChangeAmount: ChangeAmount, //付款/收款
......
...@@ -110,6 +110,10 @@ ...@@ -110,6 +110,10 @@
<td style="padding:5px;width:130px;"> <td style="padding:5px;width:130px;">
<span id="OrganIdShow"></span> <span id="OrganIdShow"></span>
</td> </td>
<td style="width:70px;">经手人:</td>
<td style="padding:5px;width:130px;">
<span id="HandsPersonIdShow"></span>
</td>
<td style="width:70px;">单据日期:</td> <td style="width:70px;">单据日期:</td>
<td style="padding:5px;width:130px;"> <td style="padding:5px;width:130px;">
<span id="BillTimeShow"></span> <span id="BillTimeShow"></span>
...@@ -118,8 +122,6 @@ ...@@ -118,8 +122,6 @@
<td style="padding:5px;width:140px;"> <td style="padding:5px;width:140px;">
<span id="BillNoShow"></span> <span id="BillNoShow"></span>
</td> </td>
<td style="width:70px;"></td>
<td style="width:140px;"></td>
<td style="width:100px;"></td> <td style="width:100px;"></td>
</tr> </tr>
<tr> <tr>
......
...@@ -92,10 +92,13 @@ ...@@ -92,10 +92,13 @@
if(res.status == 1) { if(res.status == 1) {
return '<b onclick="showMsg(' + res.id + ');">' + value + "</b>"; return '<b onclick="showMsg(' + res.id + ');">' + value + "</b>";
} else if(res.status == 2) { } else if(res.status == 2) {
return '<span onclick="showMsg(' + res.id + ');">' + value + "</span>";; return '<span onclick="showMsg(' + res.id + ');">' + value + "</span>";
} }
}}, }},
{title: '时间', field: 'createTime', width: 150}, {title: '时间', field: 'createTime', width: 150,formatter: function (value) {
return formatTime(value, 'Y-M-D h:m:s');
}
},
{title: '状态', field: 'status', width: 100,formatter: function (value) { {title: '状态', field: 'status', width: 100,formatter: function (value) {
if(value == 1) { if(value == 1) {
return "<b style='color:red'>未读</b>"; return "<b style='color:red'>未读</b>";
......
...@@ -91,8 +91,8 @@ ...@@ -91,8 +91,8 @@
async: false, async: false,
success: function (res) { success: function (res) {
if(res && res.code === 200) { if(res && res.code === 200) {
self.parent.window.$("#searchBtn").click();
self.parent.$.colorbox.close(); self.parent.$.colorbox.close();
$.messager.alert('提示',"操作成功!","info");
} }
else { else {
$.messager.alert('提示',"操作失败!","error"); $.messager.alert('提示',"操作失败!","error");
......
...@@ -87,28 +87,6 @@ public class DepotHeadController { ...@@ -87,28 +87,6 @@ public class DepotHeadController {
return res; return res;
} }
/**
* 获取最大的id
* @param request
* @return
*/
@GetMapping(value = "/getMaxId")
public BaseResponseInfo getMaxId(HttpServletRequest request)throws Exception {
BaseResponseInfo res = new BaseResponseInfo();
Map<String, Object> map = new HashMap<String, Object>();
try {
Long maxId = depotHeadService.getMaxId();
map.put("maxId", maxId);
res.code = 200;
res.data = map;
} catch(Exception e){
e.printStackTrace();
res.code = 500;
res.data = "获取数据失败";
}
return res;
}
/** /**
* 入库出库明细接口 * 入库出库明细接口
* @param currentPage * @param currentPage
......
...@@ -12,6 +12,8 @@ public class AccountHead { ...@@ -12,6 +12,8 @@ public class AccountHead {
private Long handsPersonId; private Long handsPersonId;
private Long creator;
private BigDecimal changeAmount; private BigDecimal changeAmount;
private BigDecimal totalPrice; private BigDecimal totalPrice;
...@@ -60,6 +62,14 @@ public class AccountHead { ...@@ -60,6 +62,14 @@ public class AccountHead {
this.handsPersonId = handsPersonId; this.handsPersonId = handsPersonId;
} }
public Long getCreator() {
return creator;
}
public void setCreator(Long creator) {
this.creator = creator;
}
public BigDecimal getChangeAmount() { public BigDecimal getChangeAmount() {
return changeAmount; return changeAmount;
} }
......
...@@ -356,6 +356,66 @@ public class AccountHeadExample { ...@@ -356,6 +356,66 @@ public class AccountHeadExample {
return (Criteria) this; return (Criteria) this;
} }
public Criteria andCreatorIsNull() {
addCriterion("creator is null");
return (Criteria) this;
}
public Criteria andCreatorIsNotNull() {
addCriterion("creator is not null");
return (Criteria) this;
}
public Criteria andCreatorEqualTo(Long value) {
addCriterion("creator =", value, "creator");
return (Criteria) this;
}
public Criteria andCreatorNotEqualTo(Long value) {
addCriterion("creator <>", value, "creator");
return (Criteria) this;
}
public Criteria andCreatorGreaterThan(Long value) {
addCriterion("creator >", value, "creator");
return (Criteria) this;
}
public Criteria andCreatorGreaterThanOrEqualTo(Long value) {
addCriterion("creator >=", value, "creator");
return (Criteria) this;
}
public Criteria andCreatorLessThan(Long value) {
addCriterion("creator <", value, "creator");
return (Criteria) this;
}
public Criteria andCreatorLessThanOrEqualTo(Long value) {
addCriterion("creator <=", value, "creator");
return (Criteria) this;
}
public Criteria andCreatorIn(List<Long> values) {
addCriterion("creator in", values, "creator");
return (Criteria) this;
}
public Criteria andCreatorNotIn(List<Long> values) {
addCriterion("creator not in", values, "creator");
return (Criteria) this;
}
public Criteria andCreatorBetween(Long value1, Long value2) {
addCriterion("creator between", value1, value2, "creator");
return (Criteria) this;
}
public Criteria andCreatorNotBetween(Long value1, Long value2) {
addCriterion("creator not between", value1, value2, "creator");
return (Criteria) this;
}
public Criteria andChangeAmountIsNull() { public Criteria andChangeAmountIsNull() {
addCriterion("change_amount is null"); addCriterion("change_amount is null");
return (Criteria) this; return (Criteria) this;
......
...@@ -33,6 +33,10 @@ public class AccountHeadVo4ListEx { ...@@ -33,6 +33,10 @@ public class AccountHeadVo4ListEx {
private String handsPersonName; private String handsPersonName;
private Long creator;
private String userName;
private String accountName; private String accountName;
private String billTimeStr; private String billTimeStr;
...@@ -149,6 +153,22 @@ public class AccountHeadVo4ListEx { ...@@ -149,6 +153,22 @@ public class AccountHeadVo4ListEx {
this.handsPersonName = handsPersonName; this.handsPersonName = handsPersonName;
} }
public Long getCreator() {
return creator;
}
public void setCreator(Long creator) {
this.creator = creator;
}
public String getUserName() {
return userName;
}
public void setUserName(String userName) {
this.userName = userName;
}
public String getAccountName() { public String getAccountName() {
return accountName; return accountName;
} }
......
...@@ -14,8 +14,6 @@ public class DepotHead { ...@@ -14,8 +14,6 @@ public class DepotHead {
private String number; private String number;
private String operPersonName;
private Date createTime; private Date createTime;
private Date operTime; private Date operTime;
...@@ -24,6 +22,8 @@ public class DepotHead { ...@@ -24,6 +22,8 @@ public class DepotHead {
private Long handsPersonId; private Long handsPersonId;
private Long creator;
private Long accountId; private Long accountId;
private BigDecimal changeAmount; private BigDecimal changeAmount;
...@@ -102,14 +102,6 @@ public class DepotHead { ...@@ -102,14 +102,6 @@ public class DepotHead {
this.number = number == null ? null : number.trim(); this.number = number == null ? null : number.trim();
} }
public String getOperPersonName() {
return operPersonName;
}
public void setOperPersonName(String operPersonName) {
this.operPersonName = operPersonName == null ? null : operPersonName.trim();
}
public Date getCreateTime() { public Date getCreateTime() {
return createTime; return createTime;
} }
...@@ -142,6 +134,14 @@ public class DepotHead { ...@@ -142,6 +134,14 @@ public class DepotHead {
this.handsPersonId = handsPersonId; this.handsPersonId = handsPersonId;
} }
public Long getCreator() {
return creator;
}
public void setCreator(Long creator) {
this.creator = creator;
}
public Long getAccountId() { public Long getAccountId() {
return accountId; return accountId;
} }
......
...@@ -446,76 +446,6 @@ public class DepotHeadExample { ...@@ -446,76 +446,6 @@ public class DepotHeadExample {
return (Criteria) this; return (Criteria) this;
} }
public Criteria andOperPersonNameIsNull() {
addCriterion("oper_person_name is null");
return (Criteria) this;
}
public Criteria andOperPersonNameIsNotNull() {
addCriterion("oper_person_name is not null");
return (Criteria) this;
}
public Criteria andOperPersonNameEqualTo(String value) {
addCriterion("oper_person_name =", value, "operPersonName");
return (Criteria) this;
}
public Criteria andOperPersonNameNotEqualTo(String value) {
addCriterion("oper_person_name <>", value, "operPersonName");
return (Criteria) this;
}
public Criteria andOperPersonNameGreaterThan(String value) {
addCriterion("oper_person_name >", value, "operPersonName");
return (Criteria) this;
}
public Criteria andOperPersonNameGreaterThanOrEqualTo(String value) {
addCriterion("oper_person_name >=", value, "operPersonName");
return (Criteria) this;
}
public Criteria andOperPersonNameLessThan(String value) {
addCriterion("oper_person_name <", value, "operPersonName");
return (Criteria) this;
}
public Criteria andOperPersonNameLessThanOrEqualTo(String value) {
addCriterion("oper_person_name <=", value, "operPersonName");
return (Criteria) this;
}
public Criteria andOperPersonNameLike(String value) {
addCriterion("oper_person_name like", value, "operPersonName");
return (Criteria) this;
}
public Criteria andOperPersonNameNotLike(String value) {
addCriterion("oper_person_name not like", value, "operPersonName");
return (Criteria) this;
}
public Criteria andOperPersonNameIn(List<String> values) {
addCriterion("oper_person_name in", values, "operPersonName");
return (Criteria) this;
}
public Criteria andOperPersonNameNotIn(List<String> values) {
addCriterion("oper_person_name not in", values, "operPersonName");
return (Criteria) this;
}
public Criteria andOperPersonNameBetween(String value1, String value2) {
addCriterion("oper_person_name between", value1, value2, "operPersonName");
return (Criteria) this;
}
public Criteria andOperPersonNameNotBetween(String value1, String value2) {
addCriterion("oper_person_name not between", value1, value2, "operPersonName");
return (Criteria) this;
}
public Criteria andCreateTimeIsNull() { public Criteria andCreateTimeIsNull() {
addCriterion("create_time is null"); addCriterion("create_time is null");
return (Criteria) this; return (Criteria) this;
...@@ -756,6 +686,66 @@ public class DepotHeadExample { ...@@ -756,6 +686,66 @@ public class DepotHeadExample {
return (Criteria) this; return (Criteria) this;
} }
public Criteria andCreatorIsNull() {
addCriterion("creator is null");
return (Criteria) this;
}
public Criteria andCreatorIsNotNull() {
addCriterion("creator is not null");
return (Criteria) this;
}
public Criteria andCreatorEqualTo(Long value) {
addCriterion("creator =", value, "creator");
return (Criteria) this;
}
public Criteria andCreatorNotEqualTo(Long value) {
addCriterion("creator <>", value, "creator");
return (Criteria) this;
}
public Criteria andCreatorGreaterThan(Long value) {
addCriterion("creator >", value, "creator");
return (Criteria) this;
}
public Criteria andCreatorGreaterThanOrEqualTo(Long value) {
addCriterion("creator >=", value, "creator");
return (Criteria) this;
}
public Criteria andCreatorLessThan(Long value) {
addCriterion("creator <", value, "creator");
return (Criteria) this;
}
public Criteria andCreatorLessThanOrEqualTo(Long value) {
addCriterion("creator <=", value, "creator");
return (Criteria) this;
}
public Criteria andCreatorIn(List<Long> values) {
addCriterion("creator in", values, "creator");
return (Criteria) this;
}
public Criteria andCreatorNotIn(List<Long> values) {
addCriterion("creator not in", values, "creator");
return (Criteria) this;
}
public Criteria andCreatorBetween(Long value1, Long value2) {
addCriterion("creator between", value1, value2, "creator");
return (Criteria) this;
}
public Criteria andCreatorNotBetween(Long value1, Long value2) {
addCriterion("creator not between", value1, value2, "creator");
return (Criteria) this;
}
public Criteria andAccountIdIsNull() { public Criteria andAccountIdIsNull() {
addCriterion("account_id is null"); addCriterion("account_id is null");
return (Criteria) this; return (Criteria) this;
......
...@@ -13,6 +13,7 @@ public interface AccountHeadMapperEx { ...@@ -13,6 +13,7 @@ public interface AccountHeadMapperEx {
List<AccountHeadVo4ListEx> selectByConditionAccountHead( List<AccountHeadVo4ListEx> selectByConditionAccountHead(
@Param("type") String type, @Param("type") String type,
@Param("creatorArray") String[] creatorArray,
@Param("billNo") String billNo, @Param("billNo") String billNo,
@Param("beginTime") String beginTime, @Param("beginTime") String beginTime,
@Param("endTime") String endTime, @Param("endTime") String endTime,
...@@ -21,6 +22,7 @@ public interface AccountHeadMapperEx { ...@@ -21,6 +22,7 @@ public interface AccountHeadMapperEx {
Long countsByAccountHead( Long countsByAccountHead(
@Param("type") String type, @Param("type") String type,
@Param("creatorArray") String[] creatorArray,
@Param("billNo") String billNo, @Param("billNo") String billNo,
@Param("beginTime") String beginTime, @Param("beginTime") String beginTime,
@Param("endTime") String endTime); @Param("endTime") String endTime);
......
...@@ -21,7 +21,7 @@ public interface DepotHeadMapperEx { ...@@ -21,7 +21,7 @@ public interface DepotHeadMapperEx {
List<DepotHeadVo4List> selectByConditionDepotHead( List<DepotHeadVo4List> selectByConditionDepotHead(
@Param("type") String type, @Param("type") String type,
@Param("subType") String subType, @Param("subType") String subType,
@Param("handsPersonIds") String[] handsPersonIds, @Param("creatorArray") String[] creatorArray,
@Param("number") String number, @Param("number") String number,
@Param("beginTime") String beginTime, @Param("beginTime") String beginTime,
@Param("endTime") String endTime, @Param("endTime") String endTime,
...@@ -33,15 +33,13 @@ public interface DepotHeadMapperEx { ...@@ -33,15 +33,13 @@ public interface DepotHeadMapperEx {
Long countsByDepotHead( Long countsByDepotHead(
@Param("type") String type, @Param("type") String type,
@Param("subType") String subType, @Param("subType") String subType,
@Param("handsPersonIds") String[] handsPersonIds, @Param("creatorArray") String[] creatorArray,
@Param("number") String number, @Param("number") String number,
@Param("beginTime") String beginTime, @Param("beginTime") String beginTime,
@Param("endTime") String endTime, @Param("endTime") String endTime,
@Param("materialParam") String materialParam, @Param("materialParam") String materialParam,
@Param("depotIds") String depotIds); @Param("depotIds") String depotIds);
Long getMaxId();
String findMaterialsListByHeaderId( String findMaterialsListByHeaderId(
@Param("id") Long id); @Param("id") Long id);
...@@ -123,7 +121,7 @@ public interface DepotHeadMapperEx { ...@@ -123,7 +121,7 @@ public interface DepotHeadMapperEx {
List<DepotHead> getDepotHeadListByOrganIds(@Param("organIds") String[] organIds); List<DepotHead> getDepotHeadListByOrganIds(@Param("organIds") String[] organIds);
List<DepotHead> getDepotHeadListByHandsPersonIds(@Param("handsPersonIds") String[] handsPersonIds); List<DepotHead> getDepotHeadListByCreator(@Param("creatorArray") String[] creatorArray);
BigDecimal getBuyAndSaleStatistics( BigDecimal getBuyAndSaleStatistics(
@Param("type") String type, @Param("type") String type,
......
...@@ -11,7 +11,7 @@ public class DepotHeadVo4List extends DepotHead{ ...@@ -11,7 +11,7 @@ public class DepotHeadVo4List extends DepotHead{
private String organName; private String organName;
private String handsPersonName; private String userName;
private String accountName; private String accountName;
...@@ -37,12 +37,12 @@ public class DepotHeadVo4List extends DepotHead{ ...@@ -37,12 +37,12 @@ public class DepotHeadVo4List extends DepotHead{
this.organName = organName; this.organName = organName;
} }
public String getHandsPersonName() { public String getUserName() {
return handsPersonName; return userName;
} }
public void setHandsPersonName(String handsPersonName) { public void setUserName(String userName) {
this.handsPersonName = handsPersonName; this.userName = userName;
} }
public String getAccountName() { public String getAccountName() {
......
...@@ -31,21 +31,23 @@ public class AccountHeadComponent implements ICommonQuery { ...@@ -31,21 +31,23 @@ public class AccountHeadComponent implements ICommonQuery {
private List<?> getAccountHeadList(Map<String, String> map)throws Exception { private List<?> getAccountHeadList(Map<String, String> map)throws Exception {
String search = map.get(Constants.SEARCH); String search = map.get(Constants.SEARCH);
String type = StringUtil.getInfo(search, "type"); String type = StringUtil.getInfo(search, "type");
String roleType = StringUtil.getInfo(search, "roleType");
String billNo = StringUtil.getInfo(search, "billNo"); String billNo = StringUtil.getInfo(search, "billNo");
String beginTime = StringUtil.getInfo(search, "beginTime"); String beginTime = StringUtil.getInfo(search, "beginTime");
String endTime = StringUtil.getInfo(search, "endTime"); String endTime = StringUtil.getInfo(search, "endTime");
String order = QueryUtils.order(map); String order = QueryUtils.order(map);
return accountHeadService.select(type, billNo, beginTime, endTime, QueryUtils.offset(map), QueryUtils.rows(map)); return accountHeadService.select(type, roleType, billNo, beginTime, endTime, QueryUtils.offset(map), QueryUtils.rows(map));
} }
@Override @Override
public Long counts(Map<String, String> map)throws Exception { public Long counts(Map<String, String> map)throws Exception {
String search = map.get(Constants.SEARCH); String search = map.get(Constants.SEARCH);
String type = StringUtil.getInfo(search, "type"); String type = StringUtil.getInfo(search, "type");
String roleType = StringUtil.getInfo(search, "roleType");
String billNo = StringUtil.getInfo(search, "billNo"); String billNo = StringUtil.getInfo(search, "billNo");
String beginTime = StringUtil.getInfo(search, "beginTime"); String beginTime = StringUtil.getInfo(search, "beginTime");
String endTime = StringUtil.getInfo(search, "endTime"); String endTime = StringUtil.getInfo(search, "endTime");
return accountHeadService.countAccountHead(type, billNo, beginTime, endTime); return accountHeadService.countAccountHead(type, roleType, billNo, beginTime, endTime);
} }
@Override @Override
......
...@@ -11,6 +11,7 @@ import com.jsh.erp.datasource.mappers.AccountItemMapperEx; ...@@ -11,6 +11,7 @@ import com.jsh.erp.datasource.mappers.AccountItemMapperEx;
import com.jsh.erp.exception.BusinessRunTimeException; import com.jsh.erp.exception.BusinessRunTimeException;
import com.jsh.erp.exception.JshException; import com.jsh.erp.exception.JshException;
import com.jsh.erp.service.log.LogService; import com.jsh.erp.service.log.LogService;
import com.jsh.erp.service.orgaUserRel.OrgaUserRelService;
import com.jsh.erp.service.user.UserService; import com.jsh.erp.service.user.UserService;
import com.jsh.erp.utils.StringUtil; import com.jsh.erp.utils.StringUtil;
import org.slf4j.Logger; import org.slf4j.Logger;
...@@ -32,13 +33,13 @@ import static com.jsh.erp.utils.Tools.getCenternTime; ...@@ -32,13 +33,13 @@ import static com.jsh.erp.utils.Tools.getCenternTime;
@Service @Service
public class AccountHeadService { public class AccountHeadService {
private Logger logger = LoggerFactory.getLogger(AccountHeadService.class); private Logger logger = LoggerFactory.getLogger(AccountHeadService.class);
@Resource @Resource
private AccountHeadMapper accountHeadMapper; private AccountHeadMapper accountHeadMapper;
@Resource @Resource
private AccountHeadMapperEx accountHeadMapperEx; private AccountHeadMapperEx accountHeadMapperEx;
@Resource @Resource
private OrgaUserRelService orgaUserRelService;
@Resource
private UserService userService; private UserService userService;
@Resource @Resource
private LogService logService; private LogService logService;
...@@ -79,11 +80,12 @@ public class AccountHeadService { ...@@ -79,11 +80,12 @@ public class AccountHeadService {
return list; return list;
} }
public List<AccountHeadVo4ListEx> select(String type, String billNo, String beginTime, String endTime, int offset, int rows) throws Exception{ public List<AccountHeadVo4ListEx> select(String type, String roleType, String billNo, String beginTime, String endTime, int offset, int rows) throws Exception{
List<AccountHeadVo4ListEx> resList = new ArrayList<AccountHeadVo4ListEx>(); List<AccountHeadVo4ListEx> resList = new ArrayList<AccountHeadVo4ListEx>();
List<AccountHeadVo4ListEx> list=null; List<AccountHeadVo4ListEx> list=null;
try{ try{
list = accountHeadMapperEx.selectByConditionAccountHead(type, billNo, beginTime, endTime, offset, rows); String [] creatorArray = getCreatorArray(roleType);
list = accountHeadMapperEx.selectByConditionAccountHead(type, creatorArray, billNo, beginTime, endTime, offset, rows);
}catch(Exception e){ }catch(Exception e){
JshException.readFail(logger, e); JshException.readFail(logger, e);
} }
...@@ -102,21 +104,45 @@ public class AccountHeadService { ...@@ -102,21 +104,45 @@ public class AccountHeadService {
return resList; return resList;
} }
public Long countAccountHead(String type, String billNo, String beginTime, String endTime) throws Exception{ public Long countAccountHead(String type, String roleType, String billNo, String beginTime, String endTime) throws Exception{
Long result=null; Long result=null;
try{ try{
result = accountHeadMapperEx.countsByAccountHead(type, billNo, beginTime, endTime); String [] creatorArray = getCreatorArray(roleType);
result = accountHeadMapperEx.countsByAccountHead(type, creatorArray, billNo, beginTime, endTime);
}catch(Exception e){ }catch(Exception e){
JshException.readFail(logger, e); JshException.readFail(logger, e);
} }
return result; return result;
} }
/**
* 根据角色类型获取操作员数组
* @param roleType
* @return
* @throws Exception
*/
private String[] getCreatorArray(String roleType) throws Exception {
String creator = "";
User user = userService.getCurrentUser();
if(BusinessConstants.ROLE_TYPE_PRIVATE.equals(roleType)) {
creator = user.getId().toString();
} else if(BusinessConstants.ROLE_TYPE_THIS_ORG.equals(roleType)) {
creator = orgaUserRelService.getUserIdListByUserId(user.getId());
}
String [] creatorArray=null;
if(StringUtil.isNotEmpty(creator)){
creatorArray = creator.split(",");
}
return creatorArray;
}
@Transactional(value = "transactionManager", rollbackFor = Exception.class) @Transactional(value = "transactionManager", rollbackFor = Exception.class)
public int insertAccountHead(String beanJson, HttpServletRequest request) throws Exception{ public int insertAccountHead(String beanJson, HttpServletRequest request) throws Exception{
AccountHead accountHead = JSONObject.parseObject(beanJson, AccountHead.class); AccountHead accountHead = JSONObject.parseObject(beanJson, AccountHead.class);
int result=0; int result=0;
try{ try{
User userInfo=userService.getCurrentUser();
accountHead.setCreator(userInfo==null?null:userInfo.getId());
result = accountHeadMapper.insertSelective(accountHead); result = accountHeadMapper.insertSelective(accountHead);
logService.insertLog("财务", logService.insertLog("财务",
new StringBuffer(BusinessConstants.LOG_OPERATION_TYPE_ADD).append(accountHead.getBillNo()).toString(), request); new StringBuffer(BusinessConstants.LOG_OPERATION_TYPE_ADD).append(accountHead.getBillNo()).toString(), request);
...@@ -274,6 +300,7 @@ public class AccountHeadService { ...@@ -274,6 +300,7 @@ public class AccountHeadService {
if(ah.getTotalPrice() != null) { if(ah.getTotalPrice() != null) {
ah.setTotalPrice(ah.getTotalPrice().abs()); ah.setTotalPrice(ah.getTotalPrice().abs());
} }
ah.setBillTimeStr(getCenternTime(ah.getBillTime()));
resList.add(ah); resList.add(ah);
} }
} }
......
...@@ -84,11 +84,11 @@ public class DepotHeadService { ...@@ -84,11 +84,11 @@ public class DepotHeadService {
public List<DepotHeadVo4List> select(String type, String subType, String roleType, String number, String beginTime, String endTime, public List<DepotHeadVo4List> select(String type, String subType, String roleType, String number, String beginTime, String endTime,
String materialParam, String depotIds, int offset, int rows)throws Exception { String materialParam, String depotIds, int offset, int rows)throws Exception {
String [] handsPersonIdArray = getHandsPersonIdArray(roleType);
List<DepotHeadVo4List> resList = new ArrayList<DepotHeadVo4List>(); List<DepotHeadVo4List> resList = new ArrayList<DepotHeadVo4List>();
List<DepotHeadVo4List> list=null; List<DepotHeadVo4List> list=null;
try{ try{
list=depotHeadMapperEx.selectByConditionDepotHead(type, subType, handsPersonIdArray, number, beginTime, endTime, materialParam, depotIds, offset, rows); String [] creatorArray = getCreatorArray(roleType);
list=depotHeadMapperEx.selectByConditionDepotHead(type, subType, creatorArray, number, beginTime, endTime, materialParam, depotIds, offset, rows);
}catch(Exception e){ }catch(Exception e){
JshException.readFail(logger, e); JshException.readFail(logger, e);
} }
...@@ -124,10 +124,10 @@ public class DepotHeadService { ...@@ -124,10 +124,10 @@ public class DepotHeadService {
public Long countDepotHead(String type, String subType, String roleType,String number, String beginTime, String endTime, public Long countDepotHead(String type, String subType, String roleType,String number, String beginTime, String endTime,
String materialParam, String depotIds) throws Exception{ String materialParam, String depotIds) throws Exception{
String [] handsPersonIdArray = getHandsPersonIdArray(roleType);
Long result=null; Long result=null;
try{ try{
result=depotHeadMapperEx.countsByDepotHead(type, subType, handsPersonIdArray, number, beginTime, endTime, materialParam, depotIds); String [] creatorArray = getCreatorArray(roleType);
result=depotHeadMapperEx.countsByDepotHead(type, subType, creatorArray, number, beginTime, endTime, materialParam, depotIds);
}catch(Exception e){ }catch(Exception e){
JshException.readFail(logger, e); JshException.readFail(logger, e);
} }
...@@ -135,36 +135,29 @@ public class DepotHeadService { ...@@ -135,36 +135,29 @@ public class DepotHeadService {
} }
/** /**
* 根据角色类型获取经手人数组 * 根据角色类型获取操作员数组
* @param roleType * @param roleType
* @return * @return
* @throws Exception * @throws Exception
*/ */
private String[] getHandsPersonIdArray(String roleType) throws Exception { private String[] getCreatorArray(String roleType) throws Exception {
String handsPersonIds = ""; String creator = "";
User user = userService.getCurrentUser(); User user = userService.getCurrentUser();
if(BusinessConstants.ROLE_TYPE_PRIVATE.equals(roleType)) { if(BusinessConstants.ROLE_TYPE_PRIVATE.equals(roleType)) {
handsPersonIds = user.getId().toString(); creator = user.getId().toString();
} else if(BusinessConstants.ROLE_TYPE_THIS_ORG.equals(roleType)) { } else if(BusinessConstants.ROLE_TYPE_THIS_ORG.equals(roleType)) {
handsPersonIds = orgaUserRelService.getUserIdListByUserId(user.getId()); creator = orgaUserRelService.getUserIdListByUserId(user.getId());
} }
String [] handsPersonIdArray=null; String [] creatorArray=null;
if(StringUtil.isNotEmpty(handsPersonIds)){ if(StringUtil.isNotEmpty(creator)){
handsPersonIdArray = handsPersonIds.split(","); creatorArray = creator.split(",");
} }
return handsPersonIdArray; return creatorArray;
} }
@Transactional(value = "transactionManager", rollbackFor = Exception.class) @Transactional(value = "transactionManager", rollbackFor = Exception.class)
public int insertDepotHead(String beanJson, HttpServletRequest request)throws Exception { public int insertDepotHead(String beanJson, HttpServletRequest request)throws Exception {
DepotHead depotHead = JSONObject.parseObject(beanJson, DepotHead.class); DepotHead depotHead = JSONObject.parseObject(beanJson, DepotHead.class);
//判断用户是否已经登录过,登录过不再处理
Object userInfo = request.getSession().getAttribute("user");
if (userInfo != null) {
User sessionUser = (User) userInfo;
String uName = sessionUser.getUsername();
depotHead.setOperPersonName(uName);
}
depotHead.setCreateTime(new Timestamp(System.currentTimeMillis())); depotHead.setCreateTime(new Timestamp(System.currentTimeMillis()));
depotHead.setStatus(BusinessConstants.BILLS_STATUS_UN_AUDIT); depotHead.setStatus(BusinessConstants.BILLS_STATUS_UN_AUDIT);
int result=0; int result=0;
...@@ -189,7 +182,6 @@ public class DepotHeadService { ...@@ -189,7 +182,6 @@ public class DepotHeadService {
depotHead.setId(id); depotHead.setId(id);
depotHead.setStatus(dh.getStatus()); depotHead.setStatus(dh.getStatus());
depotHead.setCreateTime(dh.getCreateTime()); depotHead.setCreateTime(dh.getCreateTime());
depotHead.setOperPersonName(dh.getOperPersonName());
int result=0; int result=0;
try{ try{
result = depotHeadMapper.updateByPrimaryKey(depotHead); result = depotHeadMapper.updateByPrimaryKey(depotHead);
...@@ -282,16 +274,6 @@ public class DepotHeadService { ...@@ -282,16 +274,6 @@ public class DepotHeadService {
} }
} }
public Long getMaxId()throws Exception {
Long result = null;
try{
result = depotHeadMapperEx.getMaxId();
}catch(Exception e){
JshException.readFail(logger, e);
}
return result;
}
public String findMaterialsListByHeaderId(Long id)throws Exception { public String findMaterialsListByHeaderId(Long id)throws Exception {
String result = null; String result = null;
try{ try{
...@@ -490,8 +472,7 @@ public class DepotHeadService { ...@@ -490,8 +472,7 @@ public class DepotHeadService {
DepotHead depotHead = JSONObject.parseObject(beanJson, DepotHead.class); DepotHead depotHead = JSONObject.parseObject(beanJson, DepotHead.class);
//判断用户是否已经登录过,登录过不再处理 //判断用户是否已经登录过,登录过不再处理
User userInfo=userService.getCurrentUser(); User userInfo=userService.getCurrentUser();
depotHead.setHandsPersonId(userInfo==null?null:userInfo.getId()); depotHead.setCreator(userInfo==null?null:userInfo.getId());
depotHead.setOperPersonName(userInfo==null?null:userInfo.getUsername());
depotHead.setCreateTime(new Timestamp(System.currentTimeMillis())); depotHead.setCreateTime(new Timestamp(System.currentTimeMillis()));
depotHead.setStatus(BusinessConstants.BILLS_STATUS_UN_AUDIT); depotHead.setStatus(BusinessConstants.BILLS_STATUS_UN_AUDIT);
try{ try{
...@@ -550,8 +531,6 @@ public class DepotHeadService { ...@@ -550,8 +531,6 @@ public class DepotHeadService {
DepotHead depotHead = JSONObject.parseObject(beanJson, DepotHead.class); DepotHead depotHead = JSONObject.parseObject(beanJson, DepotHead.class);
//判断用户是否已经登录过,登录过不再处理 //判断用户是否已经登录过,登录过不再处理
depotHead.setId(id); depotHead.setId(id);
User userInfo=userService.getCurrentUser();
depotHead.setOperPersonName(userInfo==null?null:userInfo.getUsername());
try{ try{
depotHeadMapper.updateByPrimaryKeySelective(depotHead); depotHeadMapper.updateByPrimaryKeySelective(depotHead);
}catch(Exception e){ }catch(Exception e){
......
Supports Markdown
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