pull/45/head
dxfeng 2 years ago
commit 9a163f1742

@ -5,7 +5,9 @@ import com.engine.organization.entity.personnelcard.po.CardAccessPO;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
import java.util.Collection; import java.util.Collection;
import java.util.HashMap;
import java.util.List; import java.util.List;
import java.util.Map;
/** /**
* @Author weaver_cl * @Author weaver_cl
@ -17,9 +19,11 @@ public interface CardAccessMapper {
int insertIgnoreNull(CardAccessPO cardAccessPO); int insertIgnoreNull(CardAccessPO cardAccessPO);
int updateCardAccess(CardAccessPO cardAccessPO); int saveCardAccess(@Param("dataList") List<HashMap<String, Object>> dataList);
int deleteByIds(@Param("ids") Collection<Long> ids); int deleteByIds(@Param("ids") Collection<Long> ids);
ManagerDetachPO selectById(@Param("id") Integer id); ManagerDetachPO selectById(@Param("id") Integer id);
int updateTabName(@Param("name")String name,@Param("id") Integer id);
} }

@ -187,21 +187,35 @@
</trim> </trim>
</insert> </insert>
<update id="updateCardAccess" parameterType="com.engine.organization.entity.personnelcard.po.CardAccessPO">
update jcl_org_cardaccess
<set>
type_id=#{typeId},
type_name=#{typeName},
status=#{status},
all_people=#{allPeople},
all_superior=#{allSuperior},
custom=#{custom},
update_time=#{updateTime},
</set>
WHERE id = #{id} AND delete_type = 0
</update>
<update id="saveCardAccess">
<foreach collection="dataList" item="item" index="index" open="" close="" separator=";">
update jcl_org_cardaccess
<set>
<if test="item.status != null">
status = #{item.status},
</if>
<if test="item.allPeople != null">
all_people = #{item.allPeople},
</if>
<if test="item.superior != null">
superior = #{item.superior},
</if>
<if test="item.allSuperior != null">
all_superior = #{item.allSuperior},
</if>
<if test="item.custom != null">
custom = #{item.custom},
</if>
<if test="item.updateTime != null">
update_time = #{item.updateTime}
</if>
</set>
where id = #{item.id}
</foreach>
</update>
<update id="deleteByIds"> <update id="deleteByIds">
UPDATE jcl_org_cardaccess UPDATE jcl_org_cardaccess
SET delete_type = 1 SET delete_type = 1
@ -214,7 +228,6 @@
<select id="selectById" resultMap="BaseResultMap"> <select id="selectById" resultMap="BaseResultMap">
select select
<include refid="baseColumns"/> <include refid="baseColumns"/>
@ -222,4 +235,12 @@
WHERE delete_type = 0 WHERE delete_type = 0
AND id = #{id} AND id = #{id}
</select> </select>
<update id="updateTabName">
UPDATE jcl_org_cardaccess
SET type_name = #{name}
WHERE id = #{id}
</update>
</mapper> </mapper>

@ -1,5 +1,8 @@
package com.engine.organization.service; package com.engine.organization.service;
import com.engine.organization.entity.personnelcard.po.CardAccessPO;
import java.util.Collection;
import java.util.Map; import java.util.Map;
/** /**
@ -10,9 +13,46 @@ import java.util.Map;
**/ **/
public interface CardAccessService { public interface CardAccessService {
/**
*
* @return
*/
Map<String, Object> tablePage(); Map<String, Object> tablePage();
/**
*
* @return
*/
Map<String, Object> hasRight(); Map<String, Object> hasRight();
/**
*
* @param params
* @return
*/
int save(Map<String, Object> params); int save(Map<String, Object> params);
/**
*
* @param ids
* @return
*/
int deleteByIds(Collection<Long> ids);
/**
*
* @param cardAccessPO
* @return
*/
int addData(CardAccessPO cardAccessPO);
/**
* tab
* @param name
* @param id
* @return
*/
int updateTabName(String name,Integer id);
} }

