Commit b4d8cb6d by 宋祥

1.生产领料操作增加添加人员功能

parent 59288395
package com.baosight.hggp.hg.kc.service;
import com.baosight.hggp.aspect.annotation.OperationLogAnnotation;
import com.baosight.hggp.core.constant.CommonConstant;
import com.baosight.hggp.core.dao.DaoUtils;
import com.baosight.hggp.hg.constant.HGConstant;
import com.baosight.hggp.hg.kc.domain.HGKC008C;
import com.baosight.hggp.util.AssertUtils;
import com.baosight.hggp.util.EiInfoUtils;
import com.baosight.hggp.util.LogUtils;
import com.baosight.hggp.util.MapUtils;
import com.baosight.iplat4j.core.ei.EiConstant;
import com.baosight.iplat4j.core.ei.EiInfo;
import com.baosight.iplat4j.core.exception.PlatException;
import com.baosight.iplat4j.core.service.impl.ServiceBase;
import java.util.List;
import java.util.Map;
/**
* 生产领料人员
*
* @author:songx
* @date:2024/9/24,17:47
*/
public class ServiceHGKC008C extends ServiceBase {
/**
* 画面初始化
*
* @param inInfo
* @return
*/
@OperationLogAnnotation(operModul = "售后维修", operType = "查询", operDesc = "初始化")
public EiInfo initLoad(EiInfo inInfo) {
try {
inInfo.addBlock(EiConstant.resultBlock).addBlockMeta(new HGKC008C().eiMetadata);
} catch (PlatException e) {
LogUtils.setDetailMsg(inInfo, e, "初始化失败");
}
return inInfo;
}
/**
* 查询操作.
*/
@Override
@OperationLogAnnotation(operModul = "售后维修", operType = "查询")
public EiInfo query(EiInfo inInfo) {
try {
Map queryMap = EiInfoUtils.getFirstRow(inInfo);
inInfo = super.query(inInfo, HGKC008C.QUERY, new HGKC008C());
} catch (PlatException e) {
LogUtils.setDetailMsg(inInfo, e, "查询失败");
}
return inInfo;
}
/**
* 保存操作.
*
* @param inInfo
* @return
*/
@OperationLogAnnotation(operModul = "客户回访", operType = "保存", operDesc = "保存")
public EiInfo save(EiInfo inInfo) {
try {
Map queryMap = EiInfoUtils.getFirstRow(inInfo);
String applyCode = MapUtils.getString(queryMap, HGKC008C.FIELD_APPLY_CODE);
AssertUtils.isEmpty(applyCode, "请选择领料单");
List<HGKC008C> fKc008Cs = MapUtils.toDaoEPBases(inInfo, HGKC008C.class);
for (HGKC008C fKc008C : fKc008Cs) {
if (fKc008C.getId() == null || fKc008C.getId() == 0) {
fKc008C.setApplyCode(applyCode);
this.add(fKc008C);
} else {
this.modify(fKc008C);
}
}
inInfo = this.query(inInfo);
inInfo.setMsg("操作成功!本次对[" + fKc008Cs.size() + "]条数据保存成功!");
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "保存失败");
}
return inInfo;
}
/**
* 新增
*
* @param fKc008C
*/
private void add(HGKC008C fKc008C) {
fKc008C.setStatus(HGConstant.DealStatus.S0);
fKc008C.setDeleteFlag(CommonConstant.YesNo.NO_0);
DaoUtils.insert(HGKC008C.INSERT, fKc008C);
}
/**
* 修改数据
*
* @param fKc008C
*/
private void modify(HGKC008C fKc008C) {
DaoUtils.update(HGKC008C.UPDATE, fKc008C);
}
/**
* 删除操作
*
* @param inInfo
* @return
*/
@OperationLogAnnotation(operModul = "客户回访", operType = "删除")
public EiInfo remove(EiInfo inInfo) {
try {
List<HGKC008C> fKc008Cs = MapUtils.toDaoEPBases(inInfo, HGKC008C.class);
// 保存数据
this.removeData(fKc008Cs);
inInfo = this.query(inInfo);
inInfo.setMsg("操作成功!本次对[" + fKc008Cs.size() + "]条数据删除成功!");
} catch (Exception e) {
LogUtils.setMsg(inInfo, e, "删除失败");
}
return inInfo;
}
/**
* 数据保存
*
* @param fKc008Cs
*/
private void removeData(List<HGKC008C> fKc008Cs) {
for (HGKC008C fKc008C : fKc008Cs) {
fKc008C.setDeleteFlag(CommonConstant.YesNo.YES_1);
DaoUtils.update(HGKC008C.DELETE, fKc008C.toMap());
}
}
}
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE sqlMap PUBLIC "-//iBATIS.com//DTD SQL Map 2.0//EN" "http://www.ibatis.com/dtd/sql-map-2.dtd">
<sqlMap namespace="HGKC008C">
<sql id="column">
ID as "id", <!-- 主键id -->
ACCOUNT_CODE as "accountCode", <!-- 账套 -->
DEP_CODE as "depCode", <!-- 部门编码 -->
CREATED_BY as "createdBy", <!-- 创建人 -->
CREATED_NAME as "createdName", <!-- 创建人名称 -->
CREATED_TIME as "createdTime", <!-- 创建时间 -->
UPDATED_BY as "updatedBy", <!-- 修改人 -->
UPDATED_NAME as "updatedName", <!-- 修改人名称 -->
UPDATED_TIME as "updatedTime", <!-- 修改时间 -->
DELETE_FLAG as "deleteFlag", <!-- 是否删除 0-否1-是 -->
STATUS as "status", <!-- 0.未提交,1-已提交,2.质检中 -->
APPLY_CODE as "applyCode", <!-- 领料单号 -->
APPLY_USER_ID as "applyUserId", <!-- 领料人ID -->
APPLY_USER_NAME as "applyUserName", <!-- 领料人名称 -->
REMARK as "remark" <!-- 备注 -->
</sql>
<sql id="condition">
AND DELETE_FLAG = 0
<include refid="idCondition"/>
<include refid="HGXSDataAuth.authCondition"/>
<isNotEmpty prepend=" AND " property="createdBy">
CREATED_BY = #createdBy#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="createdName">
CREATED_NAME = #createdName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="updatedBy">
UPDATED_BY = #updatedBy#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="updatedName">
UPDATED_NAME = #updatedName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="applyUserName">
APPLY_USER_NAME LIKE CONCAT('%', #applyUserName#, '%')
</isNotEmpty>
</sql>
<sql id="idCondition">
<isNotEmpty prepend=" AND " property="id">
ID = #id#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="ids">
ID IN <iterate close=")" open="(" conjunction="," property="ids">#ids[]#</iterate>
</isNotEmpty>
<isNotEmpty prepend=" AND " property="applyCode">
APPLY_CODE = #applyCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="applyCodes">
APPLY_CODE IN <iterate close=")" open="(" conjunction="," property="applyCodes">#applyCodes[]#</iterate>
</isNotEmpty>
</sql>
<sql id="orderBy">
<dynamic prepend="ORDER BY">
<isNotEmpty property="orderBy">
$orderBy$
</isNotEmpty>
<isEmpty property="orderBy">
ID DESC
</isEmpty>
</dynamic>
</sql>
<!-- 查询 -->
<select id="query" resultClass="com.baosight.hggp.hg.kc.domain.HGKC008C">
SELECT
<include refid="column"/>
FROM ${hggpSchema}.HGKC008c WHERE 1=1
<include refid="condition"/>
<include refid="orderBy"/>
</select>
<select id="count" resultClass="int">
SELECT COUNT(*) FROM ${hggpSchema}.HGKC008C WHERE 1=1
<include refid="condition"/>
</select>
<insert id="insert">
INSERT INTO ${hggpSchema}.HGKC008C (
ACCOUNT_CODE, <!-- 账套 -->
DEP_CODE, <!-- 部门编码 -->
CREATED_BY, <!-- 创建人 -->
CREATED_NAME, <!-- 创建人名称 -->
CREATED_TIME, <!-- 创建时间 -->
UPDATED_BY, <!-- 修改人 -->
UPDATED_NAME, <!-- 修改人名称 -->
UPDATED_TIME, <!-- 修改时间 -->
DELETE_FLAG, <!-- 是否删除 0-否1-是 -->
STATUS, <!-- 0.未提交,1-已提交,2.质检中 -->
APPLY_CODE, <!-- 领料单号 -->
APPLY_USER_ID, <!-- 领料人ID -->
APPLY_USER_NAME, <!-- 领料人名称 -->
REMARK <!-- 备注 -->
) VALUES (
#accountCode#, #depCode#, #createdBy#, #createdName#, #createdTime#,
#updatedBy#, #updatedName#, #updatedTime#, #deleteFlag#, #status#,
#applyCode#, #applyUserId#, #applyUserName#, #remark#
)
</insert>
<delete id="delete">
UPDATE ${hggpSchema}.HGKC008C
SET DELETE_FLAG = 1
WHERE ID = #id#
</delete>
<update id="update">
UPDATE ${hggpSchema}.HGKC008C
SET
APPLY_USER_ID = #applyUserId#,
APPLY_USER_NAME = #applyUserName#,
REMARK = #remark#,
<include refid="SqlBase.updateRevise"/>
WHERE ID = #id#
</update>
</sqlMap>
......@@ -59,6 +59,7 @@
<sqlMap resource="com/baosight/hggp/hg/kc/sql/HGKC007A.xml"/>
<sqlMap resource="com/baosight/hggp/hg/kc/sql/HGKC008.xml"/>
<sqlMap resource="com/baosight/hggp/hg/kc/sql/HGKC008A.xml"/>
<sqlMap resource="com/baosight/hggp/hg/kc/sql/HGKC008C.xml"/>
<sqlMap resource="com/baosight/hggp/hg/kc/sql/HGKC010.xml"/>
<sqlMap resource="com/baosight/hggp/hg/kc/sql/HGKC010A.xml"/>
<sqlMap resource="com/baosight/hggp/hg/kc/sql/HGKC011.xml"/>
......
......@@ -33,8 +33,10 @@ $(function (){
+ 'onclick="showDetail(' + item.id + ',\'' + item.whCode + '\',\''
+ item.companyCode + '\',\'' + item.status + '\',\''
+ item.applyCode + '\')" >领料详情</a>';
if (status == 0) {
template += '<a style="cursor: pointer;display: inline-flex;justify-content: center;margin:auto 5px" '
+ 'onclick="showApplyUser(\'' + item.applyCode + '\')" >添加人员</a>';
if (status == 0) {
template += '<br/><a style="cursor: pointer;display: inline-flex;justify-content: center;margin:auto 5px" '
+ 'onclick="updateStatus(' + item.id + ',\'' + item.applyCode + '\')" >提交</a>';
}
}
......@@ -282,6 +284,24 @@ function showDetail(id, whCode, companyCode, status, applyCode) {
});
}
/**
* 添加人员
*
* @param applyCode
*/
let showApplyUser = function (applyCode){
let params = {
"inqu_status-0-applyCode": applyCode,
}
JSColorbox.open({
href: "HGKC008C",
title: "<div style='text-align: center;'>添加人员</div>",
width: "90%",
height: "90%",
params: params
});
}
function loadChange(grid,e,field) {
var cell_label = field,that = grid;
// locked 表示是否为固定列
......
......@@ -43,7 +43,7 @@
<EF:EFRegion id="result" title="记录集">
<EF:EFGrid blockId="result" autoDraw="no" isFloat="true" copyToAdd="false">
<EF:EFColumn ename="id" cname="主键" hidden="true"/>
<EF:EFColumn ename="operator" cname="操作" locked="true" enable="false" width="120" align="center"/>
<EF:EFColumn ename="operator" cname="操作" locked="true" enable="false" width="140" align="left"/>
<EF:EFComboColumn cname="类型" ename="receiveType" width="80" align="center" required="false" enable="false">
<EF:EFCodeOption codeName="hggp.receiveType"/>
</EF:EFComboColumn>
......
$(function () {
IPLATUI.EFGrid = {
"result": {
pageable: {
pageSize: 20,
pageSizes: [20, 50, 100, 200],
},
columns: []
}
}
// 查询
$("#QUERY").on("click", query);
// 保存
$("#SAVE").on("click", save);
// 删除
$("#REMOVE").on("click", remove);
// 键盘按键
downKeyUp();
});
/**
* 页面加载完成
*/
$(window).load(function () {
// 查询
query();
});
/**
* 查询
*/
let query = function () {
resultGrid.dataSource.page(1);
}
/**
* 保存
*/
function save() {
let rows = resultGrid.getCheckedRows();
if (rows.length < 1) {
message("请选择数据");
return;
}
for (let i = 0; i < rows.length; i++) {
let row = rows[i];
if (isBlank(row['applyUserName'])) {
message("勾选的第" + (i + 1) + "行\"领料人名称\"不能为空");
return;
}
}
JSUtils.submitGridsData("result", "HGKC008C", "save", true);
}
/**
* 删除
*/
function remove() {
var rows = resultGrid.getCheckedRows();
if (rows.length == 0) {
message("请先勾选数据!");
return;
}
JSUtils.confirm("确定对勾选中的[" + rows.length + "]条数据做\"删除\"操作?", {
ok: function () {
JSUtils.submitGridsData("result", "HGKC008C", "remove", true);
}
})
}
<!DOCTYPE html>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib prefix="EF" tagdir="/WEB-INF/tags/EF" %>
<c:set var="ctx" value="${pageContext.request.contextPath}"/>
<EF:EFPage title="领料人员">
<EF:EFRegion id="inqu" title="查询条件">
<div class="row">
<EF:EFInput ename="applyCode" cname="领料单号" blockId="inqu_status" row="0" readonly="true"/>
<EF:EFInput ename="applyUserName" cname="领料人名称" blockId="inqu_status" row="0" colWidth="3"/>
</div>
</EF:EFRegion>
<EF:EFRegion id="result" title="明细信息" fitHeight="true">
<EF:EFGrid blockId="result" autoDraw="override" isFloat="true" checkMode="row">
<EF:EFColumn ename="id" cname="ID" enable="false" hidden="true"/>
<EF:EFColumn ename="applyUserId" cname="领料人ID" enable="false" width="120" align="center" hidden="true"/>
<EF:EFColumn ename="applyUserName" cname="领料人名称" width="120" align="center" required="true"/>
<EF:EFColumn ename="remark" cname="备注" width="220" align="left"/>
<EF:EFColumn ename="createdName" cname="创建人" enable="false" width="100" align="center"/>
<EF:EFColumn ename="createdTime" cname="创建时间" enable="false" width="150" align="center"
editType="datetime" parseFormats="['yyyyMMddHHmmss']" dateFormat="yyyy-MM-dd HH:mm:ss"/>
<EF:EFColumn ename="updatedName" cname="修改人" enable="false" width="100" align="center"/>
<EF:EFColumn ename="updatedTime" cname="修改时间" enable="false" width="150" align="center"
editType="datetime" parseFormats="['yyyyMMddHHmmss']" dateFormat="yyyy-MM-dd HH:mm:ss"/>
</EF:EFGrid>
</EF:EFRegion>
</EF:EFPage>
\ No newline at end of file
......@@ -22,7 +22,7 @@ $(function () {
(function () {
splitter = $("#splitter").kendoSplitter({
panes: [
{size: "30%", min: "25%", max: "75%", collapsible: true},
{size: "25%", min: "25%", max: "75%", collapsible: true},
{},
{collapsible: true}
]
......@@ -37,7 +37,7 @@ $(function () {
if (document.getElementById("splitter").getElementsByClassName("k-splitbar").length !== 1) {
$("#splitter").kendoSplitter({
panes: [
{size: "30%", min: "25%", max: "75%", collapsible: true},
{size: "25%", min: "25%", max: "75%", collapsible: true},
{},
{collapsible: true}
]
......@@ -482,7 +482,6 @@ $(function () {
deleteFunc();
}, columns: [{
field: "operator",
title: "操作",
readonly: true,
template: function (model) {
let param = "'" + model.docId + "', '" + model.docType + "', '" + model.docName + "'";
......@@ -493,8 +492,8 @@ $(function () {
+ 'onclick="changeFile(\'' + model.docId + '\',\'' + model.bizId
+ '\')" target="_blank">变更</a>';
template += '<a style="cursor: pointer;display: inline-flex;justify-content: center;margin:auto 5px" '
+ 'onclick="changeFileRecords(\'' + item.id + '\',\'' + item.docId
+ '\',\'' + item.docName + '\')" target="_blank">变更记录</a>';
+ 'onclick="changeFileRecords(\'' + model.id + '\',\'' + model.docId
+ '\',\'' + model.docName + '\')" target="_blank">变更记录</a>';
return template;
}
}, {
......
......@@ -16,7 +16,7 @@
<div id="left-pane" class="i-fit-height">
<EF:EFRegion title="文档目录树" id="tree" fitHeight="true">
<div class="row" style="display: block">
<div class="col-md-12" style="display:flex;align-items: center">
<div class="col-md-8" style="display:flex;align-items: center">
<%--<EF:EFInput ename="searchText" colWidth="8" inline="true"/>
<EF:EFButton ename="search" class="fa fa-search" layout="2"/>--%>
<div style="display: none">
......@@ -77,12 +77,12 @@
</div>
</EF:EFRegion>
<EF:EFRegion id="result" title="明细信息" fitHeight="true">
<EF:EFGrid blockId="result" autoDraw="no" autoBind="false" showCount="true" sort="all"
serviceName="HGWD099" queryMethod="query" deleteMethod="delete">
<EF:EFGrid blockId="result" autoDraw="no" autoBind="false" showCount="true" checkMode="row"
sort="single" serviceName="HGWD099" queryMethod="query" deleteMethod="delete">
<EF:EFColumn ename="id" cname="ID" hidden="true"/>
<EF:EFColumn ename="docId" cname="文件ID" enable="false" width="180" hidden="true"/>
<EF:EFColumn ename="operator" cname="操作" enable="false" width="120" align="center" sort="false"/>
<EF:EFColumn ename="docName" cname="附件名称" enable="false" width="180"/>
<EF:EFColumn ename="operator" cname="操作" enable="false" width="140" align="center" sort="false"/>
<EF:EFColumn ename="docName" cname="附件名称" enable="false" width="200"/>
<EF:EFColumn ename="docType" cname="附件类型" enable="false" width="110" align="center"/>
<EF:EFColumn ename="docVersion" cname="版本号" enable="false" width="90" align="center" sort="true"/>
<EF:EFComboColumn ename="status" cname="状态" enable="false" width="100" align="center"
......
......@@ -16,7 +16,7 @@ $(function () {
(function () {
splitter = $("#splitter").kendoSplitter({
panes: [
{size: "30%", min: "25%", max: "75%", collapsible: true},
{size: "25%", min: "25%", max: "75%", collapsible: true},
{},
{collapsible: true}
]
......@@ -31,7 +31,7 @@ $(function () {
if (document.getElementById("splitter").getElementsByClassName("k-splitbar").length !== 1) {
$("#splitter").kendoSplitter({
panes: [
{size: "25%", min: "20%", max: "80%", collapsible: true},
{size: "25%", min: "25%", max: "75%", collapsible: true},
{},
{collapsible: true}
]
......
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