Commit 546c2619 by 宋祥

1.用工管理

parent 141a572a
package com.baosight.hpjx.core.enums;
/**
* @author:songx
* @date:2024/3/1,17:29
*/
public enum UserStatusEnum {
ONLINE(1, "在职"),
OFFLINE(2, "离职"),
;
private Integer code;
private String value;
UserStatusEnum(Integer code, String value) {
this.code = code;
this.value = value;
}
public Integer getCode() {
return code;
}
public void setCode(Integer code) {
this.code = code;
}
public String getValue() {
return value;
}
public void setValue(String value) {
this.value = value;
}
}
...@@ -14,6 +14,8 @@ public class HPConstant { ...@@ -14,6 +14,8 @@ public class HPConstant {
*/ */
public class SequenceId { public class SequenceId {
// 用户ID
public static final String USER_ID = "USER_ID";
// 组织机构编码 // 组织机构编码
public static final String ORG_CODE = "ORG_CODE"; public static final String ORG_CODE = "ORG_CODE";
// 组编码 // 组编码
......
...@@ -241,7 +241,7 @@ public class HPSqlConstant { ...@@ -241,7 +241,7 @@ public class HPSqlConstant {
public class HPKC013 { public class HPKC013 {
// 锁 // 锁
public static final String UPDATE_STATUS = "HPKC013.updatestatus"; public static final String UPDATE_STATUS = "HPKC013.updateStatus";
} }
/** /**
...@@ -271,6 +271,30 @@ public class HPSqlConstant { ...@@ -271,6 +271,30 @@ public class HPSqlConstant {
} }
/** /**
* HPPZ013 SQL 定义
*
* @author:songx
* @date:2024/1/18,17:17
*/
public class HPPZ013 {
// 查询
public static final String UPDATE_STATUS = "HPPZ013.updateStatus";
}
/**
* HPPZ014 SQL 定义
*
* @author:songx
* @date:2024/1/18,17:17
*/
public class HPPZ014 {
// 查询
public static final String UPDATE_TIME = "HPPZ014.updateTime";
}
/**
* HPSC003 SQL名称定义 * HPSC003 SQL名称定义
* *
* @author:songx * @author:songx
......
package com.baosight.hpjx.hp.pz.domain;
import com.baosight.iplat4j.core.ei.EiColumn;
import com.baosight.iplat4j.core.util.StringUtils;
import java.util.Map;
/**
* Project: <br>
* Title:THppz013.java <br>
* Description: <br>
*
* Copyrigth:Baosight Software LTD.co Copyright (c) 2019. <br>
*
* @version 1.0
* @history 2024-03-07 11:17:57 create
*/
public class HPPZ01401 extends HPPZ014 {
private static final long serialVersionUID = 1L;
public static final String FIELD_GENDER = "gender"; /* 性别*/
public static final String FIELD_MOBILE = "mobile"; /* 联系方式*/
public static final String COL_GENDER = "GENDER"; /* 性别*/
public static final String COL_MOBILE = "MOBILE"; /* 联系方式*/
private String gender = " "; /* 性别*/
private String mobile = " "; /* 联系方式*/
/**
* initialize the metadata.
*/
public void initMetaData() {
EiColumn eiColumn;
eiColumn = new EiColumn(FIELD_GENDER);
eiColumn.setDescName("性别");
eiMetadata.addMeta(eiColumn);
eiColumn = new EiColumn(FIELD_MOBILE);
eiColumn.setDescName("联系方式");
eiMetadata.addMeta(eiColumn);
}
/**
* the constructor.
*/
public HPPZ01401() {
initMetaData();
}
public String getGender() {
return gender;
}
public void setGender(String gender) {
this.gender = gender;
}
public String getMobile() {
return mobile;
}
public void setMobile(String mobile) {
this.mobile = mobile;
}
/**
* get the value from Map.
*
* @param map - source data map
*/
@Override
public void fromMap(Map map) {
super.fromMap(map);
setGender(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_GENDER)), gender));
setMobile(StringUtils.defaultIfEmpty(StringUtils.toString(map.get(FIELD_MOBILE)), mobile));
}
/**
* set the value to Map.
*/
@Override
public Map toMap() {
Map map = super.toMap();
map.put(FIELD_GENDER, StringUtils.toString(gender, eiMetadata.getMeta(FIELD_GENDER)));
map.put(FIELD_MOBILE, StringUtils.toString(mobile, eiMetadata.getMeta(FIELD_MOBILE)));
return map;
}
}
...@@ -126,7 +126,8 @@ public class ServiceHPPZ009 extends ServiceBase { ...@@ -126,7 +126,8 @@ public class ServiceHPPZ009 extends ServiceBase {
// 此处不能使用DaoUtils方法insert // 此处不能使用DaoUtils方法insert
dao.insert(HPPZ009.INSERT, fPz009); dao.insert(HPPZ009.INSERT, fPz009);
// 默认新增企业管理员账号 // 默认新增企业管理员账号
HPXSTools.XsUser.addUser(fPz009.getCompanyCode(), fPz009.getCompanyName()); HPXSTools.XsUser.addUser(fPz009.getCompanyCode(), fPz009.getCompanyCode(), fPz009.getCompanyName(),
null, null);
// 关联企业管理员角色 // 关联企业管理员角色
this.insertGroupMember(fPz009); this.insertGroupMember(fPz009);
} }
......
...@@ -4,9 +4,13 @@ import com.baosight.hpjx.aspect.annotation.OperationLogAnnotation; ...@@ -4,9 +4,13 @@ import com.baosight.hpjx.aspect.annotation.OperationLogAnnotation;
import com.baosight.hpjx.common.DdynamicEnum; import com.baosight.hpjx.common.DdynamicEnum;
import com.baosight.hpjx.core.constant.CommonConstant; import com.baosight.hpjx.core.constant.CommonConstant;
import com.baosight.hpjx.core.dao.DaoUtils; import com.baosight.hpjx.core.dao.DaoUtils;
import com.baosight.hpjx.core.enums.UserStatusEnum;
import com.baosight.hpjx.core.security.UserSessionUtils;
import com.baosight.hpjx.hp.constant.HPConstant;
import com.baosight.hpjx.hp.constant.HPSqlConstant; import com.baosight.hpjx.hp.constant.HPSqlConstant;
import com.baosight.hpjx.hp.pz.domain.HPPZ013; import com.baosight.hpjx.hp.pz.domain.HPPZ013;
import com.baosight.hpjx.hp.pz.domain.HPPZ01301; import com.baosight.hpjx.hp.pz.domain.HPPZ01301;
import com.baosight.hpjx.hp.pz.tools.HPPZTools;
import com.baosight.hpjx.hp.xs.tools.HPXSTools; import com.baosight.hpjx.hp.xs.tools.HPXSTools;
import com.baosight.hpjx.util.AssertUtils; import com.baosight.hpjx.util.AssertUtils;
import com.baosight.hpjx.util.CommonMethod; import com.baosight.hpjx.util.CommonMethod;
...@@ -15,6 +19,7 @@ import com.baosight.iplat4j.core.ei.EiConstant; ...@@ -15,6 +19,7 @@ import com.baosight.iplat4j.core.ei.EiConstant;
import com.baosight.iplat4j.core.ei.EiInfo; import com.baosight.iplat4j.core.ei.EiInfo;
import com.baosight.iplat4j.core.exception.PlatException; import com.baosight.iplat4j.core.exception.PlatException;
import com.baosight.iplat4j.core.service.impl.ServiceBase; import com.baosight.iplat4j.core.service.impl.ServiceBase;
import com.baosight.iplat4j.ed.util.SequenceGenerator;
import java.util.Arrays; import java.util.Arrays;
import java.util.List; import java.util.List;
...@@ -112,7 +117,7 @@ public class ServiceHPPZ013 extends ServiceBase { ...@@ -112,7 +117,7 @@ public class ServiceHPPZ013 extends ServiceBase {
* *
* @param resultRows * @param resultRows
*/ */
private void saveData(List<Map> resultRows) { private void saveData(List<Map> resultRows) throws Exception {
for (Map resultRow : resultRows) { for (Map resultRow : resultRows) {
HPPZ01301 fPz01301 = new HPPZ01301(); HPPZ01301 fPz01301 = new HPPZ01301();
fPz01301.fromMap(resultRow); fPz01301.fromMap(resultRow);
...@@ -136,6 +141,10 @@ public class ServiceHPPZ013 extends ServiceBase { ...@@ -136,6 +141,10 @@ public class ServiceHPPZ013 extends ServiceBase {
fPz01301.setFactoryName(HPXSTools.XsOrg.get(fPz01301.getFactoryCode()).getOrgCname()); fPz01301.setFactoryName(HPXSTools.XsOrg.get(fPz01301.getFactoryCode()).getOrgCname());
// 组名称 // 组名称
fPz01301.setGroupName(HPXSTools.XsOrg.get(fPz01301.getGroupCode()).getOrgCname()); fPz01301.setGroupName(HPXSTools.XsOrg.get(fPz01301.getGroupCode()).getOrgCname());
// 在职状态
if (fPz01301.getStatus() == null) {
fPz01301.setStatus(UserStatusEnum.ONLINE.getCode());
}
} }
/** /**
...@@ -143,10 +152,14 @@ public class ServiceHPPZ013 extends ServiceBase { ...@@ -143,10 +152,14 @@ public class ServiceHPPZ013 extends ServiceBase {
* *
* @param fPz01301 * @param fPz01301
*/ */
private void add(HPPZ01301 fPz01301) { private void add(HPPZ01301 fPz01301) throws Exception {
// 新增用户信息 // 新增用户信息
// String userId = String companyCode = UserSessionUtils.getCompanyCode();
// HPXSTools.XsUser.addUser(fPz009.getCompanyCode(), fPz01301.getUserName()); String loginPrefix = HPPZTools.HpPz009.getByCode(UserSessionUtils.getCompanyCode()).getLoginPrefix();
String userId = SequenceGenerator.getNextSequence(HPConstant.SequenceId.USER_ID, new String[]{loginPrefix});
HPXSTools.XsUser.addUser(companyCode, userId, fPz01301.getUserName(), fPz01301.getGender(),
fPz01301.getMobile());
fPz01301.setUserId(userId);
fPz01301.setDeleteFlag(CommonConstant.YesNo.NO_0); fPz01301.setDeleteFlag(CommonConstant.YesNo.NO_0);
DaoUtils.insert(HPPZ013.INSERT, fPz01301); DaoUtils.insert(HPPZ013.INSERT, fPz01301);
} }
...@@ -157,7 +170,7 @@ public class ServiceHPPZ013 extends ServiceBase { ...@@ -157,7 +170,7 @@ public class ServiceHPPZ013 extends ServiceBase {
* @param fPz01301 * @param fPz01301
*/ */
private void modify(HPPZ01301 fPz01301) { private void modify(HPPZ01301 fPz01301) {
DaoUtils.update(HPSqlConstant.HPKC013.UPDATE_STATUS, fPz01301); DaoUtils.update(HPSqlConstant.HPPZ013.UPDATE_STATUS, fPz01301);
} }
/** /**
......
package com.baosight.hpjx.hp.pz.service;
import com.baosight.hpjx.aspect.annotation.OperationLogAnnotation;
import com.baosight.hpjx.util.LogUtils;
import com.baosight.iplat4j.core.ei.EiInfo;
import com.baosight.iplat4j.core.exception.PlatException;
import com.baosight.iplat4j.core.service.impl.ServiceBase;
/**
* 用工管理
*
* @author:songx
* @date:2024/1/18,17:15
*/
public class ServiceHPPZ013A extends ServiceBase {
/**
* 画面初始化
*
* @param inInfo
* @return
*/
@Override
@OperationLogAnnotation(operModul = "用工登记", operType = "查询", operDesc = "初始化")
public EiInfo initLoad(EiInfo inInfo) {
try {
} catch (PlatException e) {
LogUtils.setDetailMsg(inInfo, e, "初始化失败");
}
return inInfo;
}
}
package com.baosight.hpjx.hp.pz.service;
import com.baosight.hpjx.aspect.annotation.OperationLogAnnotation;
import com.baosight.hpjx.common.DdynamicEnum;
import com.baosight.hpjx.core.constant.CommonConstant;
import com.baosight.hpjx.core.dao.DaoUtils;
import com.baosight.hpjx.core.enums.UserStatusEnum;
import com.baosight.hpjx.core.security.UserSessionUtils;
import com.baosight.hpjx.hp.constant.HPConstant;
import com.baosight.hpjx.hp.constant.HPSqlConstant;
import com.baosight.hpjx.hp.pz.domain.HPPZ013;
import com.baosight.hpjx.hp.pz.domain.HPPZ01301;
import com.baosight.hpjx.hp.pz.domain.HPPZ014;
import com.baosight.hpjx.hp.pz.domain.HPPZ01401;
import com.baosight.hpjx.hp.pz.tools.HPPZTools;
import com.baosight.hpjx.hp.xs.tools.HPXSTools;
import com.baosight.hpjx.util.AssertUtils;
import com.baosight.hpjx.util.CommonMethod;
import com.baosight.hpjx.util.DateUtils;
import com.baosight.hpjx.util.EiInfoUtils;
import com.baosight.hpjx.util.LogUtils;
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 com.baosight.iplat4j.ed.util.SequenceGenerator;
import org.apache.commons.collections.CollectionUtils;
import java.util.Arrays;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
* 用工登记
*
* @author:songx
* @date:2024/1/18,17:15
*/
public class ServiceHPPZ014 extends ServiceBase {
/**
* 画面初始化
*
* @param inInfo
* @return
*/
@Override
@OperationLogAnnotation(operModul = "用工登记", operType = "查询", operDesc = "初始化")
public EiInfo initLoad(EiInfo inInfo) {
try {
CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.FACTORY_RECORD_BLOCK_ID), null, false);
CommonMethod.initBlock(inInfo, Arrays.asList(DdynamicEnum.GROUP_RECORD_BLOCK_ID), null, false);
inInfo.addBlock(EiConstant.resultBlock).addBlockMeta(new HPPZ01401().eiMetadata);
} catch (PlatException e) {
LogUtils.setDetailMsg(inInfo, e, "初始化失败");
}
return inInfo;
}
/**
* 查询数据列表
*
* @param inInfo
* @return
*/
@Override
@OperationLogAnnotation(operModul = "用工登记", operType = "查询", operDesc = "查询")
public EiInfo query(EiInfo inInfo) {
try {
inInfo = super.query(inInfo, HPPZ014.QUERY, new HPPZ01401());
// 设置用户信息
HPXSTools.XsUser.setUserInfo(inInfo, HPPZ01401.FIELD_USER_ID);
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "查询失败");
}
return inInfo;
}
/**
* 用工登记.
*
* @param inInfo
* @return
*/
@OperationLogAnnotation(operModul = "用工登记", operType = "新增", operDesc = "用工登记")
public EiInfo checkIn(EiInfo inInfo) {
try {
// 登记日期
Map queryMap = EiInfoUtils.getFirstRow(inInfo, "main");
String regDate = DateUtils.formatShort(queryMap.get("regDate"));
List<Map> resultRows = inInfo.getBlock(EiConstant.resultBlock).getRows();
// 写入数据
this.saveData(resultRows, regDate);
inInfo.setStatus(EiConstant.STATUS_DEFAULT);
inInfo.setMsg("操作成功!本次对[" + resultRows.size() + "]条数据登记成功!");
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "登记失败");
}
return inInfo;
}
/**
* 保存数据
*
* @param resultRows
* @param regDate
*/
private void saveData(List<Map> resultRows, String regDate) {
for (Map resultRow : resultRows) {
HPPZ014 fPz014 = new HPPZ014();
fPz014.fromMap(resultRow);
fPz014.setRegDate(regDate);
// 检查用户是否已登记
Map queryMap = new HashMap();
queryMap.put("factoryCode", fPz014.getFactoryCode());
queryMap.put("groupCode", fPz014.getGroupCode());
queryMap.put("userId", fPz014.getUserId());
queryMap.put("regDate", regDate);
List<HPPZ014> dbHp014s = dao.query(HPPZ014.QUERY, queryMap);
if (CollectionUtils.isEmpty(dbHp014s)) {
// 设置基础信息
this.setBaseInfo(fPz014);
// 写入数据
this.add(fPz014);
} else {
this.modify(fPz014);
}
}
}
/**
* 设置基础信息
*
* @param fPz014
*/
private void setBaseInfo(HPPZ014 fPz014) {
// 厂区名称
fPz014.setFactoryName(HPXSTools.XsOrg.get(fPz014.getFactoryCode()).getOrgCname());
// 组名称
fPz014.setGroupName(HPXSTools.XsOrg.get(fPz014.getGroupCode()).getOrgCname());
}
/**
* 新增数据
*
* @param fPz014
*/
private void add(HPPZ014 fPz014) {
fPz014.setDeleteFlag(CommonConstant.YesNo.NO_0);
DaoUtils.insert(HPPZ014.INSERT, fPz014);
}
/**
* 修改
*
* @param fPz014
*/
private void modify(HPPZ014 fPz014) {
DaoUtils.update(HPSqlConstant.HPPZ014.UPDATE_TIME, fPz014);
}
/**
* 删除操作
*
* @param inInfo
* @return
*/
@OperationLogAnnotation(operModul = "用工登记", operType = "删除", operDesc = "删除操作")
public EiInfo delete(EiInfo inInfo) {
try {
List<Map> resultRows = inInfo.getBlock(EiConstant.resultBlock).getRows();
for (Map resultRow : resultRows) {
HPPZ014 fPz014 = new HPPZ014();
fPz014.fromMap(resultRow);
fPz014.setDeleteFlag(CommonConstant.YesNo.YES_1);
DaoUtils.update(HPPZ014.DELETE, fPz014);
}
inInfo = this.query(inInfo);
inInfo.setStatus(EiConstant.STATUS_DEFAULT);
inInfo.setMsg("操作成功!本次对[" + resultRows.size() + "]条数据删除成功!");
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "修改失败");
}
return inInfo;
}
}
...@@ -15,7 +15,7 @@ ...@@ -15,7 +15,7 @@
DELETE_FLAG as "deleteFlag", <!-- 0.否1.是 --> DELETE_FLAG as "deleteFlag", <!-- 0.否1.是 -->
FACTORY_CODE as "factoryCode", <!-- 工厂编码 --> FACTORY_CODE as "factoryCode", <!-- 工厂编码 -->
FACTORY_NAME as "factoryName", <!-- 工厂名称 --> FACTORY_NAME as "factoryName", <!-- 工厂名称 -->
DEPT_TYPE as "deptType", <!-- 部门类型 --> GROUP_TYPE as "groupType", <!-- 部门类型 -->
GROUP_CODE as "groupCode", <!-- 生产组编码 --> GROUP_CODE as "groupCode", <!-- 生产组编码 -->
GROUP_NAME as "groupName", <!-- 生产组名称 --> GROUP_NAME as "groupName", <!-- 生产组名称 -->
USER_ID as "userId", <!-- 用户ID --> USER_ID as "userId", <!-- 用户ID -->
...@@ -25,6 +25,7 @@ ...@@ -25,6 +25,7 @@
</sql> </sql>
<sql id="condition"> <sql id="condition">
AND DELETE_FLAG = '0'
<isNotEmpty prepend=" AND " property="id"> <isNotEmpty prepend=" AND " property="id">
ID = #id# ID = #id#
</isNotEmpty> </isNotEmpty>
...@@ -61,8 +62,8 @@ ...@@ -61,8 +62,8 @@
<isNotEmpty prepend=" AND " property="factoryName"> <isNotEmpty prepend=" AND " property="factoryName">
FACTORY_NAME = #factoryName# FACTORY_NAME = #factoryName#
</isNotEmpty> </isNotEmpty>
<isNotEmpty prepend=" AND " property="deptType"> <isNotEmpty prepend=" AND " property="groupType">
DEPT_TYPE = #deptType# GROUP_TYPE = #groupType#
</isNotEmpty> </isNotEmpty>
<isNotEmpty prepend=" AND " property="groupCode"> <isNotEmpty prepend=" AND " property="groupCode">
GROUP_CODE = #groupCode# GROUP_CODE = #groupCode#
...@@ -74,7 +75,7 @@ ...@@ -74,7 +75,7 @@
USER_ID = #userId# USER_ID = #userId#
</isNotEmpty> </isNotEmpty>
<isNotEmpty prepend=" AND " property="userName"> <isNotEmpty prepend=" AND " property="userName">
USER_NAME = #userName# USER_NAME LIKE CONCAT('%', #userName#, '%')
</isNotEmpty> </isNotEmpty>
<isNotEmpty prepend=" AND " property="status"> <isNotEmpty prepend=" AND " property="status">
STATUS = #status# STATUS = #status#
...@@ -84,6 +85,15 @@ ...@@ -84,6 +85,15 @@
</isNotEmpty> </isNotEmpty>
</sql> </sql>
<sql id="customCondition">
<isNotEmpty prepend=" AND " property="gender">
USER_ID IN (SELECT LOGIN_NAME FROM ${platSchema}.XS_USER WHERE COMPANY_CODE = #companyCode# AND GENDER = #gender# )
</isNotEmpty>
<isNotEmpty prepend=" AND " property="mobile">
USER_ID IN (SELECT LOGIN_NAME FROM ${platSchema}.XS_USER WHERE COMPANY_CODE = #companyCode# AND MOBILE LIKE CONCAT('%', #mobile#, '%'))
</isNotEmpty>
</sql>
<!-- 公共修改字段 --> <!-- 公共修改字段 -->
<sql id="updateRevise"> <sql id="updateRevise">
UPDATED_BY = #updatedBy#, UPDATED_BY = #updatedBy#,
...@@ -97,7 +107,7 @@ ...@@ -97,7 +107,7 @@
$order$ $order$
</isNotEmpty> </isNotEmpty>
<isEmpty property="order"> <isEmpty property="order">
ID asc ID DESC
</isEmpty> </isEmpty>
</dynamic> </dynamic>
</sql> </sql>
...@@ -107,12 +117,14 @@ ...@@ -107,12 +117,14 @@
<include refid="column"/> <include refid="column"/>
FROM ${hpjxSchema}.T_HPPZ013 WHERE 1=1 FROM ${hpjxSchema}.T_HPPZ013 WHERE 1=1
<include refid="condition"/> <include refid="condition"/>
<include refid="customCondition"/>
<include refid="order"/> <include refid="order"/>
</select> </select>
<select id="count" resultClass="int"> <select id="count" resultClass="int">
SELECT COUNT(*) FROM ${hpjxSchema}.T_HPPZ013 WHERE 1=1 SELECT COUNT(*) FROM ${hpjxSchema}.T_HPPZ013 WHERE 1=1
<include refid="condition"/> <include refid="condition"/>
<include refid="customCondition"/>
</select> </select>
<insert id="insert"> <insert id="insert">
...@@ -125,7 +137,7 @@ ...@@ -125,7 +137,7 @@
DELETE_FLAG, <!-- 0.否1.是 --> DELETE_FLAG, <!-- 0.否1.是 -->
FACTORY_CODE, <!-- 工厂编码 --> FACTORY_CODE, <!-- 工厂编码 -->
FACTORY_NAME, <!-- 工厂名称 --> FACTORY_NAME, <!-- 工厂名称 -->
DEPT_TYPE, <!-- 部门类型 --> GROUP_TYPE, <!-- 部门类型 -->
GROUP_CODE, <!-- 生产组编码 --> GROUP_CODE, <!-- 生产组编码 -->
GROUP_NAME, <!-- 生产组名称 --> GROUP_NAME, <!-- 生产组名称 -->
USER_ID, <!-- 用户ID --> USER_ID, <!-- 用户ID -->
...@@ -134,15 +146,17 @@ ...@@ -134,15 +146,17 @@
REMARK <!-- 备注 --> REMARK <!-- 备注 -->
) VALUES ( ) VALUES (
#companyCode#, #depCode#, #createdBy#, #createdName#, #createdTime#, #companyCode#, #depCode#, #createdBy#, #createdName#, #createdTime#,
#deleteFlag#, #factoryCode#, #factoryName#, #deptType#, #groupCode#, #deleteFlag#, #factoryCode#, #factoryName#, #groupType#, #groupCode#,
#groupName#, #userId#, #userName#, #status#, #remark# #groupName#, #userId#, #userName#, #status#, #remark#
) )
</insert> </insert>
<!-- 逻辑删除 --> <!-- 逻辑删除 -->
<delete id="delete"> <delete id="delete">
UPDATE FROM ${hpjxSchema}.T_HPPZ013 UPDATE ${hpjxSchema}.T_HPPZ013
SET DELETE_FLAG = #deleteFlag# SET
DELETE_FLAG = #deleteFlag#,
<include refid="updateRevise"/>
WHERE ID = #id# WHERE ID = #id#
</delete> </delete>
......
<?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="HPPZ014">
<sql id="column">
ID as "id",
COMPANY_CODE as "companyCode", <!-- 企业编码 -->
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.是 -->
FACTORY_CODE as "factoryCode", <!-- 工厂编码 -->
FACTORY_NAME as "factoryName", <!-- 工厂名称 -->
GROUP_TYPE as "groupType", <!-- 部门类型 -->
GROUP_CODE as "groupCode", <!-- 生产组编码 -->
GROUP_NAME as "groupName", <!-- 生产组名称 -->
USER_ID as "userId", <!-- 用户ID -->
USER_NAME as "userName", <!-- 用户名称 -->
REG_DATE as "regDate" <!-- 登记日期 -->
</sql>
<sql id="condition">
AND DELETE_FLAG = '0'
<isNotEmpty prepend=" AND " property="id">
ID = #id#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="companyCode">
COMPANY_CODE = #companyCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="depCode">
DEP_CODE = #depCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="createdBy">
CREATED_BY = #createdBy#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="createdName">
CREATED_NAME = #createdName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="createdTime">
CREATED_TIME = #createdTime#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="updatedBy">
UPDATED_BY = #updatedBy#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="updatedName">
UPDATED_NAME = #updatedName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="updatedTime">
UPDATED_TIME = #updatedTime#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="deleteFlag">
DELETE_FLAG = #deleteFlag#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="factoryCode">
FACTORY_CODE = #factoryCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="factoryName">
FACTORY_NAME = #factoryName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="groupType">
GROUP_TYPE = #groupType#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="groupCode">
GROUP_CODE = #groupCode#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="groupName">
GROUP_NAME = #groupName#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="userId">
USER_ID = #userId#
</isNotEmpty>
<isNotEmpty prepend=" AND " property="userName">
USER_NAME LIKE CONCAT('%', #userName#, '%')
</isNotEmpty>
<isNotEmpty prepend=" AND " property="regDate">
REG_DATE = #regDate#
</isNotEmpty>
</sql>
<sql id="customCondition">
<isNotEmpty prepend=" AND " property="gender">
USER_ID IN (SELECT LOGIN_NAME FROM ${platSchema}.XS_USER WHERE COMPANY_CODE = #companyCode# AND GENDER = #gender# )
</isNotEmpty>
<isNotEmpty prepend=" AND " property="mobile">
USER_ID IN (SELECT LOGIN_NAME FROM ${platSchema}.XS_USER WHERE COMPANY_CODE = #companyCode# AND MOBILE LIKE CONCAT('%', #mobile#, '%'))
</isNotEmpty>
<isNotEmpty prepend=" AND " property="regDateFrom">
REG_DATE &gt;= REPLACE(#regDateFrom#,'-','')
</isNotEmpty>
<isNotEmpty prepend=" AND " property="regDateTo">
REG_DATE &lt;= REPLACE(#regDateTo#,'-','')
</isNotEmpty>
</sql>
<!-- 公共修改字段 -->
<sql id="updateRevise">
UPDATED_BY = #updatedBy#,
UPDATED_NAME = #updatedName#,
UPDATED_TIME = #updatedTime#
</sql>
<sql id="order">
<dynamic prepend="ORDER BY">
<isNotEmpty property="order">
$order$
</isNotEmpty>
<isEmpty property="order">
REG_DATE DESC, CREATED_TIME DESC
</isEmpty>
</dynamic>
</sql>
<select id="query" resultClass="com.baosight.hpjx.hp.pz.domain.HPPZ014">
SELECT
<include refid="column"/>
FROM ${hpjxSchema}.T_HPPZ014 WHERE 1=1
<include refid="condition"/>
<include refid="customCondition"/>
<include refid="order"/>
</select>
<select id="count" resultClass="int">
SELECT COUNT(*) FROM ${hpjxSchema}.T_HPPZ014 WHERE 1=1
<include refid="condition"/>
<include refid="customCondition"/>
</select>
<insert id="insert">
INSERT INTO ${hpjxSchema}.T_HPPZ014 (
COMPANY_CODE, <!-- 企业编码 -->
DEP_CODE, <!-- 部门编码 -->
CREATED_BY, <!-- 创建人 -->
CREATED_NAME, <!-- 创建人名称 -->
CREATED_TIME, <!-- 创建时间 -->
DELETE_FLAG, <!-- 0.否1.是 -->
FACTORY_CODE, <!-- 工厂编码 -->
FACTORY_NAME, <!-- 工厂名称 -->
GROUP_TYPE, <!-- 部门类型 -->
GROUP_CODE, <!-- 生产组编码 -->
GROUP_NAME, <!-- 生产组名称 -->
USER_ID, <!-- 用户ID -->
USER_NAME, <!-- 用户名称 -->
REG_DATE <!-- 登记日期 -->
) VALUES (
#companyCode#, #depCode#, #createdBy#, #createdName#, #createdTime#,
#deleteFlag#, #factoryCode#, #factoryName#, #groupType#, #groupCode#,
#groupName#, #userId#, #userName#, #regDate#
)
</insert>
<!-- 逻辑删除 -->
<delete id="delete">
UPDATE ${hpjxSchema}.T_HPPZ014
SET
DELETE_FLAG = #deleteFlag#,
<include refid="updateRevise"/>
WHERE ID = #id#
</delete>
<!-- 修改 -->
<delete id="update">
UPDATE ${hpjxSchema}.T_HPPZ014
SET
<include refid="updateRevise"/>
WHERE ID = #id#
</delete>
<!-- 修改时间 -->
<delete id="updateTime">
UPDATE ${hpjxSchema}.T_HPPZ014
SET
<include refid="updateRevise"/>
WHERE 1=1
AND FACTORY_CODE = #factoryCode#
AND GROUP_CODE = #groupCode#
AND USER_ID = #userId#
and REG_DATE = #regDate#
</delete>
</sqlMap>
...@@ -133,14 +133,19 @@ ...@@ -133,14 +133,19 @@
) AS T1, ) AS T1,
@LEVEL:=@LEVEL+1 AS LEVEL @LEVEL:=@LEVEL+1 AS LEVEL
FROM ${platSchema}.TXSOG01, FROM ${platSchema}.TXSOG01,
(SELECT @CODES:=#parentOrgId#, @LEVEL:= 0) T4 <isNotEmpty property="parentOrgId">
(SELECT @CODES:=#parentOrgId#, @LEVEL:= 0) T4
</isNotEmpty>
<isEmpty property="parentOrgId">
(SELECT @CODES:='root', @LEVEL:= 0) T4
</isEmpty>
WHERE @CODES IS NOT NULL WHERE @CODES IS NOT NULL
) T2, ) T2,
${platSchema}.TXSOG01 T3 ${platSchema}.TXSOG01 T3
LEFT JOIN ${platSchema}.TXSOG01 T5 ON T3.FACTORY_CODE = T5.ORG_ID LEFT JOIN ${platSchema}.TXSOG01 T5 ON T3.FACTORY_CODE = T5.ORG_ID
WHERE 1=1 WHERE 1=1
AND FIND_IN_SET(T3.ORG_ID, T2.CODES) AND FIND_IN_SET(T3.ORG_ID, T2.CODES)
AND T3.ORG_TYPE IN ('prodGroup', 'cutGroup', 'factory') AND T3.ORG_TYPE IN ('prodGroup', 'cutGroup')
<isNotEmpty prepend=" AND " property="orgType"> <isNotEmpty prepend=" AND " property="orgType">
T3.ORG_TYPE = #orgType# T3.ORG_TYPE = #orgType#
</isNotEmpty> </isNotEmpty>
......
...@@ -8,6 +8,7 @@ import com.baosight.hpjx.util.AssertUtils; ...@@ -8,6 +8,7 @@ import com.baosight.hpjx.util.AssertUtils;
import com.baosight.hpjx.util.MapUtils; import com.baosight.hpjx.util.MapUtils;
import com.baosight.hpjx.util.ObjectUtils; import com.baosight.hpjx.util.ObjectUtils;
import com.baosight.hpjx.util.RsaUtils; import com.baosight.hpjx.util.RsaUtils;
import com.baosight.hpjx.util.StringUtils;
import com.baosight.iplat4j.core.ei.EiConstant; import com.baosight.iplat4j.core.ei.EiConstant;
import com.baosight.iplat4j.core.ei.EiInfo; import com.baosight.iplat4j.core.ei.EiInfo;
import com.baosight.iplat4j.core.exception.PlatException; import com.baosight.iplat4j.core.exception.PlatException;
...@@ -104,18 +105,24 @@ public class HPXSTools { ...@@ -104,18 +105,24 @@ public class HPXSTools {
* 初始化新增用户 * 初始化新增用户
* *
* @param companyCode * @param companyCode
* @param userId
* @param userName
* @param gender
* @param mobile
*/ */
public static void addUser(String companyCode, String userName) throws Exception { public static void addUser(String companyCode, String userId, String userName, String gender, String mobile)
throws Exception {
Map inInfoRowMap = new HashMap(); Map inInfoRowMap = new HashMap();
inInfoRowMap.put("userId", companyCode); inInfoRowMap.put("userId", userId);
inInfoRowMap.put("loginName", companyCode); inInfoRowMap.put("loginName", userId);
inInfoRowMap.put("userName", userName); inInfoRowMap.put("userName", userName);
// 使用公钥加密密码 // 使用公钥加密密码
String password = RsaUtils.encryptByPublicKey(LoginConstants.rsaPublicKey, companyCode); String password = RsaUtils.encryptByPublicKey(LoginConstants.rsaPublicKey, companyCode);
inInfoRowMap.put("password", password); inInfoRowMap.put("password", password);
inInfoRowMap.put("rePass", password); inInfoRowMap.put("rePass", password);
inInfoRowMap.put("email", " "); inInfoRowMap.put("email", " ");
inInfoRowMap.put("mobile", " "); inInfoRowMap.put("gender", StringUtils.isBlank(gender) ? " " : gender);
inInfoRowMap.put("mobile", StringUtils.isBlank(mobile) ? " " : mobile);
inInfoRowMap.put("companyCode", companyCode); inInfoRowMap.put("companyCode", companyCode);
EiInfo inInfo = new EiInfo(); EiInfo inInfo = new EiInfo();
inInfo.addBlock("details").addRow(inInfoRowMap); inInfo.addBlock("details").addRow(inInfoRowMap);
......
...@@ -210,11 +210,11 @@ public class DateUtils extends org.apache.commons.lang3.time.DateUtils { ...@@ -210,11 +210,11 @@ public class DateUtils extends org.apache.commons.lang3.time.DateUtils {
* *
* @return * @return
*/ */
public static String formatShort(String dateTime) { public static String formatShort(Object dateTime) {
if (StringUtils.isBlank(dateTime)) { if (ObjectUtils.isNullBlank(dateTime)) {
return dateTime; return dateTime == null ? null : dateTime.toString();
} }
return dateTime.replaceAll("-", "") return dateTime.toString().replaceAll("-", "")
.replaceAll("/", "") .replaceAll("/", "")
.replaceAll(":", "") .replaceAll(":", "")
.replaceAll(" ", ""); .replaceAll(" ", "");
......
...@@ -6,7 +6,7 @@ $(function () { ...@@ -6,7 +6,7 @@ $(function () {
pageSize: 20, pageSize: 20,
pageSizes: [10, 20, 50, 70, 100], pageSizes: [10, 20, 50, 70, 100],
}, },
columns: [ { columns: [{
field: "groupCode", field: "groupCode",
template: function (dataItem) { template: function (dataItem) {
for (let i = 0; i < groupGlobalData.length; i++) { for (let i = 0; i < groupGlobalData.length; i++) {
...@@ -19,6 +19,7 @@ $(function () { ...@@ -19,6 +19,7 @@ $(function () {
editor: function (container, options) { editor: function (container, options) {
let inInfo = new EiInfo(); let inInfo = new EiInfo();
inInfo.set("inqu_status-0-parentOrgId", options.model["factoryCode"]); inInfo.set("inqu_status-0-parentOrgId", options.model["factoryCode"]);
inInfo.set("inqu_status-0-orgType", options.model["groupType"]);
inInfo.set("inqu_status-0-isSplicingSymbol", false); inInfo.set("inqu_status-0-isSplicingSymbol", false);
inInfo.set("serviceName", "HPXSOrg"); inInfo.set("serviceName", "HPXSOrg");
inInfo.set("methodName", "queryGroupComboBox"); inInfo.set("methodName", "queryGroupComboBox");
...@@ -46,6 +47,9 @@ $(function () { ...@@ -46,6 +47,9 @@ $(function () {
// 查询 // 查询
$("#QUERY").on("click", query); $("#QUERY").on("click", query);
// 用工登记
$("#CHECK_IN").on("click", checkIn);
}); });
/** /**
...@@ -90,46 +94,38 @@ let save = function () { ...@@ -90,46 +94,38 @@ let save = function () {
message("请选择数据"); message("请选择数据");
return; return;
} }
let flag = true; for (let i = 0; i < rows.length; i++) {
$.each(rows, function(index, item) { let item = rows[i];
let whCode= item.get("whCode"); if (isBlank(item['factoryCode'])) {
let inventCode= item.get("inventCode"); message("选中的第" + (i + 1) + "行\"工厂\",不能为空!");
let inventRecordId= item.get("inventRecordId"); return;
let inventType= item.get("inventType");
let warnNum= item.get("warnNum");
if(isBlank(inventType)){
message("选中的第"+(index+1)+"行\"存货类型\",不能为空!");
flag = false;
return false;
} }
if(isBlank(whCode)){ if (isBlank(item['groupType'])) {
message("选中的第"+(index+1)+"行\"仓库名称\",不能为空!"); message("选中的第" + (i + 1) + "行\"部门类型\",不能为空!");
flag = false; return;
return false;
} }
if(isBlank(inventCode)){ if (isBlank(item['groupCode'])) {
message("选中的第"+(index+1)+"行\"存货名称\",不能为空!"); message("选中的第" + (i + 1) + "行\"生产部门\",不能为空!");
flag = false; return;
return false;
} }
if(isBlank(inventRecordId)){ if (isBlank(item['userName'])) {
message("选中的第"+(index+1)+"行\"规格\",不能为空!"); message("选中的第" + (i + 1) + "行\"姓名\",不能为空!");
flag = false; return;
return false;
} }
if(!isPositiveInteger(warnNum)){ if (isBlank(item['gender'])) {
message("选中的第"+(index+1)+"行\"预警值\",必须是大于0的整数!"); message("选中的第" + (i + 1) + "行\"性别\",不能为空!");
flag = false; return;
return false; }
if (isBlank(item['mobile'])) {
message("选中的第" + (i + 1) + "行\"联系方式\",不能为空!");
return;
} }
});
if(flag) {
JSUtils.confirm("确定对勾选中的[" + rows.length + "]条数据做\"保存\"操作? ", {
ok: function () {
JSUtils.submitGridsData("result", "HPPZ012", "save", true);
}
});
} }
JSUtils.confirm("确定对勾选中的[" + rows.length + "]条数据做\"保存\"操作? ", {
ok: function () {
JSUtils.submitGridsData("result", "HPPZ013", "save", true);
}
});
} }
/** /**
...@@ -143,7 +139,41 @@ let deleteFunc = function () { ...@@ -143,7 +139,41 @@ let deleteFunc = function () {
} }
JSUtils.confirm("确定对勾选中的[" + rows.length + "]条数据做\"删除\"操作? ", { JSUtils.confirm("确定对勾选中的[" + rows.length + "]条数据做\"删除\"操作? ", {
ok: function () { ok: function () {
JSUtils.submitGridsData("result", "HPPZ012", "delete", true); JSUtils.submitGridsData("result", "HPPZ013", "delete", true);
} }
}); });
} }
/**
* 用工登记
*/
let checkIn = function () {
let rows = resultGrid.getCheckedRows();
if (rows.length < 1) {
message("请选择数据");
return;
}
JSColorbox.open({
href: "HPPZ013A?methodName=initLoad",
title: "<div style='text-align: center;'>用工登记</div>",
width: "30%",
height: "50%",
callbackName: checkInCallback
});
}
/**
* 登记日期回调
*/
let checkInCallback = function (regDate) {
let inInfo = new EiInfo();
inInfo.set("main-0-regDate", regDate);
JSUtils.submitGridsData("result", "HPPZ014", "checkIn", true,
function (res) {
if (res.status > -1) {
// 关闭弹窗
JSColorbox.close();
}
}, inInfo
);
}
...@@ -9,6 +9,7 @@ ...@@ -9,6 +9,7 @@
<EF:EFRegion id="inqu" title="查询条件"> <EF:EFRegion id="inqu" title="查询条件">
<div class="row"> <div class="row">
<EF:EFSelect cname="工厂" blockId="inqu_status" ename="factoryCode" row="0" colWidth="3" filter="contains"> <EF:EFSelect cname="工厂" blockId="inqu_status" ename="factoryCode" row="0" colWidth="3" filter="contains">
<EF:EFOption label="全部" value=""/>
<EF:EFOptions blockId="factory_record_block_id" textField="textField" valueField="valueField"/> <EF:EFOptions blockId="factory_record_block_id" textField="textField" valueField="valueField"/>
</EF:EFSelect> </EF:EFSelect>
<EF:EFSelect cname="部门类型" blockId="inqu_status" ename="groupType" row="0" colWidth="3" filter="contains" <EF:EFSelect cname="部门类型" blockId="inqu_status" ename="groupType" row="0" colWidth="3" filter="contains"
...@@ -17,7 +18,8 @@ ...@@ -17,7 +18,8 @@
<EF:EFCodeOption codeName="xs.og.orgType" condition="ITEM_CODE IN ('prodGroup', 'cutGroup')"/> <EF:EFCodeOption codeName="xs.og.orgType" condition="ITEM_CODE IN ('prodGroup', 'cutGroup')"/>
</EF:EFSelect> </EF:EFSelect>
<EF:EFSelect cname="生产部门" blockId="inqu_status" ename="groupCode" row="0" colWidth="3" filter="contains"> <EF:EFSelect cname="生产部门" blockId="inqu_status" ename="groupCode" row="0" colWidth="3" filter="contains">
<EF:EFOptions blockId="groupCode_record_block_id" textField="textField" valueField="valueField"/> <EF:EFOption label="全部" value=""/>
<EF:EFOptions blockId="group_record_block_id" textField="textField" valueField="valueField"/>
</EF:EFSelect> </EF:EFSelect>
<EF:EFInput cname="姓名" blockId="inqu_status" ename="userName" row="0" colWidth="3"/> <EF:EFInput cname="姓名" blockId="inqu_status" ename="userName" row="0" colWidth="3"/>
</div> </div>
...@@ -46,11 +48,15 @@ ...@@ -46,11 +48,15 @@
<EF:EFCodeOption codeName="xs.og.orgType" condition="ITEM_CODE IN ('prodGroup', 'cutGroup')"/> <EF:EFCodeOption codeName="xs.og.orgType" condition="ITEM_CODE IN ('prodGroup', 'cutGroup')"/>
</EF:EFComboColumn> </EF:EFComboColumn>
<EF:EFColumn ename="groupCode" cname="生产部门" width="120" align="center" required="true" readonly="true"/> <EF:EFColumn ename="groupCode" cname="生产部门" width="120" align="center" required="true" readonly="true"/>
<EF:EFComboColumn ename="gender" cname="性别" valueField="valueField" textField="textField" align="center"> <EF:EFColumn ename="userId" cname="工号" enable="false" width="120" align="center"/>
<EF:EFColumn ename="userName" cname="姓名" width="120" align="center" required="true" readonly="true"/>
<EF:EFComboColumn ename="gender" cname="性别" width="80" align="center" required="true" readonly="true"
valueField="valueField" textField="textField">
<EF:EFCodeOption codeName="xservices.xs.sex"/> <EF:EFCodeOption codeName="xservices.xs.sex"/>
</EF:EFComboColumn> </EF:EFComboColumn>
<EF:EFColumn ename="mobile" cname="联系方式" width="120" align="center" required="true" readonly="true"/> <EF:EFColumn ename="mobile" cname="联系方式" width="120" align="center" required="true" readonly="true"/>
<EF:EFComboColumn ename="status" cname="状态" valueField="valueField" textField="textField" align="center"> <EF:EFComboColumn ename="status" cname="状态" width="80" align="center" defaultValue="1"
valueField="valueField" textField="textField">
<EF:EFCodeOption codeName="ctdy.hppz.userStatus"/> <EF:EFCodeOption codeName="ctdy.hppz.userStatus"/>
</EF:EFComboColumn> </EF:EFComboColumn>
<EF:EFColumn ename="remark" cname="备注" width="150"/> <EF:EFColumn ename="remark" cname="备注" width="150"/>
......
$(function () {
// 登记
$("#CONFIRM").on("click", confirm);
});
/**
* 页面加载时执行
*/
$(window).load(function () {
// 默认当天
$("#inqu_status-0-regDate").val(currDate());
});
/**
* 登记
*/
let confirm = function () {
let regDate = $("#inqu_status-0-regDate").val();
if (isBlank(regDate)) {
message("请选择登记日期");
return;
}
JSUtils.confirm("确定进行\"登记\"操作? ", {
ok: function () {
parent.JSColorbox.setValueCallback(regDate);
}
});
}
<!DOCTYPE html>
<%@ page contentType="text/html; charset=UTF-8" %>
<%@ 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>
<EF:EFRegion id="inqu" title="">
<div class="row">
<EF:EFDatePicker cname="登记日期" blockId="inqu_status" ename="regDate" row="0" colWidth="3" ratio="2:10"
role="date" format="yyyy-MM-dd" parseFormats="['yyyyMMdd']" readonly="true"/>
</div>
</EF:EFRegion>
</EF:EFPage>
$(function () {
IPLATUI.EFGrid.result = {
pageable: {
pageSize: 20,
pageSizes: [10, 20, 50, 70, 100],
},
columns: [],
onDelete: function (e) {
// 阻止默认请求,使用自定义删除
e.preventDefault();
deleteFunc();
}
}
// 查询
$("#QUERY").on("click", query);
});
/**
* 页面加载时执行
*/
$(window).load(function () {
// 查询
query();
});
/**
* 查询
*/
let query = function () {
resultGrid.dataSource.page(1);
}
/**
* 删除
*/
let deleteFunc = function () {
let rows = resultGrid.getCheckedRows();
if (rows.length < 1) {
message("请选择数据");
return;
}
JSUtils.confirm("确定对勾选中的[" + rows.length + "]条数据做\"删除\"操作? ", {
ok: function () {
JSUtils.submitGridsData("result", "HPPZ014", "delete", true);
}
});
}
<!DOCTYPE html>
<%@ page contentType="text/html; charset=UTF-8" %>
<%@ 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:EFSelect cname="工厂" blockId="inqu_status" ename="factoryCode" row="0" colWidth="3" filter="contains">
<EF:EFOption label="全部" value=""/>
<EF:EFOptions blockId="factory_record_block_id" textField="textField" valueField="valueField"/>
</EF:EFSelect>
<EF:EFSelect cname="部门类型" blockId="inqu_status" ename="groupType" row="0" colWidth="3" filter="contains"
defultValue="">
<EF:EFOption label="全部" value=""/>
<EF:EFCodeOption codeName="xs.og.orgType" condition="ITEM_CODE IN ('prodGroup', 'cutGroup')"/>
</EF:EFSelect>
<EF:EFSelect cname="生产部门" blockId="inqu_status" ename="groupCode" row="0" colWidth="3" filter="contains">
<EF:EFOption label="全部" value=""/>
<EF:EFOptions blockId="group_record_block_id" textField="textField" valueField="valueField"/>
</EF:EFSelect>
<EF:EFInput cname="姓名" blockId="inqu_status" ename="userName" row="0" colWidth="3"/>
</div>
<div class="row">
<EF:EFSelect cname="性别" blockId="inqu_status" ename="gender" row="0" colWidth="3">
<EF:EFOption label="全部" value=""/>
<EF:EFCodeOption codeName="xservices.xs.sex"/>
</EF:EFSelect>
<EF:EFInput cname="联系方式" blockId="inqu_status" ename="mobile" row="0" colWidth="3"/>
<EF:EFDateSpan startCname="登记日期(从)" endCname="至" blockId="inqu_status"
startName="regDateFrom" endName="regDateTo" row="0" role="date"
format="yyyy-MM-dd" ratio="3:3" satrtRatio="4:8" endRatio="4:8" readonly="true">
</EF:EFDateSpan>
</div>
</EF:EFRegion>
<EF:EFRegion id="result" title="记录集">
<EF:EFGrid blockId="result" autoDraw="override" checkMode="row">
<EF:EFColumn ename="id" cname="主键" hidden="true"/>
<EF:EFComboColumn ename="factoryCode" cname="厂区" enable="false" width="110" align="center">
<EF:EFOptions blockId="factory_record_block_id" valueField="valueField" textField="textField"/>
</EF:EFComboColumn>
<EF:EFComboColumn ename="groupType" cname="部门类型" enable="false" width="80" align="center">
<EF:EFCodeOption codeName="xs.og.orgType" condition="ITEM_CODE IN ('prodGroup', 'cutGroup')"/>
</EF:EFComboColumn>
<EF:EFComboColumn ename="groupCode" cname="生产部门" enable="false" width="110" align="center">
<EF:EFOptions blockId="group_record_block_id" valueField="valueField" textField="textField"/>
</EF:EFComboColumn>
<EF:EFColumn ename="userId" cname="工号" enable="false" width="120" align="center"/>
<EF:EFColumn ename="userName" cname="姓名" enable="false" width="120" align="center"/>
<EF:EFComboColumn ename="gender" cname="性别" enable="false" width="80" align="center"
valueField="valueField" textField="textField">
<EF:EFCodeOption codeName="xservices.xs.sex"/>
</EF:EFComboColumn>
<EF:EFColumn ename="mobile" cname="联系方式" enable="false" width="120" align="center"/>
<EF:EFColumn ename="regDate" cname="登记日期" enable="false" width="100" align="center"
editType="date" dateFormat="yyyy-MM-dd" parseFormats="['yyyyMMdd']"/>
</EF:EFGrid>
</EF:EFRegion>
</EF:EFPage>
...@@ -197,6 +197,19 @@ function refreshInputSelect(container, inInfo) { ...@@ -197,6 +197,19 @@ function refreshInputSelect(container, inInfo) {
} }
/** /**
* 当前日期 YYYY-MM-DD
*
* @returns {string}
*/
function currDate() {
const date = new Date();
const year = date.getFullYear();
const month = date.getMonth() + 1; // 月份从0开始,需要加1
const day = date.getDate();
return year + '-' + (month < 10 ? '0' + month : month) + '-' + (day < 10 ? '0' + day : day);
}
/**
* 当前日期 YYYYMMDD * 当前日期 YYYYMMDD
* *
* @returns {string} * @returns {string}
......
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