@ -4,11 +4,15 @@ import com.cloudstore.eccom.result.WeaResultMsg;
import com.engine.core.impl.Service; import com.engine.core.impl.Service;
import com.engine.organization.component.OrganizationWeaTable; import com.engine.organization.component.OrganizationWeaTable;
import com.engine.organization.entity.detach.vo.ManagerDetachVO; import com.engine.organization.entity.detach.vo.ManagerDetachVO;
import com.engine.organization.entity.personnelcard.po.CardAccessPO;
import com.engine.organization.mapper.personnelcard.CardAccessMapper;
import com.engine.organization.service.CardAccessService; import com.engine.organization.service.CardAccessService;
import com.engine.organization.util.HasRightUtil; import com.engine.organization.util.HasRightUtil;
import com.engine.organization.util.db.MapperProxyFactory;
import weaver.general.Util;
import java.util.HashMap;
import java.util.Map; import java.util.*;
/** /**
* @Author weaver_cl * @Author weaver_cl
@ -20,6 +24,10 @@ public class CardAccessServiceImpl extends Service implements CardAccessService
private static final String RIGHT_NAME = "CardAccess:All"; private static final String RIGHT_NAME = "CardAccess:All";
private CardAccessMapper getCardAccessMapper() {
return MapperProxyFactory.getProxy(CardAccessMapper.class);
}
@Override @Override
public Map<String, Object> tablePage() { public Map<String, Object> tablePage() {
Map<String, Object> resultMap = new HashMap<>(); Map<String, Object> resultMap = new HashMap<>();
@ -44,8 +52,35 @@ public class CardAccessServiceImpl extends Service implements CardAccessService
@Override @Override
public int save(Map<String, Object> params) { public int save(Map<String, Object> params) {
int rowNum = Util.getIntValue((String) params.get("rownum"));
return 0; List<HashMap<String, Object>> dataList = new ArrayList<>();
for (int i = 0; i < rowNum; i++) {
HashMap<String, Object> data = new HashMap<>();
data.put("id",params.get("id_"+i));
data.put("status",params.get("status_"+i));
data.put("allPeople",params.get("all_people_"+i));
data.put("superior",params.get("superior_"+i));
data.put("allSuperior",params.get("all_superior_"+i));
data.put("custom",params.get("custom"+i));
data.put("updateTime",new Date());
dataList.add(data);
}
return getCardAccessMapper().saveCardAccess(dataList);
}
@Override
public int deleteByIds(Collection<Long> ids) {
return getCardAccessMapper().deleteByIds(ids);
}
@Override
public int addData(CardAccessPO cardAccessPO) {
return getCardAccessMapper().insertIgnoreNull(cardAccessPO);
}
@Override
public int updateTabName(String name,Integer id) {
return getCardAccessMapper().updateTabName(name,id);
} }

@ -17,7 +17,7 @@ import java.util.Map;
public class VODeleteModeExpand extends AbstractModeExpandJavaCodeNew { public class VODeleteModeExpand extends AbstractModeExpandJavaCodeNew {
public Map<String, String> doModeExpand(Map<String, Object> param) { public Map<String, String> doModeExpand(Map<String, Object> param) {
Map<String, String> result = new HashMap<String, String>(); Map<String, String> result = new HashMap();
try { try {
User user = (User) param.get("user"); User user = (User) param.get("user");
int billid = -1;//数据id int billid = -1;//数据id
@ -31,12 +31,14 @@ public class VODeleteModeExpand extends AbstractModeExpandJavaCodeNew {
String billids = (String) param.get("CheckedCheckboxIds"); String billids = (String) param.get("CheckedCheckboxIds");
String[] billidsTmp = billids.split(","); String[] billidsTmp = billids.split(",");
String currentDate = OrganizationDateUtil.getFormatLocalDate(new java.util.Date()); String currentDate = OrganizationDateUtil.getFormatLocalDate(new java.util.Date());
RecordSet rs = new RecordSet();
int st = 500000000;
for (String id : billidsTmp) { for (String id : billidsTmp) {
RecordSet rs = new RecordSet(); int nid = Integer.parseInt(id) + st;
String delsql = "delete JCL_ORG_MAP where id=" + id + " and fisvitual='1'"; String delsql = "delete from JCL_ORG_MAP where id=" + nid + " and fisvitual='1'";
rs.execute(delsql); rs.execute(delsql);
String updatesql = "update JCL_ORG_MAP set fdateend='" + new Date(OrganizationDateUtil.stringToDate(currentDate).getTime()) + String updatesql = "update JCL_ORG_MAP set fdateend='" + new Date(OrganizationDateUtil.stringToDate(currentDate).getTime()) +
"' where id=" + id + " and fisvitual='1'"; "' where id=" + nid + " and fisvitual='1'";
rs.execute(updatesql); rs.execute(updatesql);
} }
} }

@ -41,6 +41,7 @@ public class VOModeExpand extends AbstractModeExpandJavaCodeNew {
RecordSet recordSet = new RecordSet(); RecordSet recordSet = new RecordSet();
recordSet.executeQuery("select id, fid, fecid, fname, ftype, forder, fparentid, fdate from uf_jcl_org_vir where fid = '" + fid + "'"); recordSet.executeQuery("select id, fid, fecid, fname, ftype, forder, fparentid, fdate from uf_jcl_org_vir where fid = '" + fid + "'");
JclOrgMap jclOrgMap = new JclOrgMap(); JclOrgMap jclOrgMap = new JclOrgMap();
int st = 500000000;
if (recordSet.next()) { if (recordSet.next()) {
Integer ftype = Integer.valueOf(recordSet.getString("ftype")); Integer ftype = Integer.valueOf(recordSet.getString("ftype"));
jclOrgMap.setFType(ftype); jclOrgMap.setFType(ftype);
@ -50,7 +51,7 @@ public class VOModeExpand extends AbstractModeExpandJavaCodeNew {
jclOrgMap.setFDateBegin(new Date(OrganizationDateUtil.stringToDate(recordSet.getString("fdate")).getTime())); jclOrgMap.setFDateBegin(new Date(OrganizationDateUtil.stringToDate(recordSet.getString("fdate")).getTime()));
jclOrgMap.setFDateEnd(new Date(OrganizationDateUtil.stringToDate("2099-12-31").getTime())); jclOrgMap.setFDateEnd(new Date(OrganizationDateUtil.stringToDate("2099-12-31").getTime()));
jclOrgMap.setFNumber(String.valueOf(modeid));//模块的数据编号 jclOrgMap.setFNumber(String.valueOf(modeid));//模块的数据编号
jclOrgMap.setId(Integer.valueOf(recordSet.getString("id"))); jclOrgMap.setId(Integer.valueOf(recordSet.getString("id")) + st);
jclOrgMap.setFName(recordSet.getString("fname")); jclOrgMap.setFName(recordSet.getString("fname"));
if (!"".equals(recordSet.getString("fparentid"))) { if (!"".equals(recordSet.getString("fparentid"))) {
jclOrgMap.setFParentId(Integer.valueOf(recordSet.getString("fparentid"))); jclOrgMap.setFParentId(Integer.valueOf(recordSet.getString("fparentid")));
@ -65,9 +66,10 @@ public class VOModeExpand extends AbstractModeExpandJavaCodeNew {
} }
} }
} }
// 编辑修改
if (iscreate.equals("2")) { if (iscreate.equals("2")) {
RecordSet rs = new RecordSet(); RecordSet rs = new RecordSet();
String delsql = "delete JCL_ORG_MAP where id=" + jclOrgMap.getId() + " and ftype='" + jclOrgMap.getFType() + "' and fisvitual='1' and fdatebegin='" + jclOrgMap.getFDateBegin() + "'"; String delsql = "delete from JCL_ORG_MAP where id=" + jclOrgMap.getId() + " and ftype='" + jclOrgMap.getFType() + "' and fisvitual='1' and fdatebegin='" + jclOrgMap.getFDateBegin() + "'";
rs.execute(delsql); rs.execute(delsql);
String updatesql = "update JCL_ORG_MAP set fdateend='" + jclOrgMap.getFDateBegin() + "' where id=" + jclOrgMap.getId() + " and ftype='" + jclOrgMap.getFType() + "' and fisvitual='1' and fdateend > '" + jclOrgMap.getFDateBegin() + "'"; String updatesql = "update JCL_ORG_MAP set fdateend='" + jclOrgMap.getFDateBegin() + "' where id=" + jclOrgMap.getId() + " and ftype='" + jclOrgMap.getFType() + "' and fisvitual='1' and fdateend > '" + jclOrgMap.getFDateBegin() + "'";
rs.execute(updatesql); rs.execute(updatesql);

Loading…
Cancel
Save