init: 导入项目

This commit is contained in:
fengjun
2024-07-02 11:40:01 +08:00
commit 4c8e6701f2
7158 changed files with 1199718 additions and 0 deletions

168
IlogDynamicModule/pom.xml Normal file
View File

@@ -0,0 +1,168 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>com.ag.jngh</groupId>
<artifactId>AG_ONE</artifactId>
<version>1.0</version>
</parent>
<artifactId>IlogDynamicModule</artifactId>
<version>1.0</version>
<packaging>jar</packaging>
<name>IlogDynamicModule Maven Webapp</name>
<!-- FIXME change it to the project's website -->
<url>http://www.example.com</url>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<maven.compiler.source>1.8</maven.compiler.source>
<maven.compiler.target>1.8</maven.compiler.target>
</properties>
<dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.11</version>
</dependency>
<dependency>
<groupId>agwebuildergroup</groupId>
<artifactId>agwebuilderArtifact</artifactId>
<version>7.5</version>
</dependency>
<dependency>
<groupId>anji-jsonGroup</groupId>
<artifactId>anji-jsonArtifact</artifactId>
<version>1.2</version>
</dependency>
<dependency>
<groupId>commons-beanutils</groupId>
<artifactId>commons-beanutils</artifactId>
<version>1.8.3</version>
<scope>compile</scope>
</dependency>
<!-- https://mvnrepository.com/artifact/com.belerweb/pinyin4j -->
<dependency>
<groupId>com.belerweb</groupId>
<artifactId>pinyin4j</artifactId>
<version>2.5.1</version>
</dependency>
<!-- 生成generator-->
<dependency>
<groupId>org.mybatis.generator</groupId>
<artifactId>mybatis-generator-core</artifactId>
<version>1.3.7</version>
</dependency>
<dependency>
<groupId>com.google.guava</groupId>
<artifactId>guava</artifactId>
<version>25.1-jre</version>
</dependency>
<!-- <dependency>-->
<!-- <groupId>org.junit.jupiter</groupId>-->
<!-- <artifactId>junit-jupiter-api</artifactId>-->
<!-- <version>RELEASE</version>-->
<!-- </dependency>-->
<dependency>
<groupId>com.itextpdf</groupId>
<artifactId>itextpdf</artifactId>
<version>5.4.3</version>
</dependency>
<dependency>
<groupId>com.sun.mail</groupId>
<artifactId>javax.mail</artifactId>
<version>1.5.4</version>
</dependency>
<!-- <dependency>-->
<!-- <groupId>com.ag.edi</groupId>-->
<!-- <artifactId>commonapi</artifactId>-->
<!-- <version>1.0-SNAPSHOT</version>-->
<!-- <scope>compile</scope>-->
<!-- </dependency>-->
<dependency>
<groupId>com.ag.jngh</groupId>
<artifactId>commonapi</artifactId>
<version>1.0</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.apache.httpcomponents</groupId>
<artifactId>httpclient</artifactId>
<version>4.5.2</version>
</dependency>
<dependency>
<groupId>org.apache.httpcomponents</groupId>
<artifactId>httpmime</artifactId>
<version>4.5.2</version>
</dependency>
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<version>8.0.11</version>
</dependency>
<!--<dependency>
<groupId>com.google.zxing</groupId>
<artifactId>core</artifactId>
<version>3.3.0</version>
</dependency>-->
<dependency>
<groupId>cloud.tianai.captcha</groupId>
<artifactId>tianai-captcha</artifactId>
<version>1.3.2</version>
</dependency>
<dependency>
<groupId>com.zaxxer</groupId>
<artifactId>HikariCP</artifactId>
<version>2.7.6</version>
</dependency>
<dependency>
<groupId>org.apache.pdfbox</groupId>
<artifactId>pdfbox-app</artifactId>
<version>2.0.28</version>
</dependency>
</dependencies>
<build>
<finalName>IlogDynamicModule</finalName>
<pluginManagement><!-- lock down plugins versions to avoid using Maven defaults (may be moved to parent pom) -->
<plugins>
<plugin>
<artifactId>maven-clean-plugin</artifactId>
<version>3.1.0</version>
</plugin>
<!-- see http://maven.apache.org/ref/current/maven-core/default-bindings.html#Plugin_bindings_for_war_packaging -->
<plugin>
<artifactId>maven-resources-plugin</artifactId>
<version>3.0.2</version>
</plugin>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.8.0</version>
</plugin>
<plugin>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.22.1</version>
</plugin>
<plugin>
<artifactId>maven-war-plugin</artifactId>
<version>3.2.2</version>
</plugin>
<plugin>
<artifactId>maven-install-plugin</artifactId>
<version>2.5.2</version>
</plugin>
<plugin>
<artifactId>maven-deploy-plugin</artifactId>
<version>2.8.2</version>
</plugin>
</plugins>
</pluginManagement>
</build>
</project>

View File

@@ -0,0 +1,35 @@
package com.ag;
import cn.hutool.core.date.DateUtil;
import cn.hutool.core.util.IdUtil;
import com.ag.demo.mapper.StudentMapper;
import com.ag.demo.pojo.Student;
import com.ag.until.MybatisBatchUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.util.ArrayList;
import java.util.List;
@Component
public class TestService {
@Autowired
StudentMapper studentMapper;
@Autowired
MybatisBatchUtil mybatisBatchUtil;
public void run02(org.json.JSONObject param, HttpServletResponse response, HttpServletRequest request) {
List<Student> students = new ArrayList<>();
for (int i = 0; i < 1000; i++) {
Student student = new Student();
student.setsId(IdUtil.simpleUUID());
student.setName("test");
student.setAge(18);
student.setSex("");
students.add(student);
}
mybatisBatchUtil.batchUpdateOrInsert(students,StudentMapper.class,(item,mapper)->mapper.insert(item));
}
}

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,52 @@
package com.ag.ctc.domain.pojo;
public class CtariffPojo {
private String i_e_id;
private String rate;
public String getRule_id() {
return rule_id;
}
public void setRule_id(String rule_id) {
this.rule_id = rule_id;
}
public String getId() {
return id;
}
public void setId(String id) {
this.id = id;
}
private String item_id;
private String rule_id;
private String id;
public String getItem_id() {
return item_id;
}
public void setItem_id(String item_id) {
this.item_id = item_id;
}
public String getRate() {
return rate;
}
public void setRate(String rate) {
this.rate = rate;
}
public String getI_e_id() {
return i_e_id;
}
public void setI_e_id(String i_e_id) {
this.i_e_id = i_e_id;
}
}

View File

@@ -0,0 +1,421 @@
package com.ag.ctc.domain.pojo;
import java.util.Date;
public class TariffRitem {
/**
* This field was generated by MyBatis Generator.
* This field corresponds to the database column C_TARIFF_RITEM.ID
*
* @mbggenerated
*/
private String id;
/**
* This field was generated by MyBatis Generator.
* This field corresponds to the database column C_TARIFF_RITEM.TENANCY_ID
*
* @mbggenerated
*/
private String tenancyId;
/**
* This field was generated by MyBatis Generator.
* This field corresponds to the database column C_TARIFF_RITEM.RULE_ID
*
* @mbggenerated
*/
private String ruleId;
/**
* This field was generated by MyBatis Generator.
* This field corresponds to the database column C_TARIFF_RITEM.KEY_NAME
*
* @mbggenerated
*/
private String keyName;
/**
* This field was generated by MyBatis Generator.
* This field corresponds to the database column C_TARIFF_RITEM.OPER_CHAR
*
* @mbggenerated
*/
private String operChar;
/**
* This field was generated by MyBatis Generator.
* This field corresponds to the database column C_TARIFF_RITEM.COMPARE_VAL
*
* @mbggenerated
*/
private String compareVal;
/**
* This field was generated by MyBatis Generator.
* This field corresponds to the database column C_TARIFF_RITEM.CREATED_BY
*
* @mbggenerated
*/
private String createdBy;
/**
* This field was generated by MyBatis Generator.
* This field corresponds to the database column C_TARIFF_RITEM.CREATED_ON
*
* @mbggenerated
*/
private Date createdOn;
/**
* This field was generated by MyBatis Generator.
* This field corresponds to the database column C_TARIFF_RITEM.UPDATED_BY
*
* @mbggenerated
*/
private String updatedBy;
/**
* This field was generated by MyBatis Generator.
* This field corresponds to the database column C_TARIFF_RITEM.UPDATED_ON
*
* @mbggenerated
*/
private Date updatedOn;
/**
* This field was generated by MyBatis Generator.
* This field corresponds to the database column C_TARIFF_RITEM.COMPARE_NAME
*
* @mbggenerated
*/
private String compareName;
/**
* This field was generated by MyBatis Generator.
* This field corresponds to the database column C_TARIFF_RITEM.DEL_FLAG
*
* @mbggenerated
*/
private Short delFlag;
/**
* This field was generated by MyBatis Generator.
* This field corresponds to the database column C_TARIFF_RITEM.COMNAME1
*
* @mbggenerated
*/
private String comname1;
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column C_TARIFF_RITEM.ID
*
* @return the value of C_TARIFF_RITEM.ID
*
* @mbggenerated
*/
public String getId() {
return id;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column C_TARIFF_RITEM.ID
*
* @param id the value for C_TARIFF_RITEM.ID
*
* @mbggenerated
*/
public void setId(String id) {
this.id = id == null ? null : id.trim();
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column C_TARIFF_RITEM.TENANCY_ID
*
* @return the value of C_TARIFF_RITEM.TENANCY_ID
*
* @mbggenerated
*/
public String getTenancyId() {
return tenancyId;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column C_TARIFF_RITEM.TENANCY_ID
*
* @param tenancyId the value for C_TARIFF_RITEM.TENANCY_ID
*
* @mbggenerated
*/
public void setTenancyId(String tenancyId) {
this.tenancyId = tenancyId == null ? null : tenancyId.trim();
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column C_TARIFF_RITEM.RULE_ID
*
* @return the value of C_TARIFF_RITEM.RULE_ID
*
* @mbggenerated
*/
public String getRuleId() {
return ruleId;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column C_TARIFF_RITEM.RULE_ID
*
* @param ruleId the value for C_TARIFF_RITEM.RULE_ID
*
* @mbggenerated
*/
public void setRuleId(String ruleId) {
this.ruleId = ruleId == null ? null : ruleId.trim();
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column C_TARIFF_RITEM.KEY_NAME
*
* @return the value of C_TARIFF_RITEM.KEY_NAME
*
* @mbggenerated
*/
public String getKeyName() {
return keyName;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column C_TARIFF_RITEM.KEY_NAME
*
* @param keyName the value for C_TARIFF_RITEM.KEY_NAME
*
* @mbggenerated
*/
public void setKeyName(String keyName) {
this.keyName = keyName == null ? null : keyName.trim();
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column C_TARIFF_RITEM.OPER_CHAR
*
* @return the value of C_TARIFF_RITEM.OPER_CHAR
*
* @mbggenerated
*/
public String getOperChar() {
return operChar;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column C_TARIFF_RITEM.OPER_CHAR
*
* @param operChar the value for C_TARIFF_RITEM.OPER_CHAR
*
* @mbggenerated
*/
public void setOperChar(String operChar) {
this.operChar = operChar == null ? null : operChar.trim();
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column C_TARIFF_RITEM.COMPARE_VAL
*
* @return the value of C_TARIFF_RITEM.COMPARE_VAL
*
* @mbggenerated
*/
public String getCompareVal() {
return compareVal;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column C_TARIFF_RITEM.COMPARE_VAL
*
* @param compareVal the value for C_TARIFF_RITEM.COMPARE_VAL
*
* @mbggenerated
*/
public void setCompareVal(String compareVal) {
this.compareVal = compareVal == null ? null : compareVal.trim();
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column C_TARIFF_RITEM.CREATED_BY
*
* @return the value of C_TARIFF_RITEM.CREATED_BY
*
* @mbggenerated
*/
public String getCreatedBy() {
return createdBy;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column C_TARIFF_RITEM.CREATED_BY
*
* @param createdBy the value for C_TARIFF_RITEM.CREATED_BY
*
* @mbggenerated
*/
public void setCreatedBy(String createdBy) {
this.createdBy = createdBy == null ? null : createdBy.trim();
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column C_TARIFF_RITEM.CREATED_ON
*
* @return the value of C_TARIFF_RITEM.CREATED_ON
*
* @mbggenerated
*/
public Date getCreatedOn() {
return createdOn;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column C_TARIFF_RITEM.CREATED_ON
*
* @param createdOn the value for C_TARIFF_RITEM.CREATED_ON
*
* @mbggenerated
*/
public void setCreatedOn(Date createdOn) {
this.createdOn = createdOn;
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column C_TARIFF_RITEM.UPDATED_BY
*
* @return the value of C_TARIFF_RITEM.UPDATED_BY
*
* @mbggenerated
*/
public String getUpdatedBy() {
return updatedBy;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column C_TARIFF_RITEM.UPDATED_BY
*
* @param updatedBy the value for C_TARIFF_RITEM.UPDATED_BY
*
* @mbggenerated
*/
public void setUpdatedBy(String updatedBy) {
this.updatedBy = updatedBy == null ? null : updatedBy.trim();
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column C_TARIFF_RITEM.UPDATED_ON
*
* @return the value of C_TARIFF_RITEM.UPDATED_ON
*
* @mbggenerated
*/
public Date getUpdatedOn() {
return updatedOn;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column C_TARIFF_RITEM.UPDATED_ON
*
* @param updatedOn the value for C_TARIFF_RITEM.UPDATED_ON
*
* @mbggenerated
*/
public void setUpdatedOn(Date updatedOn) {
this.updatedOn = updatedOn;
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column C_TARIFF_RITEM.COMPARE_NAME
*
* @return the value of C_TARIFF_RITEM.COMPARE_NAME
*
* @mbggenerated
*/
public String getCompareName() {
return compareName;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column C_TARIFF_RITEM.COMPARE_NAME
*
* @param compareName the value for C_TARIFF_RITEM.COMPARE_NAME
*
* @mbggenerated
*/
public void setCompareName(String compareName) {
this.compareName = compareName == null ? null : compareName.trim();
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column C_TARIFF_RITEM.DEL_FLAG
*
* @return the value of C_TARIFF_RITEM.DEL_FLAG
*
* @mbggenerated
*/
public Short getDelFlag() {
return delFlag;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column C_TARIFF_RITEM.DEL_FLAG
*
* @param delFlag the value for C_TARIFF_RITEM.DEL_FLAG
*
* @mbggenerated
*/
public void setDelFlag(Short delFlag) {
this.delFlag = delFlag;
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column C_TARIFF_RITEM.COMNAME1
*
* @return the value of C_TARIFF_RITEM.COMNAME1
*
* @mbggenerated
*/
public String getComname1() {
return comname1;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column C_TARIFF_RITEM.COMNAME1
*
* @param comname1 the value for C_TARIFF_RITEM.COMNAME1
*
* @mbggenerated
*/
public void setComname1(String comname1) {
this.comname1 = comname1 == null ? null : comname1.trim();
}
}

View File

@@ -0,0 +1,449 @@
package com.ag.ctc.domain.service;
import cn.hutool.core.convert.Convert;
import cn.hutool.core.util.ObjectUtil;
import com.ag.base.*;
import com.ag.commonFace.ITariffExtService;
import com.ag.ctc.domain.pojo.Ctariff;
import com.ag.dynamicmodule.main.HotApplicationContext;
import com.ag.entity.fee.*;
import com.ag.log.OperLogServcie;
import com.ag.log.entity.LogParam;
import com.ag.util.StrUtil;
import com.ag.util.UUIDUtil;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.wb.util.WebUtil;
import lombok.extern.log4j.Log4j;
import org.mybatis.spring.SqlSessionTemplate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.Assert;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.util.*;
import java.util.stream.Collectors;
@Service
@Log4j
public class TariffallService extends BaseService {
@Autowired
private ITariffExtService extService;
@Autowired
private BaseRepositoryImpl feeDao;
@Autowired
private DefaultBussniessImpl<TariffOperLog> bizDao;
@Autowired
private OperLogServcie logServcie;
@Autowired
private SqlSessionTemplate sqlSessionTemplate;
@Autowired
private IRedisService redis;
/**
* 费率保存方法
* 1。按合同id+费目id查询所有费率
* 2。检查需要修改和删除额费率是否存在已审核的记录存在则提示并退出
* 3。分别处理新增新增+新增),修改(修改+删除+新增),删除(修改+删除)三组费率列表,并写入日志表(原特殊运算符替换)
* 4。新增和修改的费率name组合起来保存到费率主表按费目元素排序号
* 5。按合同id+费目id查询所有费率
* 6。检查是否存在重复费率。
*/
@Transactional
public void saveGrid(org.json.JSONObject reqParam, HttpServletResponse response, HttpServletRequest request) throws Exception {
String tenancyId = null;
if (reqParam.has("sys.tenancyId")) {
tenancyId = reqParam.getString("sys.tenancyId");
}
String contractId = reqParam.getString("contractId");
String itemId = reqParam.getString("itemId");
String userName = reqParam.getString("sys.username");
JSONObject datatable = JSON.parseArray(reqParam.getString("datatable")).getJSONObject(0);
JSONArray createArray = JSON.parseArray(datatable.getString("create"));
JSONArray updateArray = JSON.parseArray(datatable.getString("update"));
JSONArray deleteArray = JSON.parseArray(datatable.getString("destroy"));
ItemProperties query = new ItemProperties();
query.setItemId(itemId);
List<ItemProperties> properties = feeDao.findByEqCriteria(query, ItemProperties.class, "ITEM_ID");
properties.sort((a, b) -> a.getDispOrder() - b.getDispOrder());
//如果是更新,先删除再插入
List<Tariff> addTariffs = new ArrayList<>();//新增
List<Tariff> updTariffs = new ArrayList<>();// 修改和删除
List<TariffRitem> addRitems = new ArrayList<>();//新增和修改
List<TariffRitem> delRitems = new ArrayList<>();//修改和删除
for (int i = 0; i < updateArray.size(); i++) {
JSONObject jsonTariff = updateArray.getJSONObject(i);
Tariff tariff = new Tariff();
generateTariff(jsonTariff, tariff);
tariff.setUpdatedBy(userName);
tariff.setUpdatedOn(new Date());
tariff.setTenancyId(tenancyId);
tariff.setChargingId(itemId);
tariff.setContractId(contractId);
Map<String, String> operMap = extService.getSpecialOperChar(tariff.getId());
updTariffs.add(tariff);//费率修改
TariffRitem ritem = new TariffRitem();
ritem.setRuleId(tariff.getId());
delRitems.add(ritem);//条件删除
//一条费率的多个费率条件处理
List<TariffRitem> ritems = tariffRitemUpdate(jsonTariff, tariff, operMap, properties, tenancyId);
addRitems.addAll(ritems);//条件新增
//更新费率中的key备注与val备注
extService.generateDescription(tariff, ritems, properties);
}
for (int i = 0; i < createArray.size(); i++) {
JSONObject jsonTariff = createArray.getJSONObject(i);
Tariff tariff = new Tariff();
generateTariff(jsonTariff, tariff);
tariff.setId(UUIDUtil.getUUID());
tariff.setCreatedBy(userName);
tariff.setCreatedOn(new Date());
tariff.setUpdatedBy(userName);
tariff.setUpdatedOn(new Date());
tariff.setTenancyId(tenancyId);
tariff.setChargingId(itemId);
tariff.setContractId(contractId);
addTariffs.add(tariff);//费率增加
//一条费率的多个费率条件处理
List<TariffRitem> ritems = tariffRitemUpdate(jsonTariff, tariff, new HashMap<>(), properties, tenancyId);
addRitems.addAll(ritems);//条件增加
//更新费率中的key备注与val备注
extService.generateDescription(tariff, ritems, properties);
}
for (int i = 0; i < deleteArray.size(); i++) {
JSONObject jsonTariff = deleteArray.getJSONObject(i);
Tariff tariff = new Tariff();
tariff.setId(jsonTariff.getString("RULE_ID"));//费率主表主键
tariff.setDelFlag(1);
updTariffs.add(tariff);//费率修改作废标记
TariffRitem ritem = new TariffRitem();
ritem.setRuleId(tariff.getId());
delRitems.add(ritem);//条件删除
}
feeDao.deleteAll(delRitems, "RULE_ID");
feeDao.updateAll(updTariffs, new String[]{"EFFECTIVE_DATE", "EXPIRED_DATE", "APPENDLX_NOTES"}, "ID");
feeDao.saveAll(addTariffs);
feeDao.saveAll(addRitems);
try {
LogParam logParam = new LogParam(reqParam, itemId, "fee", null, "datatable");
logParam.setMenuName("费率维护");
logServcie.saveLogGrid(logParam, response);
} catch (IOException e) {
e.printStackTrace();
}
//检查是否存在重复费率
extService.synDescription(contractId, itemId, tenancyId);
}
/**
* 单条费率的修改-》多个费率条件的创建
*/
private List<TariffRitem> tariffRitemUpdate(JSONObject jsonObject, Tariff tariff, Map<String, String> operMap, List<ItemProperties> properties, String tenancyId) {
Set<Map.Entry<String, Object>> entriesdatset = jsonObject.entrySet();
Map<String, Integer> propMap = properties.stream()
.collect(Collectors.toMap(ItemProperties::getPropertyCode, ItemProperties::getIsShowOperator));
//IRedisService service = (IRedisService) HotApplicationContext.getBean("redisServiceImpl");
//费率项信息
List<TariffRitem> tariffRitemList = new ArrayList<>();
for (Map.Entry<String, Object> entry : entriesdatset) {
//System.out.println(entry.getKey() + ":" + entry.getValue());
if (StrUtil.isEmpty(entry.getValue())) {
continue;
}
//RATE不在itemProperties中
/*if (ObjectUtil.equal(entry.getKey(), "RATE")) {
TariffRitem tariffRitem = new TariffRitem();
generateRitem(tariffRitem, ctariff, entry, operMap);
tariffRitemList.add(tariffRitem);
}*/
//key不在itemProperties中跳过
if (!propMap.containsKey(entry.getKey())) {
continue;
}
TariffRitem tariffRitem = new TariffRitem();
generateRitem(tariffRitem, tariff, entry, operMap);
String entryValue = entry.getValue().toString().replace("[", "").replace("]", "").replace("\"", "");
if (StrUtil.isEmpty(entryValue.trim())) {
continue;
}
if (propMap.get(entry.getKey()) == 1) {
tariffRitem.setCompareVal(entryValue);
//tariffRitem.setCompareName(Convert.toStr(entryValue));
} else {
tariffRitem.setCompareVal(entryValue);
tariffRitem.setCompareName(redis.getTargetName(entry.getKey(), entryValue, tenancyId));
}
tariffRitemList.add(tariffRitem);
}
for (TariffRitem ritem : tariffRitemList) {
for (ItemProperties propertie : properties) {
if (ObjectUtil.equal(propertie.getPropertyCode(), ritem.getKeyName())) {
ritem.setComname1(propertie.getPropertyName());
break;
}
}
}
return tariffRitemList;
}
private void generateTariff(JSONObject jsonTariff, Tariff tariff) {
tariff.setId(jsonTariff.getString("RULE_ID"));//费率主表主键
Assert.isTrue(jsonTariff.containsKey("RATE"), "费率不允许为空!");
Assert.isTrue(!StrUtil.isEmpty(jsonTariff.getString("RATE")), "费率不允许为空!");
tariff.setRate(jsonTariff.getDouble("RATE"));
tariff.setDelFlag(0);//默认0 未删除标识
tariff.setEffectiveDate(jsonTariff.getDate("EFFECTIVE_DATE"));
tariff.setExpiredDate(jsonTariff.getDate("EXPIRED_DATE"));
tariff.setAppendlxNotes(jsonTariff.getString("APPENDLX_NOTES"));//附件备注
tariff.setConfirmStatus(0);
}
private void generateRitem(TariffRitem tariffRitem, Tariff tariff, Map.Entry<String, Object> entry, Map<String, String> operMap) {
tariffRitem.setId(UUIDUtil.getUUID());
tariffRitem.setRuleId(tariff.getId());//子表外键,是主表的主键
tariffRitem.setKeyName(entry.getKey());
tariffRitem.setDelFlag(0);
tariffRitem.setOperChar("=");
//keyName是特殊运算符时使用特殊运算符替换=
if (operMap.containsKey(tariffRitem.getKeyName())) {
tariffRitem.setOperChar(operMap.get(tariffRitem.getKeyName()));
}
tariffRitem.setCompareVal(Convert.toStr(entry.getValue()));
}
public void getdata(org.json.JSONObject reqParam, HttpServletResponse response, HttpServletRequest request) throws Exception {
log.info("log4j print");
log.info(JSON.toJSONString(reqParam));
// SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd");
//log.error("1."+feeJdbcTemplate1);
Map<String, String> map = new HashMap<>();
map.put("itemId", request.getParameter("itemId"));
map.put("contractId", request.getParameter("contractId"));
map.put("confirmStatus", request.getParameter("confirmStatus"));
//log.error("3."+JSON.toJSONString(map));
List<Ctariff> datactariffflist = sqlSessionTemplate.selectList("resources/ctariff.CtariffMapper.selectByitemid", map);
//查询费目元素
List<Map<String, String>> propertylist = sqlSessionTemplate.selectList("resources/ctariff.CtariffMapper.selectpropertyByitemid", request.getParameter("itemId"));
String query = request.getParameter("query");
filterCharacter(datactariffflist, query);
String tariffIds = new SqlUtil<Ctariff>().getAddInIds(datactariffflist, "id");
List<TariffRitem> ritems = feeDao.findInIds(com.ag.entity.fee.TariffRitem.class, tariffIds, "RULE_ID");
Map<String, List<TariffRitem>> ritemMap = ritems.stream().collect(Collectors.groupingBy(com.ag.entity.fee.TariffRitem::getRuleId));
StringBuilder buffer = new StringBuilder("");
List<String> datafiled = new ArrayList<>();
for (Ctariff ctariff : datactariffflist) {
//List infoStateList = feeJdbcTemplate1.selectList("resources/ctariff.CtariffRitemMapper.selectByruleid",ctariff.getId());
List<TariffRitem> infoStateList = ritemMap.get(ctariff.getId());
buffer.append("{");
//循环数据项
for (int i = 0; infoStateList != null && i < infoStateList.size(); i++) {
TariffRitem tariffRitem = infoStateList.get(i);
try {
buffer.append("\"").append(tariffRitem.getKeyName()).append("\":\"").append(tariffRitem.getCompareVal()).append("\"");
buffer.append(",");
} catch (Exception e) {
e.printStackTrace();
}
if (!datafiled.contains(tariffRitem.getKeyName())) {
datafiled.add(tariffRitem.getKeyName());
}
buffer.append("\"ID\":\"").append(tariffRitem.getId()).append("\"");
buffer.append(",");
buffer.append("\"RULE_ID\":\"").append(ctariff.getId()).append("\"").append(",");
if (ctariff.getEffectiveDate() == null) {
buffer.append("\"EFFECTIVE_DATE\":\"\"");
} else {
//System.out.println(formatter.format(ctariff.getEffectiveDate()));
//buffer.append("\"EFFECTIVE_DATE\":\""+formatter.format(ctariff.getEffectiveDate())+"\"");
buffer.append("\"EFFECTIVE_DATE\":\"" + ctariff.getEffectiveDate() + "\"");
}
buffer.append(",");
buffer.append("\"RATE\":\"").append(ctariff.getRate()).append("\"").append(",");
if (ctariff.getExpiredDate() == null) {
buffer.append("\"EXPIRED_DATE\":\"\"");
} else {
buffer.append("\"EXPIRED_DATE\":\"" + ctariff.getExpiredDate() + "\"");
}
buffer.append(",");
if (ctariff.getAppendlxNotes() == null) {
buffer.append("\"APPENDLX_NOTES\":\"\"");
} else {
buffer.append("\"APPENDLX_NOTES\":\"" + ctariff.getAppendlxNotes() + "\"");
}
buffer.append(",");
buffer.append("\"CONFIRM_STATUS\":\"" + ctariff.getConfirmStatus() + "\"");
buffer.append(",");
buffer.append("\"VERIFY_FLAG\":\"" + ctariff.getVerifyFlag() + "\"");
buffer.append(",");
//循环删除
for (int hm = 0; hm < propertylist.size(); hm++) {
Map<String, String> mapproperty = propertylist.get(hm);
if (mapproperty.get("PROPERTY_CODE").equals(tariffRitem.getKeyName())) {
propertylist.remove(mapproperty);
}
}
}
for (Map<String, String> mapproperty : propertylist) {
buffer.append("\"").append(mapproperty.get("PROPERTY_CODE")).append("\":\"\"");
buffer.append(",");
datafiled.add(mapproperty.get("PROPERTY_CODE"));
}
buffer.append("},");
// buffer.append("}");
}
datafiled.add("ID");//子表id
datafiled.add("RATE");
datafiled.add("RULE_ID");//费率主表id
datafiled.add("EFFECTIVE_DATE");//生效日期
datafiled.add("EXPIRED_DATE");//失效日期
datafiled.add("APPENDLX_NOTES");//附件备注
datafiled.add("CONFIRM_STATUS");//审核状态
datafiled.add("VERIFY_FLAG");//校验状态
StringBuffer str = new StringBuffer();
str.append("{\"success\":true");
str.append(",\"metaData\":{\"fields\":[");
processfieldTypelist(str, datafiled);
str.append("]},\"rows\":[");
str.append(buffer).append("],\"total\":").append(ritemMap.size()).append("}");
try {
WebUtil.send(response, str);
} catch (IOException e) {
e.printStackTrace();
}
}
private static void filterCharacter(List<Ctariff> datactariffflist, String query) {
if (StrUtil.isEmpty(query)) {
return;
}
String[] arr = query.split(",");
Iterator<Ctariff> iterator = datactariffflist.iterator();
while (iterator.hasNext()) {
Ctariff ctariff = iterator.next();
boolean status = false;
for (String fc : arr) {
if (StrUtil.isEmpty(fc)) {
continue;
}
if (fc.contains("&")) {
continue;
}
if (!ctariff.getKeyDescription().contains(fc) && !ctariff.getValDescription().contains(fc)) {
status = true;
}
}
if (status) {
iterator.remove();
}
}
}
/**
* json??????
*
* @param str
* @param fields
*/
public static void processfieldTypelist(StringBuffer str, List<String> fields) {
for (int ia = 0; ia < fields.size(); ia++) {
if (ia > 0) str.append(",");
String name = fields.get(ia);
String types = "string";
String datetypes = "date";
if (("EFFECTIVE_DATE").equals(name.toUpperCase()) || ("EXPIRED_DATE").equals(name.toUpperCase())) {
str.append("{\"name\":\"" + name.toUpperCase() + "\",\"type\":\"" + datetypes + "\"}");
} else {
str.append("{\"name\":\"" + name.toUpperCase() + "\",\"type\":\"" + types + "\"}");
}
}
}
/**
* 费率增删改日志
*/
private void handleTariffLog(Integer status, String contractId, String itemId, String ruleId, String username) {
try {
Contract contract = new Contract();
contract.setId(contractId);
BaseChargingItem item = new BaseChargingItem();
item.setId(itemId);
ItemProperties entity = new ItemProperties();
entity.setItemId(itemId);
contract = (Contract) feeDao.findById(contract, Contract.class, "ID");//合同
item = (BaseChargingItem) feeDao.findById(item, BaseChargingItem.class, "ID");//费目的基本要素
List<TariffRitem> ritems = feeDao.findInIds(com.ag.entity.fee.TariffRitem.class, ruleId, "RULE_ID");//该费率的子表
List<ItemProperties> properties = feeDao.findByEqCriteria(entity, ItemProperties.class, "ITEM_ID");
List<TariffOperLog> logs = new ArrayList<>();
String note = "", rate = "";
for (com.ag.entity.fee.TariffRitem ritem : ritems) {
if (ObjectUtil.equal(ritem.getKeyName(), "RATE")) {
rate = Convert.toStr(ritem.getCompareVal());
}
for (ItemProperties propertie : properties) {
if (ObjectUtil.equal(propertie.getPropertyCode(), ritem.getKeyName())) {
note += propertie.getPropertyName() + ritem.getOperChar() + ritem.getCompareName() + ";";
break;
}
}
}
note = "[费率:" + rate + "]" + note;
if (status == 1) {
note = "新增-->" + note;
} else if (status == 2) {
note = "修改<--" + note;
} else if (status == 3) {
note = "删除<--" + note;
}
TariffOperLog log = new TariffOperLog();
log.setId(UUIDUtil.getUUID());
log.setContractName(contract.getDescription());
log.setItemName(item.getDescription());
log.setCreatedBy(username);
log.setCreatedOn(new Date());
log.setDescription(note);
bizDao.save(log);
} catch (Exception ex) {
ex.printStackTrace();
}
}
}

View File

@@ -0,0 +1,91 @@
package com.ag.demo;
import com.ag.dynamicmodule.main.HotApplicationContext;
import com.ag.entity.fee.face.ICondition;
import com.ag.entity.fee.face.IFeeBase;
import com.ag.entity.fee.face.ReqSource;
import com.ag.entity.fee.face.SourceProperty;
import com.ag.util.TimeUtil;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import org.springframework.stereotype.Service;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.util.ArrayList;
import java.util.List;
/**
* Created by yangxh on 2022/1/5.
*/
@Service
public class AutoCalcTest {
private static final String bizType = "MACH";
private static final String itemIds = "001";
private static final String contractId = "ccb1deff1086449d87106a6478f34ca4";
public void execute(org.json.JSONObject param, HttpServletResponse response, HttpServletRequest request){
IFeeBase feeBase = (IFeeBase) HotApplicationContext.getBean("feeController");
ReqSource reqSource = new ReqSource();
generateData(reqSource);
System.out.println(JSON.toJSONString(reqSource));
String res = feeBase.callback(JSON.toJSONString(reqSource));
System.out.println(res);
}
/**
* 箱,票,拼箱比例费用计算(类舱单费)
* @param reqSource
*/
private static void generateData(ReqSource reqSource){
List<SourceProperty> sources = new ArrayList<>();
//票
String mainId = "8f548bf59afa4440b86636c10ba";
SourceProperty bill = new SourceProperty();
sources.add(bill);
bill.setBizId(mainId);
bill.setBizTime(TimeUtil.getDateTime());
bill.setBizType(bizType);
JSONObject billMap = new JSONObject();
billMap.put("BILL_CALC", "1");
billMap.put(ICondition.LIN_ID, "营运人code");
billMap.put(ICondition.CAR_AGE, "车队code");
bill.setProperty(billMap);
//箱1
String bizId = "8f548bf59afa4440b86636c10ba31547";
SourceProperty cntr = new SourceProperty();
sources.add(cntr);
cntr.setBizId(bizId);
cntr.setBizTime(TimeUtil.getDateTime());
cntr.setBizType(bizType);
JSONObject cntrMap = new JSONObject();
cntrMap.put("TRADE_ID", "1");
cntrMap.put("CNTR_SIZE", "40");
cntrMap.put("I_E_ID", "I");
cntrMap.put("TYPE", "1");
cntr.setProperty(cntrMap);
//箱2
String bizId2 = "8f548bf59afa4440b86636c10ba31";
SourceProperty cntr2 = new SourceProperty();
sources.add(cntr2);
cntr2.setBizId(bizId2);
cntr2.setBizTime(TimeUtil.getDateTime());
cntr2.setBizType(bizType);
JSONObject cntrMap2 = new JSONObject();
cntrMap2.put("TRADE_ID", "1");
cntrMap2.put("CNTR_SIZE", "40");
cntrMap2.put("I_E_ID", "I");
cntrMap2.put("TYPE", "2");
cntr2.setProperty(cntrMap2);
reqSource.setSourceProperties(sources);
reqSource.setTenancyId("default");
reqSource.setOperMan("yxh");
reqSource.setContractId(contractId);
// reqSource.setItemId(itemIds);
reqSource.setAccountPointCode(bizType);
}
}

View File

@@ -0,0 +1,68 @@
package com.ag.demo;
import cn.hutool.core.collection.CollUtil;
import com.ag.base.DefaultBussniessImpl;
import com.ag.demo.entity.DbErrInfo;
import com.ag.util.StrUtil;
import com.ag.util.UUIDUtil;
import com.alibaba.fastjson.JSON;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.BufferedReader;
import java.io.File;
import java.io.IOException;
import java.io.InputStreamReader;
import java.nio.file.Files;
import java.util.ArrayList;
import java.util.List;
@Service
public class DbErrInfoService {
@Autowired
private DefaultBussniessImpl bizDao;
public void execute(org.json.JSONObject orgJson, HttpServletResponse response, HttpServletRequest request) throws IOException {
List<String> data = getDataFromTxt();
data.removeIf(info -> !info.trim().startsWith("ORA-"));
List<DbErrInfo> dbs = CollUtil.list(false);
for (String info : data){
if (StrUtil.isEmpty(info)){
continue;
}
String[] arr = info.split(":");
if (arr.length != 2){
continue;
}
DbErrInfo db = new DbErrInfo();
db.setId(UUIDUtil.getUUID());
db.setErrKey(arr[0]);
db.setErrVal(arr[1]);
dbs.add(db);
}
//System.out.println(JSON.toJSONString(dbs));
bizDao.saveAll(dbs);
}
public List<String> getDataFromTxt() throws IOException {
List<String> list = new ArrayList<>();
BufferedReader br = null;
try {
File file = new File("f:\\tmp\\ora.txt");
br = new BufferedReader(new InputStreamReader(Files.newInputStream(file.toPath()), "UTF-8"));
String line;
while (null != (line=br.readLine())) {
list.add(line);
}
} catch (Exception e) {
e.printStackTrace();
} finally {
if (null != br) {
br.close();
}
}
return list;
}
}

View File

@@ -0,0 +1,220 @@
package com.ag.demo;
import cn.hutool.core.collection.CollUtil;
import com.ag.base.BaseService;
import com.ag.base.DefaultBussniessImpl;
import com.ag.demo.entity.Student;
import com.ag.log.OperLogServcie;
import com.ag.log.UserDefineLogService;
import com.ag.log.entity.LogParam;
import com.ag.util.Base64Util;
import com.ag.util.ExcelPoiUtil;
import com.ag.util.UUIDUtil;
import com.alibaba.fastjson.JSON;
import com.opencsv.CSVWriter;
import com.wb.util.WebUtil;
import org.apache.commons.io.FileUtils;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.web.multipart.MultipartFile;
import org.springframework.web.multipart.MultipartHttpServletRequest;
import org.springframework.web.multipart.MultipartResolver;
import org.springframework.web.multipart.commons.CommonsMultipartResolver;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.File;
import java.io.IOException;
import java.net.URLEncoder;
import java.util.Base64;
import java.util.List;
/**
* Created by yangxh on 2021/5/28.
*/
@Service
public class DemoService extends BaseService {
@Autowired
private DefaultBussniessImpl bizDao;
@Autowired
private OperLogServcie logServcie;
@Autowired
private UserDefineLogService userDefineLogService;
public void testRequest(org.json.JSONObject param, HttpServletResponse response, HttpServletRequest request){
try {
WebUtil.send(response, "ok");
} catch (IOException e) {
throw new RuntimeException(e);
}
}
public void save(org.json.JSONObject param, HttpServletResponse response, HttpServletRequest request){
Student stu = JSON.parseObject(param.getString("data"), Student.class);
//Student stu = new ParamUtil<Student>().packPOJO(super.getRequestMap(request), Student.class);
stu.setsId(UUIDUtil.getUUID());
bizDao.save(stu);
try {
LogParam logParam = new LogParam(param, stu.getName(), "tstudent", "C", "data");
logParam.setMenuName("日志示例");
logParam.setPrimaryKeyColName("S_ID");
logParam.setCreateDataId(stu.getsId());
logServcie.saveLogPanel(logParam, response);
/*LogParam logParam = new LogParam(param, stu.getName(), "tstudent", "save~~~~~~~~~~~~~~~~~~");
userDefineLogService.saveLog(logParam);*/
} catch (Exception e) {
e.printStackTrace();
}
}
/**
* 单条数据修改记录日志示例
* @param param
* @param response
* @param request
*/
public void update(org.json.JSONObject param, HttpServletResponse response, HttpServletRequest request){
Student stu = JSON.parseObject(param.getString("data"), Student.class);
//super.setUpdateUser(param, stu);
//Student stu = new ParamUtil<Student>().packPOJO(super.getRequestMap(request), Student.class);
//bizDao.update(stu, "S_ID");
stu = (Student) bizDao.findById(stu, Student.class, "S_ID");
try {
LogParam logParam = new LogParam(param, stu.getName(), "tstudent", "U", "data");
logParam.setUpdate(CollUtil.newArrayList(stu));//包装更新前的原始数据
logParam.setMenuName("日志示例");
logParam.setPrimaryKeyColName("S_ID");//如果主键为ID可不指定
logServcie.saveLogPanel(logParam, response);
/*logParam = new LogParam(param, stu.getName(), "tstudent", "update~~~~~~~~~~~~~~~~~~");
userDefineLogService.saveLog(logParam);*/
} catch (IOException e) {
e.printStackTrace();
}
}
/**
* 批量修改记录日志示例
* @param param
* @param response
* @param request
*/
public void updateAll(org.json.JSONObject param, HttpServletResponse response, HttpServletRequest request) throws IOException {
List<Student> stus = JSON.parseArray(param.getString("data"), Student.class);
//Student stu = new ParamUtil<Student>().packPOJO(super.getRequestMap(request), Student.class);
bizDao.updateAll(stus, "S_ID");
if (CollUtil.isEmpty(stus)){
return;
}
try {
LogParam logParam = new LogParam(param, stus.get(0).getName(), "tstudent", "U", "data");
logParam.setMenuName("日志示例");
logParam.setPrimaryKeyColName("S_ID");
logServcie.saveLogPanel(logParam, response);
/*logParam = new LogParam(param, stu.getName(), "tstudent", "update~~~~~~~~~~~~~~~~~~");
userDefineLogService.saveLog(logParam);*/
} catch (IOException e) {
e.printStackTrace();
}
List<String> row1 = CollUtil.newArrayList("aa", "bb", "cc", "dd");
List<String> row2 = CollUtil.newArrayList("aa1", "bb1", "cc1", "dd1");
List<List<?>> rows = CollUtil.newArrayList(row1, row2);
ExcelPoiUtil.downloadXlsx(rows, "excelName", false, response);
}
/**
* 批量删除记录日志示例
* @param param
* @param response
* @param request
*/
public void del(org.json.JSONObject param, HttpServletResponse response, HttpServletRequest request){
//Student stu = new ParamUtil<Student>().packPOJO(super.getRequestMap(request), Student.class);
List<Student> stus = JSON.parseArray(param.getString("data"), Student.class);
if (CollUtil.isEmpty(stus)){
return;
}
bizDao.deleteAll(stus, "S_ID");
try {
LogParam logParam = new LogParam(param, stus.get(0).getName(), "tstudent", "D", "data");
logParam.setMenuName("日志示例");
logParam.setPrimaryKeyColName("S_ID");
logServcie.saveLogPanel(logParam, response);
/*logParam = new LogParam(param, stu.getName(), "tstudent", "delete~~~~~~~~~~~~~~~~~~");
userDefineLogService.saveLog(logParam);*/
} catch (IOException e) {
e.printStackTrace();
}
}
public void upload(org.json.JSONObject param, HttpServletResponse response, HttpServletRequest request){
MultipartHttpServletRequest multipartRequest=(MultipartHttpServletRequest)request;
MultipartFile file = multipartRequest.getFile("fileName");//file是页面input的name名
String basePath = "e:/upload";
try {
MultipartResolver resolver = new CommonsMultipartResolver(request.getSession().getServletContext());
if (resolver.isMultipart(request)) {
//随机生成文件名
String randomName = UUIDUtil.getUUID().substring(10);
String uploadFileName = file.getOriginalFilename();
if (StringUtils.isNotBlank(uploadFileName)) {
//截取文件格式名
String suffix = uploadFileName.substring(uploadFileName.indexOf("."));
//重新拼装文件名
String newFileName = randomName + suffix;
String savePath = basePath + "/" + newFileName;
File saveFile = new File(savePath);
File parentFile = saveFile.getParentFile();
if (saveFile.exists()) {
saveFile.delete();
} else {
if (!parentFile.exists()) {
parentFile.mkdirs();
}
}
//复制文件到指定路径
FileUtils.copyInputStreamToFile(file.getInputStream(), saveFile);
}
}
} catch (Exception e) {
e.printStackTrace();
}
}
public void download(org.json.JSONObject param, HttpServletResponse response, HttpServletRequest request) throws IOException {
String[] row1 = new String[]{"aa", "bb", "cc", "dd"};
String[] row2 = new String[]{"aa1", "bb1", "cc1", "dd1"};
List<String[]> rows = CollUtil.newArrayList(row1, row2);
response.reset();
response.setContentType("application/octet-stream");
response.setCharacterEncoding("utf-8");
String fileName = URLEncoder.encode("测试", "UTF-8").replaceAll("\\+", "%20");
response.setHeader("Content-disposition", "attachment;filename="+fileName+".csv");
// response.setHeader("Content-disposition", "attachment;filename=test.csv");
//CsvUtil.writeToCsv(response.getWriter(), rows);
CSVWriter csvWriter = new CSVWriter(response.getWriter());
csvWriter.writeAll(rows);
csvWriter.flush();
}
public static void main(String[] args) {
/*int level = 0, split = 0;
for (int i=0; i<500; i++ ){
split += 20;
level += split;
System.out.println("等级"+(i+1)+"==exp=="+split+"==total exp=="+level);
}*/
String str = "海邦国际 or 1=1";
String encode = Base64Util.encode(str);
System.out.println(encode);
String decode = Base64Util.decode(encode);
System.out.println(decode);
}
}

View File

@@ -0,0 +1,85 @@
package com.ag.demo;
import cn.hutool.core.collection.CollUtil;
import cn.hutool.core.convert.Convert;
import com.ag.util.StrUtil;
import com.alibaba.fastjson.JSON;
import org.apache.pdfbox.multipdf.Splitter;
import org.apache.pdfbox.pdmodel.PDDocument;
import org.apache.pdfbox.text.PDFTextStripper;
import org.junit.Test;
import java.io.File;
import java.io.IOException;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
public class PdfSplitService {
String sourcePath = "F:\\pdfsplit\\MDB1R981_678692.pdf";
String targetPath = "F:\\pdfsplit\\";
@Test
public void getPdfTextByPages() throws IOException {
PDDocument document = PDDocument.load(new File(sourcePath));
document.setAllSecurityToBeRemoved(true);
PDFTextStripper stripper = new PDFTextStripper();
stripper.setSortByPosition(true);
List<List<String>> txts = CollUtil.list(false);
for(int i = 1; i <= document.getNumberOfPages() ; i++) {
stripper.setStartPage(i);
stripper.setEndPage(i);
String text = stripper.getText(document);
if(!StrUtil.isEmpty(text)){
List<String> rows = CollUtil.list(false);
String[] arrs = text.split("\\r\\n");
for (String row : arrs){
if (!StrUtil.isEmpty(row.trim())){
rows.add(row);
}
}
txts.add(rows);
}
}
Map<String, String> map = new LinkedHashMap<>();
String billNo = "";
for (int i=0; i<txts.size(); i++){
List<String> txt = txts.get(i);
boolean hasNumber = false;
for (String row : txt){
if(StrUtil.isNumeric(row.trim())){
System.out.println(row);
hasNumber = true;
billNo = row.trim();
break;
}
}
if (hasNumber){
map.put(billNo, i+"_"+i);
}else {
map.put(billNo, (i-1)+"_"+i);
}
//System.out.println("page:~~~~~~~~~~~~~~~~"+(i+1));
}
System.out.println(JSON.toJSONString(map));
Splitter splitter = new Splitter();
for (Map.Entry<String, String> entry : map.entrySet()) {
String val = entry.getValue();
int start = Convert.toInt(val.split("_")[0])+1;
int end = Convert.toInt(val.split("_")[1])+1;
splitter.setStartPage(start);
splitter.setEndPage(end);
splitter.setSplitAtPage(end-start+1);
List<PDDocument> pages = splitter.split(document);
for (PDDocument pd : pages) {
String pdfName = targetPath + entry.getKey() + ".pdf";
pd.save(pdfName);
}
}
}
}

View File

@@ -0,0 +1,51 @@
package com.ag.demo;
import com.ag.base.BaseService;
import com.ag.base.DefaultBussniessImpl;
import com.ag.demo.entity.QrcodeInfo;
import com.ag.util.UUIDUtil;
import com.alibaba.fastjson.JSON;
import com.wb.util.WebUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
/**
* Created by yangxh on 2022/3/24.
*/
@Service
public class QRCodeDemo extends BaseService {
@Autowired
private DefaultBussniessImpl bizDao;
public void saveQrInfo(org.json.JSONObject reqParam, HttpServletResponse response, HttpServletRequest request){
QrcodeInfo info = new QrcodeInfo();
info.setId(UUIDUtil.getUUID());
info.setTitle(reqParam.getString("DESCRIPTION"));
info.setContext(reqParam.getString("NOTES"));
info.setKeyword(reqParam.getString("keyword"));
info.setUrl("http://localhost:7002/m?xwl=agtesth/tstudent");
super.setSaveUser(reqParam, info);
bizDao.save(info);
try {
WebUtil.send(response, info.getId());
} catch (IOException e) {
e.printStackTrace();
}
}
public void findQrInfo(org.json.JSONObject reqParam, HttpServletResponse response, HttpServletRequest request){
QrcodeInfo info = new QrcodeInfo();
info.setId(reqParam.getString("id"));
info = (QrcodeInfo)bizDao.findById(info, QrcodeInfo.class, "ID");
try {
WebUtil.send(response, JSON.toJSONString(info));
} catch (IOException e) {
e.printStackTrace();
}
}
}

View File

@@ -0,0 +1,36 @@
package com.ag.demo;
import cloud.tianai.captcha.common.constant.CaptchaTypeConstant;
import cloud.tianai.captcha.generator.ImageCaptchaGenerator;
import cloud.tianai.captcha.generator.common.model.dto.ImageCaptchaInfo;
import cloud.tianai.captcha.generator.impl.MultiImageCaptchaGenerator;
import cloud.tianai.captcha.resource.ImageCaptchaResourceManager;
import cloud.tianai.captcha.resource.impl.DefaultImageCaptchaResourceManager;
import cloud.tianai.captcha.validator.ImageCaptchaValidator;
import cloud.tianai.captcha.validator.impl.BasicCaptchaTrackValidator;
import java.util.Map;
public class TianaiDemo {
public static void main(String[] args) throws InterruptedException {
ImageCaptchaResourceManager imageCaptchaResourceManager = new DefaultImageCaptchaResourceManager();
ImageCaptchaGenerator imageCaptchaGenerator = new MultiImageCaptchaGenerator(imageCaptchaResourceManager).init(true);
/*
生成滑块验证码图片, 可选项
SLIDER (滑块验证码)
ROTATE (旋转验证码)
CONCAT (滑动还原验证码)
WORD_IMAGE_CLICK (文字点选验证码)
更多验证码支持 详见 cloud.tianai.captcha.common.constant.CaptchaTypeConstant
*/
ImageCaptchaInfo imageCaptchaInfo = imageCaptchaGenerator.generateCaptchaImage(CaptchaTypeConstant.SLIDER);
System.out.println(imageCaptchaInfo);
// 负责计算一些数据存到缓存中,用于校验使用
// ImageCaptchaValidator负责校验用户滑动滑块是否正确和生成滑块的一些校验数据; 比如滑块到凹槽的百分比值
ImageCaptchaValidator imageCaptchaValidator = new BasicCaptchaTrackValidator();
// 这个map数据应该存到缓存中校验的时候需要用到该数据
Map<String, Object> map = imageCaptchaValidator.generateImageCaptchaValidData(imageCaptchaInfo);
}
}

View File

@@ -0,0 +1,22 @@
package com.ag.demo;
import cn.hutool.core.date.DateUtil;
import org.springframework.stereotype.Component;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
/**
* Created by yangxh on 2021/8/24.
*/
@Component
public class TimerDemo {
public void run01(org.json.JSONObject param, HttpServletResponse response, HttpServletRequest request){
System.out.println("run01->"+ DateUtil.date());
}
public void run02(org.json.JSONObject param, HttpServletResponse response, HttpServletRequest request){
System.out.println("run02->"+ DateUtil.date());
}
}

View File

@@ -0,0 +1,46 @@
package com.ag.demo.entity;
import java.io.Serializable;
/**
* 数据库异常信息表(DbErrInfo)实体类
*
* @author makejava
* @since 2023-08-30 09:23:59
*/
public class DbErrInfo implements Serializable {
private static final long serialVersionUID = -86680968759505516L;
private String id;
private String errKey;
private String errVal;
public String getId() {
return id;
}
public void setId(String id) {
this.id = id;
}
public String getErrKey() {
return errKey;
}
public void setErrKey(String errKey) {
this.errKey = errKey;
}
public String getErrVal() {
return errVal;
}
public void setErrVal(String errVal) {
this.errVal = errVal;
}
}

View File

@@ -0,0 +1,82 @@
package com.ag.demo.entity;
import com.ag.base.ISerializable;
import java.util.Date;
public class QrcodeInfo implements ISerializable{
private String id;
private String url;
private String title;
private String context;
private String append;
private String createdBy;
private java.util.Date createdOn;
private String keyword;
public String getId() {
return id;
}
public void setId(String id) {
this.id = id;
}
public String getUrl() {
return url;
}
public void setUrl(String url) {
this.url = url;
}
public String getTitle() {
return title;
}
public void setTitle(String title) {
this.title = title;
}
public String getContext() {
return context;
}
public void setContext(String context) {
this.context = context;
}
public String getAppend() {
return append;
}
public void setAppend(String append) {
this.append = append;
}
public String getCreatedBy() {
return createdBy;
}
public void setCreatedBy(String createdBy) {
this.createdBy = createdBy;
}
public Date getCreatedOn() {
return createdOn;
}
public void setCreatedOn(Date createdOn) {
this.createdOn = createdOn;
}
public String getKeyword() {
return keyword;
}
public void setKeyword(String keyword) {
this.keyword = keyword;
}
}

View File

@@ -0,0 +1,100 @@
package com.ag.demo.entity;
import com.ag.base.ISerializable;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
/**
* Created by yangxh on 2021/5/28.
*/
public class Student implements ISerializable {
private String sId;
private String name;
private String sex;
private BigDecimal age;
private String tenancyId;
private String createdBy;
private Date createdOn;
private String updatedBy;
private Date updatedOn;
public String getsId() {
return sId;
}
public void setsId(String sId) {
this.sId = sId;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getSex() {
return sex;
}
public void setSex(String sex) {
this.sex = sex;
}
public BigDecimal getAge() {
return age;
}
public void setAge(BigDecimal age) {
this.age = age;
}
public String getTenancyId() {
return tenancyId;
}
@Override
public void setTenancyId(String tenancyId) {
this.tenancyId = tenancyId;
}
public String getCreatedBy() {
return createdBy;
}
@Override
public void setCreatedBy(String createdBy) {
this.createdBy = createdBy;
}
public Date getCreatedOn() {
return createdOn;
}
@Override
public void setCreatedOn(Date createdOn) {
this.createdOn = createdOn;
}
public String getUpdatedBy() {
return updatedBy;
}
@Override
public void setUpdatedBy(String updatedBy) {
this.updatedBy = updatedBy;
}
public Date getUpdatedOn() {
return updatedOn;
}
@Override
public void setUpdatedOn(Date updatedOn) {
this.updatedOn = updatedOn;
}
}

View File

@@ -0,0 +1,86 @@
package com.ag.demo.entity;
import java.io.Serializable;
/**
* 用户密码配置表(UserPwdConfig)实体类
*
* @author makejava
* @since 2023-07-21 14:27:08
*/
public class UserPwdConfig implements Serializable {
private static final long serialVersionUID = 648348505038393449L;
private String id;
/**
* 密码长度
*/
private Integer pwdLength;
/**
* 是否包含数字0=否1=是)
*/
private Integer containsNum;
/**
* 是否包含大写字符0=否1=是)
*/
private Integer containsUppchar;
/**
* 是否包含小写字符0=否1=是)
*/
private Integer containsLowchar;
/**
* 是否包含特殊字符0=否1=是)
*/
private Integer containsSpechar;
public String getId() {
return id;
}
public void setId(String id) {
this.id = id;
}
public Integer getPwdLength() {
return pwdLength;
}
public void setPwdLength(Integer pwdLength) {
this.pwdLength = pwdLength;
}
public Integer getContainsNum() {
return containsNum;
}
public void setContainsNum(Integer containsNum) {
this.containsNum = containsNum;
}
public Integer getContainsUppchar() {
return containsUppchar;
}
public void setContainsUppchar(Integer containsUppchar) {
this.containsUppchar = containsUppchar;
}
public Integer getContainsLowchar() {
return containsLowchar;
}
public void setContainsLowchar(Integer containsLowchar) {
this.containsLowchar = containsLowchar;
}
public Integer getContainsSpechar() {
return containsSpechar;
}
public void setContainsSpechar(Integer containsSpechar) {
this.containsSpechar = containsSpechar;
}
}

View File

@@ -0,0 +1,99 @@
package com.ag.demo.entity;
import com.ag.base.ISerializable;
import java.util.Date;
public class WFile implements ISerializable {
private static final long serialVersionUID = 981068428519373366L;
private String id;
/**
* 业务类型
*/
private String tName;
/**
* 业务表主键
*/
private String tId;
/**
* 原始文件名
*/
private String fName;
/**
* 保存路径
*/
private String fPath;
private String createdBy;
private Date createdOn;
private String tenancyId;
public String getId() {
return id;
}
public void setId(String id) {
this.id = id;
}
public String getTName() {
return tName;
}
public void setTName(String tName) {
this.tName = tName;
}
public String getTId() {
return tId;
}
public void setTId(String tId) {
this.tId = tId;
}
public String getFName() {
return fName;
}
public void setFName(String fName) {
this.fName = fName;
}
public String getFPath() {
return fPath;
}
public void setFPath(String fPath) {
this.fPath = fPath;
}
public String getCreatedBy() {
return createdBy;
}
public void setCreatedBy(String createdBy) {
this.createdBy = createdBy;
}
public Date getCreatedOn() {
return createdOn;
}
public void setCreatedOn(Date createdOn) {
this.createdOn = createdOn;
}
public String getTenancyId() {
return tenancyId;
}
public void setTenancyId(String tenancyId) {
this.tenancyId = tenancyId;
}
}

View File

@@ -0,0 +1,12 @@
package com.ag.demo.face;
public interface IParament {
String bizType = "bizType";
String bizId = "bizId";
String fileId = "fileId";
String fileName = "fileId__name";
String tmpPath = "/static";//外部路径
String sysPath = "/upload";//系统路径webapp下
// String basePath = "d:";
}

View File

@@ -0,0 +1,20 @@
package com.ag.demo.mapper;
import com.ag.demo.pojo.Student;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
/**
* @author fengjun
* @description 针对表【student】的数据库操作Mapper
* @createDate 2022-04-15 15:04:30
* @Entity com.ag.demo.pojo.Student
*/
@Mapper
public interface StudentMapper extends BaseMapper<Student> {
}

View File

@@ -0,0 +1,293 @@
package com.ag.demo.pojo;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import java.io.Serializable;
import java.util.Date;
/**
*
* @TableName student
*/
@TableName(value ="student")
public class Student implements Serializable {
/**
*
*/
@TableId
private String sId;
/**
*
*/
private String name;
/**
*
*/
private String sex;
/**
*
*/
private Integer age;
/**
*
*/
private String cId;
/**
*
*/
private String tId;
/**
*
*/
private String subId;
/**
*
*/
private String createdBy;
/**
*
*/
private Date createdOn;
/**
*
*/
private String updatedBy;
/**
*
*/
private Date updatedOn;
@TableField(exist = false)
private static final long serialVersionUID = 1L;
/**
*
*/
public String getsId() {
return sId;
}
/**
*
*/
public void setsId(String sId) {
this.sId = sId;
}
/**
*
*/
public String getName() {
return name;
}
/**
*
*/
public void setName(String name) {
this.name = name;
}
/**
*
*/
public String getSex() {
return sex;
}
/**
*
*/
public void setSex(String sex) {
this.sex = sex;
}
/**
*
*/
public Integer getAge() {
return age;
}
/**
*
*/
public void setAge(Integer age) {
this.age = age;
}
/**
*
*/
public String getcId() {
return cId;
}
/**
*
*/
public void setcId(String cId) {
this.cId = cId;
}
/**
*
*/
public String gettId() {
return tId;
}
/**
*
*/
public void settId(String tId) {
this.tId = tId;
}
/**
*
*/
public String getSubId() {
return subId;
}
/**
*
*/
public void setSubId(String subId) {
this.subId = subId;
}
/**
*
*/
public String getCreatedBy() {
return createdBy;
}
/**
*
*/
public void setCreatedBy(String createdBy) {
this.createdBy = createdBy;
}
/**
*
*/
public Date getCreatedOn() {
return createdOn;
}
/**
*
*/
public void setCreatedOn(Date createdOn) {
this.createdOn = createdOn;
}
/**
*
*/
public String getUpdatedBy() {
return updatedBy;
}
/**
*
*/
public void setUpdatedBy(String updatedBy) {
this.updatedBy = updatedBy;
}
/**
*
*/
public Date getUpdatedOn() {
return updatedOn;
}
/**
*
*/
public void setUpdatedOn(Date updatedOn) {
this.updatedOn = updatedOn;
}
@Override
public boolean equals(Object that) {
if (this == that) {
return true;
}
if (that == null) {
return false;
}
if (getClass() != that.getClass()) {
return false;
}
Student other = (Student) that;
return (this.getsId() == null ? other.getsId() == null : this.getsId().equals(other.getsId()))
&& (this.getName() == null ? other.getName() == null : this.getName().equals(other.getName()))
&& (this.getSex() == null ? other.getSex() == null : this.getSex().equals(other.getSex()))
&& (this.getAge() == null ? other.getAge() == null : this.getAge().equals(other.getAge()))
&& (this.getcId() == null ? other.getcId() == null : this.getcId().equals(other.getcId()))
&& (this.gettId() == null ? other.gettId() == null : this.gettId().equals(other.gettId()))
&& (this.getSubId() == null ? other.getSubId() == null : this.getSubId().equals(other.getSubId()))
&& (this.getCreatedBy() == null ? other.getCreatedBy() == null : this.getCreatedBy().equals(other.getCreatedBy()))
&& (this.getCreatedOn() == null ? other.getCreatedOn() == null : this.getCreatedOn().equals(other.getCreatedOn()))
&& (this.getUpdatedBy() == null ? other.getUpdatedBy() == null : this.getUpdatedBy().equals(other.getUpdatedBy()))
&& (this.getUpdatedOn() == null ? other.getUpdatedOn() == null : this.getUpdatedOn().equals(other.getUpdatedOn()));
}
@Override
public int hashCode() {
final int prime = 31;
int result = 1;
result = prime * result + ((getsId() == null) ? 0 : getsId().hashCode());
result = prime * result + ((getName() == null) ? 0 : getName().hashCode());
result = prime * result + ((getSex() == null) ? 0 : getSex().hashCode());
result = prime * result + ((getAge() == null) ? 0 : getAge().hashCode());
result = prime * result + ((getcId() == null) ? 0 : getcId().hashCode());
result = prime * result + ((gettId() == null) ? 0 : gettId().hashCode());
result = prime * result + ((getSubId() == null) ? 0 : getSubId().hashCode());
result = prime * result + ((getCreatedBy() == null) ? 0 : getCreatedBy().hashCode());
result = prime * result + ((getCreatedOn() == null) ? 0 : getCreatedOn().hashCode());
result = prime * result + ((getUpdatedBy() == null) ? 0 : getUpdatedBy().hashCode());
result = prime * result + ((getUpdatedOn() == null) ? 0 : getUpdatedOn().hashCode());
return result;
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append(getClass().getSimpleName());
sb.append(" [");
sb.append("Hash = ").append(hashCode());
sb.append(", sId=").append(sId);
sb.append(", name=").append(name);
sb.append(", sex=").append(sex);
sb.append(", age=").append(age);
sb.append(", cId=").append(cId);
sb.append(", tId=").append(tId);
sb.append(", subId=").append(subId);
sb.append(", createdBy=").append(createdBy);
sb.append(", createdOn=").append(createdOn);
sb.append(", updatedBy=").append(updatedBy);
sb.append(", updatedOn=").append(updatedOn);
sb.append(", serialVersionUID=").append(serialVersionUID);
sb.append("]");
return sb.toString();
}
}

View File

@@ -0,0 +1,4 @@
package com.ag.demo.service;
public class ExcelDemoService {
}

View File

@@ -0,0 +1,100 @@
package com.ag.demo.service;
import cn.hutool.core.collection.CollUtil;
import cn.hutool.core.date.DateUtil;
import cn.hutool.core.io.FileUtil;
import cn.hutool.core.lang.Assert;
import com.ag.base.BaseService;
import com.ag.base.DefaultBussniessImpl;
import com.ag.demo.entity.WFile;
import com.ag.demo.face.IParament;
import com.ag.util.StrUtil;
import org.apache.commons.io.IOUtils;
import org.json.JSONObject;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
@Service
public class FileUploadService extends BaseService {
@Autowired
private DefaultBussniessImpl bizDao;
@Transactional
public List<WFile> uploadAg(JSONObject param, HttpServletResponse response, HttpServletRequest request) throws IOException {
Assert.isTrue(!StrUtil.isEmpty(super.getTenancyId(param)), "非法的上传文件请求!");
Map<String, InputStream> inputMap = new HashMap<>();
for(Map.Entry<String, Object> entry : param.entrySet()){
if (entry.getValue() instanceof InputStream && param.has(entry.getKey()+"__name")){
inputMap.put(param.getString(entry.getKey()+"__name"), (InputStream)entry.getValue());
}
}
List<WFile> saveList = CollUtil.list(false);
long time = System.currentTimeMillis();
int index = 0;
for(Map.Entry<String, InputStream> entry : inputMap.entrySet()){
String saveName = time+"_"+index;
WFile wFile = new WFile();
execute(param, wFile, entry.getKey(), entry.getValue(), saveName);
saveList.add(wFile);
index++;
}
bizDao.saveAll(saveList);
return saveList;
//WebUtil.send(response, "1111");
}
private void execute(org.json.JSONObject param, WFile wFile, String oriName, InputStream input,String realName) throws IOException{
super.setSaveUser(param, wFile);
wFile.setFName(oriName);
wFile.setTName(param.getString(IParament.bizType));
wFile.setTId(param.getString(IParament.bizId));
Assert.isTrue(StrUtil.indexOf(oriName, ".") > 0, "文件格式异常!");
//文件类型
String postfix = StrUtil.substringAfterLast(oriName, ".");
Assert.isTrue(!StrUtil.equalsAnyIgnoreCase(postfix, "asp","aspx","php","jsp"), "非法的文件类型");
/*String path = StrUtil.join(IParament.basePath, "/", wFile.getTenancyId(), "/",
DateUtil.year(super.getNow()), "/", DateUtil.month(super.getNow()), "/",
realName, ".", postfix);*/
String path = getSysPath(param, realName, postfix, wFile.getTenancyId());
wFile.setFPath(path);
OutputStream output = FileUtil.getOutputStream(path);
IOUtils.copy(input, output);
output.close();
input.close();
}
private String getSysPath(org.json.JSONObject param, String realName, String postfix, String tenancyId){
String path = "";
if (param.has("pathType") && StrUtil.equals(param.getString("pathType"), "system")){
path = StrUtil.join(IParament.sysPath, "/",
DateUtil.year(super.getNow()), "/", DateUtil.month(super.getNow())+1, "/",
realName, ".", postfix);
}else {
path = StrUtil.join(IParament.tmpPath, "/", tenancyId, "/",
DateUtil.year(super.getNow()), "/", DateUtil.month(super.getNow()), "/",
realName, ".", postfix);
}
return path;
}
/*public static void main(String[] args) throws IOException {
String oriPath = "D:\\ag_note\\中山\\专票资料(最新).txt";
InputStream input = FileUtil.getInputStream(oriPath);
//FileUtil.touch()
OutputStream output = FileUtil.getOutputStream("e:\\ag_note\\中山\\专票资料(最新).txt");
IOUtils.copy(input, output);
output.close();
input.close();
}*/
}

View File

@@ -0,0 +1,50 @@
package com.ag.demo.service;
import cn.hutool.core.collection.CollUtil;
import com.ag.base.DefaultBussniessImpl;
import com.ag.demo.entity.UserPwdConfig;
import com.ag.util.PwdCheckUtil;
import com.ag.util.StrUtil;
import org.json.JSONObject;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.util.Assert;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.util.List;
@Service
public class PwdCheckService {
@Autowired
private DefaultBussniessImpl bizDao;
public void execute(JSONObject param, HttpServletResponse response, HttpServletRequest request){
String pwd = param.getString("pwd");
if (StrUtil.equals(pwd, "******")){
return;
}
List<UserPwdConfig> configList = bizDao.findAll(UserPwdConfig.class);
if (CollUtil.isEmpty(configList)){
return;
}
UserPwdConfig config = configList.get(0);
if (config.getPwdLength() > 0){
Assert.isTrue(pwd.length() >= config.getPwdLength(), "密码长度不得小于"+config.getPwdLength()+"");
}
if (config.getContainsNum() == 1){
Assert.isTrue(PwdCheckUtil.isContainsNum(pwd), "密码必须包含数字!");
}
if (config.getContainsUppchar() == 1){
Assert.isTrue(PwdCheckUtil.isContainsUppChar(pwd), "密码必须包含大写字符!");
}
if (config.getContainsLowchar() == 1){
Assert.isTrue(PwdCheckUtil.isContainsLowChar(pwd), "密码必须包含小写字符!");
}
if (config.getContainsSpechar() == 1){
Assert.isTrue(PwdCheckUtil.isContainsSpeChar(pwd), "密码必须包含特殊字符!");
}
}
}

View File

@@ -0,0 +1,13 @@
package com.ag.demo.service;
import com.ag.demo.pojo.Student;
import com.baomidou.mybatisplus.extension.service.IService;
/**
* @author fengjun
* @description 针对表【student】的数据库操作Service
* @createDate 2022-04-15 15:04:30
*/
public interface StudentService extends IService<Student> {
}

View File

@@ -0,0 +1,22 @@
package com.ag.demo.service.impl;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.ag.demo.pojo.Student;
import com.ag.demo.service.StudentService;
import com.ag.demo.mapper.StudentMapper;
import org.springframework.stereotype.Service;
/**
* @author fengjun
* @description 针对表【student】的数据库操作Service实现
* @createDate 2022-04-15 15:04:30
*/
@Service
public class StudentServiceImpl extends ServiceImpl<StudentMapper, Student>
implements StudentService{
}

View File

@@ -0,0 +1,177 @@
package com.ag.dynamicmodule.basecode.controller;
import com.ag.dynamicmodule.basecode.dao.CClientDao;
import com.ag.dynamicmodule.basecode.dao.CClientInvoiceDao;
import com.ag.dynamicmodule.basecode.dao.CClientLinkmanDao;
import com.ag.dynamicmodule.basecode.dao.CClientTypeRelaDataDao;
import com.ag.dynamicmodule.basecode.pojo.CClient;
import com.ag.dynamicmodule.basecode.pojo.CClientInvoice;
import com.ag.dynamicmodule.basecode.pojo.CClientLinkman;
import com.ag.dynamicmodule.basecode.pojo.CClientTypeRelaData;
import com.ag.util.CommonUtil;
import com.ag.dynamicmodule.service.IBaseServiceImpl;
import com.ag.dynamicmodule.util.PinyinUtils;
import com.ag.log.entity.LogParam;
import com.ag.log.OperLogServcie;
import com.alibaba.fastjson.JSON;
import com.wb.util.SysUtil;
import com.wb.util.WebUtil;
import org.json.JSONObject;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.StringUtils;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
/**
* Created by Administrator on 2017/12/30.
*/
@Component
public class CClientController {
@Autowired
CClientDao cClientDao;
@Autowired
CClientInvoiceDao cClientInvoiceDao;
@Autowired
CClientLinkmanDao cClientLinkmanDao;
@Autowired
CClientTypeRelaDataDao cClientTypeRelaDataDao;
@Autowired
private IBaseServiceImpl baseService;
@Autowired
private OperLogServcie logServcie;
/**
* 保存数据
* @param object
* @param response
* @param request
*/
@Transactional(rollbackFor = Exception.class)
public void saveMethod(JSONObject object, HttpServletResponse response, HttpServletRequest request) throws IOException{
//客户基本信息
CClient cClient = JSON.parseObject(object.getString("cClientData"),CClient.class);
//发票信息
CClientInvoice cClientInvoice = JSON.parseObject(object.getString("cClientInvoiceData"),CClientInvoice.class);
//汉子提示设置成客户名称的拼音首字母简写
String pinyin = "";
if(!StringUtils.isEmpty(cClient.getClientName())){
pinyin = PinyinUtils.getAlpha(cClient.getClientName());
}
cClient.setInitials(pinyin);
if(!StringUtils.isEmpty(cClient.getId())){//修改
baseService.setParameterValue(cClient,request);
String id = cClient.getId();//客户ID
//统计客户代码为空时,设置成客户代码的值
if(StringUtils.isEmpty(cClient.getCountClientCode())){
cClient.setCountClientCode(cClient.getClientCode());
}
cClientDao.update(cClient);
if(!StringUtils.isEmpty(cClientInvoice.getId())){//发票修改
baseService.setParameterValue(cClientInvoice,request);
cClientInvoice.setClientCode(cClient.getClientCode());
cClientInvoiceDao.update(cClientInvoice);
}else{//发票新增
baseService.setParameterValue(cClientInvoice,request);
cClientInvoice.setId(SysUtil.getId());
cClientInvoice.setClientCode(cClient.getClientCode());
cClientInvoiceDao.insert(cClientInvoice);
}
//删除客户类型,待重新添加
cClientTypeRelaDataDao.deleteByClientCode(cClient.getClientCode());
LogParam logParam = new LogParam(object, cClient.getClientName(), "client", "U", "cClientData");
logServcie.saveLogPanel(logParam, response);
}else{//新增
baseService.setParameterValue(cClient,request);
String newId = SysUtil.getId();
cClient.setId(newId);
cClient.setClientCode(newId);
//统计客户代码为空时,设置成客户代码的值
if(StringUtils.isEmpty(cClient.getCountClientCode())){
cClient.setCountClientCode(cClient.getClientCode());
}
cClientDao.insert(cClient);
baseService.setParameterValue(cClientInvoice,request);
cClientInvoice.setId(SysUtil.getId());
cClientInvoice.setClientCode(newId);
cClientInvoiceDao.insert(cClientInvoice);
LogParam logParam = new LogParam(object, cClient.getClientName(), "client", "C", "cClientData");
logServcie.saveLogPanel(logParam, response);
}
List<CClientTypeRelaData> typeRelas = proTypeCode(request,cClient.getClientCode());
if(!(typeRelas==null||typeRelas.size()==0)){
//循环添加客户的类型
for(int i = 0;i < typeRelas.size();i++){
cClientTypeRelaDataDao.insert(typeRelas.get(i));
}
}
saveLinkManMethod(object,response,request,cClient.getClientCode());
try {
WebUtil.send(response, cClient.getClientCode());
} catch (IOException e) {
e.printStackTrace();
}
}
@Transactional(rollbackFor = Exception.class)
public void saveLinkManMethod(JSONObject object, HttpServletResponse response, HttpServletRequest request,String id) {
List<CClientLinkman> createList = CommonUtil.getBeanlist(object, "cClientLinkmanData", "create", CClientLinkman.class);
List<CClientLinkman> updateList = CommonUtil.getBeanlist(object, "cClientLinkmanData", "update", CClientLinkman.class);
List<CClientLinkman> destroyList = CommonUtil.getBeanlist(object, "cClientLinkmanData", "destroy", CClientLinkman.class);
for (CClientLinkman clientLinkman:createList){
clientLinkman.setClientCode(id);
cClientLinkmanDao.insert(clientLinkman);
}
for (CClientLinkman clientLinkman:updateList){
clientLinkman.setClientCode(id);
cClientLinkmanDao.update(clientLinkman);
}
for (CClientLinkman clientLinkman:destroyList) {
String linkId = clientLinkman.getId();
cClientLinkmanDao.delete(linkId);
}
}
/**
* 删除记录
* @param object
* @param response
* @param request
*/
@Transactional(rollbackFor = Exception.class)
public void delCClient(JSONObject object, HttpServletResponse response, HttpServletRequest request) {
String ids = request.getParameter("ids");
String clientCode = request.getParameter("clientCode");
cClientDao.delete(ids);
cClientInvoiceDao.delete(clientCode);
cClientTypeRelaDataDao.deleteByClientCode(clientCode);
cClientLinkmanDao.deleteByClientCode(clientCode);
}
/**
* Description: 客户类型数据拼接
* @param request
* @return
* Note: Nothing much
*/
public List<CClientTypeRelaData> proTypeCode(HttpServletRequest request,String id){
List<CClientTypeRelaData> list = new ArrayList<>();
String typeCodes = request.getParameter("typeCodes");
if(!StringUtils.isEmpty(typeCodes)){
String[] typeCodeArray= typeCodes.split(",");
for (int i=0;i<typeCodeArray.length;i++) {
CClientTypeRelaData cClientTypeRelaData = new CClientTypeRelaData();
cClientTypeRelaData.setId(SysUtil.getId());
cClientTypeRelaData.setClientCode(id);
cClientTypeRelaData.setClientTypeCode(typeCodeArray[i]);
list.add(cClientTypeRelaData);
}
}
return list;
}
}

View File

@@ -0,0 +1,76 @@
package com.ag.dynamicmodule.basecode.controller;
import com.ag.dynamicmodule.basecode.dao.CClientInvoiceDao;
import com.ag.dynamicmodule.basecode.dao.CClientTypeRelaDataDao;
import com.ag.dynamicmodule.basecode.pojo.CClientInvoice;
import com.ag.util.CommonUtil;
import com.alibaba.fastjson.JSON;
import com.wb.util.WebUtil;
import org.json.JSONObject;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
/**
* Created by Administrator on 2019/9/19 0019.
*/
@Controller
public class CClientInvoiceController {
@Autowired
CClientInvoiceDao cClientInvoiceDao;
@Autowired
CClientTypeRelaDataDao cClientTypeRelaDataDao;
/**
* 保存数据
* @param object
* @param response
* @param request
*/
public void saveMethod(JSONObject object, HttpServletResponse response, HttpServletRequest request){
CClientInvoice cClientInvoice = JSON.parseObject(object.getString("cClientInvoiceData"),CClientInvoice.class);
String username = (String) request.getSession().getAttribute("sys.username");
cClientInvoice.setCreatedBy(username);
cClientInvoice.setCreatedOn(CommonUtil.getNowDate());
cClientInvoice.setUpdatedBy(username);
cClientInvoice.setUpdatedOn(CommonUtil.getNowDate());
cClientInvoiceDao.insert(cClientInvoice);
String datajson = JSON.toJSONString(cClientInvoice);
try {
WebUtil.send(response, CommonUtil.upJson("["+datajson+"]"));
} catch (IOException e) {
e.printStackTrace();
}
}
public void saveUPMethod(JSONObject object, HttpServletResponse response, HttpServletRequest request){
CClientInvoice cClientInvoice = JSON.parseObject(object.getString("cClientInvoiceData"),CClientInvoice.class);
String username = (String) request.getSession().getAttribute("sys.username");
cClientInvoice.setUpdatedBy(username);
cClientInvoice.setUpdatedOn(CommonUtil.getNowDate());
cClientInvoiceDao.update(cClientInvoice);
String datajson = JSON.toJSONString(cClientInvoice);
try {
WebUtil.send(response, CommonUtil.upJson("["+datajson+"]"));
} catch (IOException e) {
e.printStackTrace();
}
}
/**
* 删除记录
* @param object
* @param response
* @param request
*/
public void delCClient(JSONObject object, HttpServletResponse response, HttpServletRequest request) {
String ids = request.getParameter("ids");
cClientInvoiceDao.delete(ids);
}
public void delCClientType(JSONObject object, HttpServletResponse response, HttpServletRequest request) {
String ids = request.getParameter("ids");
cClientTypeRelaDataDao.deleteByClientCode(ids);
}
}

View File

@@ -0,0 +1,69 @@
package com.ag.dynamicmodule.basecode.controller;
import com.ag.dynamicmodule.basecode.dao.CClientLinkmanDao;
import com.ag.dynamicmodule.basecode.pojo.CClientLinkman;
import com.ag.util.CommonUtil;
import com.alibaba.fastjson.JSON;
import com.wb.util.WebUtil;
import org.json.JSONObject;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
/**
* Created by Administrator on 2019/9/23 0023.
*/
@Controller
public class CClientLinkmanController {
@Autowired
CClientLinkmanDao cClientLinkmanDao;
/**
* 保存数据
* @param object
* @param response
* @param request
*/
public void saveMethod(JSONObject object, HttpServletResponse response, HttpServletRequest request){
CClientLinkman cClientLinkman = JSON.parseObject(object.getString("cClientLinkmanData"),CClientLinkman.class);
/*cClientLinkman.setId(SysUtil.getId());
String username = (String) request.getSession().getAttribute("sys.username");
cClientLinkman.setCreatedBy(username);
cClientLinkman.setCreatedOn(CommonUtil.getNowDate());
cClientLinkman.setUpdatedBy(username);
cClientLinkman.setUpdatedOn(CommonUtil.getNowDate());*/
cClientLinkmanDao.insert(cClientLinkman);
String datajson = JSON.toJSONString(cClientLinkman);
try {
WebUtil.send(response, CommonUtil.upJson("["+datajson+"]"));
} catch (IOException e) {
e.printStackTrace();
}
}
public void saveUPMethod(JSONObject object, HttpServletResponse response, HttpServletRequest request){
CClientLinkman cClientLinkman = JSON.parseObject(object.getString("cClientLinkmanData"),CClientLinkman.class);
String username = (String) request.getSession().getAttribute("sys.username");
cClientLinkman.setUpdatedBy(username);
cClientLinkman.setUpdatedOn(CommonUtil.getNowDate());
cClientLinkmanDao.update(cClientLinkman);
String datajson = JSON.toJSONString(cClientLinkman);
try {
WebUtil.send(response, CommonUtil.upJson("["+datajson+"]"));
} catch (IOException e) {
e.printStackTrace();
}
}
/**
* 删除记录
* @param object
* @param response
* @param request
*/
public void delCClient(JSONObject object, HttpServletResponse response, HttpServletRequest request) {
String ids = request.getParameter("ids");
cClientLinkmanDao.delete(ids);
}
}

View File

@@ -0,0 +1,52 @@
package com.ag.dynamicmodule.basecode.dao;
import com.ag.dynamicmodule.basecode.pojo.CClient;
import org.mybatis.spring.SqlSessionTemplate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;
import java.util.List;
/**
* Created by chishk on 2017/12/14.
*/
@Repository
public class CClientDao {
@Autowired
SqlSessionTemplate sqlSessionTemplate;
/**
* 新增数据
* @param cClient
* @return
*/
public int insert(CClient cClient){
return sqlSessionTemplate.insert("resources/basecode.CClientMapper.insertSelective",cClient);
}
/**
* 修改数据
* @param cClient
* @return
*/
public int update(CClient cClient){
return sqlSessionTemplate.update("resources/basecode.CClientMapper.updateByPrimaryKeySelective",cClient);
}
/**
* 查询CClient表数据
* @param ids
* @return
*/
public List selectCClient(String ids){
return sqlSessionTemplate.selectList("resources/basecode.CClientMapper.selectCClient",ids);
}
/**
* 删除CClient表数据
* @param id
* @return
*/
public int delete(String id){
return sqlSessionTemplate.delete("resources/basecode.CClientMapper.deleteByPrimaryKey",id);
}
}

View File

@@ -0,0 +1,52 @@
package com.ag.dynamicmodule.basecode.dao;
import com.ag.dynamicmodule.basecode.pojo.CClientInvoice;
import org.mybatis.spring.SqlSessionTemplate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;
import java.util.List;
/**
* Created by Administrator on 2019/9/17 0017.
*/
@Repository
public class CClientInvoiceDao {
@Autowired
SqlSessionTemplate sqlSessionTemplate;
/**
* 新增数据
* @param cClientInvoice
* @return
*/
public int insert(CClientInvoice cClientInvoice){
return sqlSessionTemplate.insert("resources/basecode.CClientInvoiceMapper.insertSelective",cClientInvoice);
}
/**
* 修改数据
* @param cClientInvoice
* @return
*/
public int update(CClientInvoice cClientInvoice){
return sqlSessionTemplate.update("resources/basecode.CClientInvoiceMapper.updateByPrimaryKeySelective",cClientInvoice);
}
/**
* 查询CClientInvoice表数据
* @param ids
* @return
*/
public List selectStudent(String ids){
return sqlSessionTemplate.selectList("resources/basecode.CClientInvoiceMapper.selectStudent",ids);
}
/**
* 删除CClientInvoice表数据
* @param id
* @return
*/
public int delete(String clientCode){
return sqlSessionTemplate.delete("resources/basecode.CClientInvoiceMapper.deleteByClientCode",clientCode);
}
}

View File

@@ -0,0 +1,56 @@
package com.ag.dynamicmodule.basecode.dao;
/**
* Created by Administrator on 2019/9/23 0023.
*/
import com.ag.dynamicmodule.basecode.pojo.CClientLinkman;
import org.mybatis.spring.SqlSessionTemplate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;
import java.util.List;
@Repository
public class CClientLinkmanDao {
@Autowired
SqlSessionTemplate sqlSessionTemplate;
/**
* 新增数据
* @param cClientLinkman
* @return
*/
public int insert(CClientLinkman cClientLinkman){
return sqlSessionTemplate.insert("resources/basecode.CClientLinkmanMapper.insertSelective",cClientLinkman);
}
/**
* 修改数据
* @param cClientLinkman
* @return
*/
public int update(CClientLinkman cClientLinkman){
return sqlSessionTemplate.update("resources/basecode.CClientLinkmanMapper.updateByPrimaryKeySelective",cClientLinkman);
}
/**
* 查询学生表数据
* @param ids
* @return
*/
public List selectStudent(String ids){
return sqlSessionTemplate.selectList("resources/basecode.CClientLinkmanMapper.selectByPrimaryKey",ids);
}
/**
* 删除学生表数据
* @param id
* @return
*/
public int delete(String id){
return sqlSessionTemplate.delete("resources/basecode.CClientLinkmanMapper.deleteByPrimaryKey",id);
}
public int deleteByClientCode(String clientCode){
return sqlSessionTemplate.delete("resources/basecode.CClientLinkmanMapper.deleteByClientCode",clientCode);
}
}

View File

@@ -0,0 +1,55 @@
package com.ag.dynamicmodule.basecode.dao;
import com.ag.dynamicmodule.basecode.pojo.CClientTypeRelaData;
import org.mybatis.spring.SqlSessionTemplate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;
import java.util.List;
/**
* Created by Administrator on 2019/9/24 0024.
*/
@Repository
public class CClientTypeRelaDataDao {
@Autowired
SqlSessionTemplate sqlSessionTemplate;
/**
* 新增数据
* @param cClientTypeRelaData
* @return
*/
public int insert(CClientTypeRelaData cClientTypeRelaData){
return sqlSessionTemplate.insert("resources/basecode.CClientTypeRelaDataMapper.insertSelective",cClientTypeRelaData);
}
/**
* 修改数据
* @param cClientTypeRelaData
* @return
*/
public int update(CClientTypeRelaData cClientTypeRelaData){
return sqlSessionTemplate.update("resources/basecode.CClientTypeRelaDataMapper.updateByPrimaryKeySelective",cClientTypeRelaData);
}
/**
* 查询CClient表数据
* @param ids
* @return
*/
public List selectCClient(String ids){
return sqlSessionTemplate.selectList("resources/basecode.CClientTypeRelaDataMapper.selectCClient",ids);
}
/**
* 删除CClient表数据
* @param id
* @return
*/
public int delete(String id){
return sqlSessionTemplate.delete("resources/basecode.CClientTypeRelaDataMapper.deleteByPrimaryKey",id);
}
public int deleteByClientCode(String clientCode){
return sqlSessionTemplate.delete("resources/basecode.CClientTypeRelaDataMapper.deleteByClientCode",clientCode);
}
}

View File

@@ -0,0 +1,575 @@
package com.ag.dynamicmodule.basecode.pojo;
import java.io.Serializable;
import java.util.Date;
public class CClient implements Serializable {
/**
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column c_client.ID
*
* @mbg.generated
*/
private String id;
/**
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column c_client.TENANCY_ID
*
* @mbg.generated
*/
private String tenancyId;
/**
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column c_client.CLIENT_CODE
*
* @mbg.generated
*/
private String clientCode;
/**
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column c_client.CLIENT_NAME
*
* @mbg.generated
*/
private String clientName;
/**
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column c_client.EN_CLIENT_NAME
*
* @mbg.generated
*/
private String enClientName;
/**
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column c_client.CLIENT_SHORT
*
* @mbg.generated
*/
private String clientShort;
/**
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column c_client.CLIENT_SHORT_EN
*
* @mbg.generated
*/
private String clientShortEn;
/**
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column c_client.CLIENT_TYPE
*
* @mbg.generated
*/
private String clientType;
/**
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column c_client.CREATED_BY
*
* @mbg.generated
*/
private String createdBy;
/**
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column c_client.CREATED_ON
*
* @mbg.generated
*/
private Date createdOn;
/**
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column c_client.UPDATED_BY
*
* @mbg.generated
*/
private String updatedBy;
/**
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column c_client.UPDATED_ON
*
* @mbg.generated
*/
private Date updatedOn;
/**
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column c_client.INVALID_FLAG
*
* @mbg.generated
*/
private Short invalidFlag;
/**
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column c_client.INVALID_BY
*
* @mbg.generated
*/
private String invalidBy;
/**
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column c_client.INVALID_ON
*
* @mbg.generated
*/
private Date invalidOn;
/**
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column c_client.INITIALS
*
* @mbg.generated
*/
private String initials;
/**
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column c_client.COUNT_CLIENT_CODE
*
* @mbg.generated
*/
private String countClientCode;
/**
* This field was generated by MyBatis Generator.
* This field corresponds to the database table c_client
*
* @mbg.generated
*/
private static final long serialVersionUID = 1L;
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column c_client.ID
*
* @return the value of c_client.ID
*
* @mbg.generated
*/
public String getId() {
return id;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column c_client.ID
*
* @param id the value for c_client.ID
*
* @mbg.generated
*/
public void setId(String id) {
this.id = id == null ? null : id.trim();
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column c_client.TENANCY_ID
*
* @return the value of c_client.TENANCY_ID
*
* @mbg.generated
*/
public String getTenancyId() {
return tenancyId;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column c_client.TENANCY_ID
*
* @param tenancyId the value for c_client.TENANCY_ID
*
* @mbg.generated
*/
public void setTenancyId(String tenancyId) {
this.tenancyId = tenancyId == null ? null : tenancyId.trim();
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column c_client.CLIENT_CODE
*
* @return the value of c_client.CLIENT_CODE
*
* @mbg.generated
*/
public String getClientCode() {
return clientCode;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column c_client.CLIENT_CODE
*
* @param clientCode the value for c_client.CLIENT_CODE
*
* @mbg.generated
*/
public void setClientCode(String clientCode) {
this.clientCode = clientCode == null ? null : clientCode.trim();
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column c_client.CLIENT_NAME
*
* @return the value of c_client.CLIENT_NAME
*
* @mbg.generated
*/
public String getClientName() {
return clientName;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column c_client.CLIENT_NAME
*
* @param clientName the value for c_client.CLIENT_NAME
*
* @mbg.generated
*/
public void setClientName(String clientName) {
this.clientName = clientName == null ? null : clientName.trim();
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column c_client.EN_CLIENT_NAME
*
* @return the value of c_client.EN_CLIENT_NAME
*
* @mbg.generated
*/
public String getEnClientName() {
return enClientName;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column c_client.EN_CLIENT_NAME
*
* @param enClientName the value for c_client.EN_CLIENT_NAME
*
* @mbg.generated
*/
public void setEnClientName(String enClientName) {
this.enClientName = enClientName == null ? null : enClientName.trim();
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column c_client.CLIENT_SHORT
*
* @return the value of c_client.CLIENT_SHORT
*
* @mbg.generated
*/
public String getClientShort() {
return clientShort;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column c_client.CLIENT_SHORT
*
* @param clientShort the value for c_client.CLIENT_SHORT
*
* @mbg.generated
*/
public void setClientShort(String clientShort) {
this.clientShort = clientShort == null ? null : clientShort.trim();
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column c_client.CLIENT_SHORT_EN
*
* @return the value of c_client.CLIENT_SHORT_EN
*
* @mbg.generated
*/
public String getClientShortEn() {
return clientShortEn;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column c_client.CLIENT_SHORT_EN
*
* @param clientShortEn the value for c_client.CLIENT_SHORT_EN
*
* @mbg.generated
*/
public void setClientShortEn(String clientShortEn) {
this.clientShortEn = clientShortEn == null ? null : clientShortEn.trim();
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column c_client.CLIENT_TYPE
*
* @return the value of c_client.CLIENT_TYPE
*
* @mbg.generated
*/
public String getClientType() {
return clientType;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column c_client.CLIENT_TYPE
*
* @param clientType the value for c_client.CLIENT_TYPE
*
* @mbg.generated
*/
public void setClientType(String clientType) {
this.clientType = clientType == null ? null : clientType.trim();
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column c_client.CREATED_BY
*
* @return the value of c_client.CREATED_BY
*
* @mbg.generated
*/
public String getCreatedBy() {
return createdBy;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column c_client.CREATED_BY
*
* @param createdBy the value for c_client.CREATED_BY
*
* @mbg.generated
*/
public void setCreatedBy(String createdBy) {
this.createdBy = createdBy == null ? null : createdBy.trim();
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column c_client.CREATED_ON
*
* @return the value of c_client.CREATED_ON
*
* @mbg.generated
*/
public Date getCreatedOn() {
return createdOn;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column c_client.CREATED_ON
*
* @param createdOn the value for c_client.CREATED_ON
*
* @mbg.generated
*/
public void setCreatedOn(Date createdOn) {
this.createdOn = createdOn;
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column c_client.UPDATED_BY
*
* @return the value of c_client.UPDATED_BY
*
* @mbg.generated
*/
public String getUpdatedBy() {
return updatedBy;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column c_client.UPDATED_BY
*
* @param updatedBy the value for c_client.UPDATED_BY
*
* @mbg.generated
*/
public void setUpdatedBy(String updatedBy) {
this.updatedBy = updatedBy == null ? null : updatedBy.trim();
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column c_client.UPDATED_ON
*
* @return the value of c_client.UPDATED_ON
*
* @mbg.generated
*/
public Date getUpdatedOn() {
return updatedOn;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column c_client.UPDATED_ON
*
* @param updatedOn the value for c_client.UPDATED_ON
*
* @mbg.generated
*/
public void setUpdatedOn(Date updatedOn) {
this.updatedOn = updatedOn;
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column c_client.INVALID_FLAG
*
* @return the value of c_client.INVALID_FLAG
*
* @mbg.generated
*/
public Short getInvalidFlag() {
return invalidFlag;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column c_client.INVALID_FLAG
*
* @param invalidFlag the value for c_client.INVALID_FLAG
*
* @mbg.generated
*/
public void setInvalidFlag(Short invalidFlag) {
this.invalidFlag = invalidFlag;
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column c_client.INVALID_BY
*
* @return the value of c_client.INVALID_BY
*
* @mbg.generated
*/
public String getInvalidBy() {
return invalidBy;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column c_client.INVALID_BY
*
* @param invalidBy the value for c_client.INVALID_BY
*
* @mbg.generated
*/
public void setInvalidBy(String invalidBy) {
this.invalidBy = invalidBy == null ? null : invalidBy.trim();
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column c_client.INVALID_ON
*
* @return the value of c_client.INVALID_ON
*
* @mbg.generated
*/
public Date getInvalidOn() {
return invalidOn;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column c_client.INVALID_ON
*
* @param invalidOn the value for c_client.INVALID_ON
*
* @mbg.generated
*/
public void setInvalidOn(Date invalidOn) {
this.invalidOn = invalidOn;
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column c_client.INITIALS
*
* @return the value of c_client.INITIALS
*
* @mbg.generated
*/
public String getInitials() {
return initials;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column c_client.INITIALS
*
* @param initials the value for c_client.INITIALS
*
* @mbg.generated
*/
public void setInitials(String initials) {
this.initials = initials == null ? null : initials.trim();
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column c_client.COUNT_CLIENT_CODE
*
* @return the value of c_client.COUNT_CLIENT_CODE
*
* @mbg.generated
*/
public String getCountClientCode() {
return countClientCode;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column c_client.COUNT_CLIENT_CODE
*
* @param countClientCode the value for c_client.COUNT_CLIENT_CODE
*
* @mbg.generated
*/
public void setCountClientCode(String countClientCode) {
this.countClientCode = countClientCode == null ? null : countClientCode.trim();
}
}

View File

@@ -0,0 +1,741 @@
package com.ag.dynamicmodule.basecode.pojo;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
public class CClientInvoice implements Serializable {
/**
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column c_client_invoice.ID
*
* @mbg.generated
*/
private String id;
/**
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column c_client_invoice.CLIENT_CODE
*
* @mbg.generated
*/
private String clientCode;
/**
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column c_client_invoice.INV_NAME
*
* @mbg.generated
*/
private String invName;
/**
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column c_client_invoice.ADDRESS_CH
*
* @mbg.generated
*/
private String addressCh;
/**
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column c_client_invoice.ADDRESS_EN
*
* @mbg.generated
*/
private String addressEn;
/**
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column c_client_invoice.RELA_TELEX
*
* @mbg.generated
*/
private String relaTelex;
/**
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column c_client_invoice.RELA_MAN
*
* @mbg.generated
*/
private String relaMan;
/**
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column c_client_invoice.SETTLE_WAY_ID
*
* @mbg.generated
*/
private String settleWayId;
/**
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column c_client_invoice.INV_KIND_FLAG
*
* @mbg.generated
*/
private String invKindFlag;
/**
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column c_client_invoice.INV_TAX_RATE
*
* @mbg.generated
*/
private BigDecimal invTaxRate;
/**
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column c_client_invoice.INV_TAX_NO
*
* @mbg.generated
*/
private String invTaxNo;
/**
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column c_client_invoice.INV_TEL
*
* @mbg.generated
*/
private String invTel;
/**
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column c_client_invoice.INV_ADDRESS
*
* @mbg.generated
*/
private String invAddress;
/**
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column c_client_invoice.INV_CNY_BANK
*
* @mbg.generated
*/
private String invCnyBank;
/**
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column c_client_invoice.INV_CNY_BANK_NO
*
* @mbg.generated
*/
private String invCnyBankNo;
/**
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column c_client_invoice.INV_USD_BANK
*
* @mbg.generated
*/
private String invUsdBank;
/**
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column c_client_invoice.INV_USD_BANK_NO
*
* @mbg.generated
*/
private String invUsdBankNo;
/**
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column c_client_invoice.NOTES
*
* @mbg.generated
*/
private String notes;
/**
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column c_client_invoice.CREATED_BY
*
* @mbg.generated
*/
private String createdBy;
/**
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column c_client_invoice.CREATED_ON
*
* @mbg.generated
*/
private Date createdOn;
/**
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column c_client_invoice.UPDATED_BY
*
* @mbg.generated
*/
private String updatedBy;
/**
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column c_client_invoice.UPDATED_ON
*
* @mbg.generated
*/
private Date updatedOn;
/**
* This field was generated by MyBatis Generator.
* This field corresponds to the database table c_client_invoice
*
* @mbg.generated
*/
private static final long serialVersionUID = 1L;
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column c_client_invoice.ID
*
* @return the value of c_client_invoice.ID
*
* @mbg.generated
*/
public String getId() {
return id;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column c_client_invoice.ID
*
* @param id the value for c_client_invoice.ID
*
* @mbg.generated
*/
public void setId(String id) {
this.id = id == null ? null : id.trim();
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column c_client_invoice.CLIENT_CODE
*
* @return the value of c_client_invoice.CLIENT_CODE
*
* @mbg.generated
*/
public String getClientCode() {
return clientCode;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column c_client_invoice.CLIENT_CODE
*
* @param clientCode the value for c_client_invoice.CLIENT_CODE
*
* @mbg.generated
*/
public void setClientCode(String clientCode) {
this.clientCode = clientCode == null ? null : clientCode.trim();
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column c_client_invoice.INV_NAME
*
* @return the value of c_client_invoice.INV_NAME
*
* @mbg.generated
*/
public String getInvName() {
return invName;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column c_client_invoice.INV_NAME
*
* @param invName the value for c_client_invoice.INV_NAME
*
* @mbg.generated
*/
public void setInvName(String invName) {
this.invName = invName == null ? null : invName.trim();
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column c_client_invoice.ADDRESS_CH
*
* @return the value of c_client_invoice.ADDRESS_CH
*
* @mbg.generated
*/
public String getAddressCh() {
return addressCh;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column c_client_invoice.ADDRESS_CH
*
* @param addressCh the value for c_client_invoice.ADDRESS_CH
*
* @mbg.generated
*/
public void setAddressCh(String addressCh) {
this.addressCh = addressCh == null ? null : addressCh.trim();
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column c_client_invoice.ADDRESS_EN
*
* @return the value of c_client_invoice.ADDRESS_EN
*
* @mbg.generated
*/
public String getAddressEn() {
return addressEn;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column c_client_invoice.ADDRESS_EN
*
* @param addressEn the value for c_client_invoice.ADDRESS_EN
*
* @mbg.generated
*/
public void setAddressEn(String addressEn) {
this.addressEn = addressEn == null ? null : addressEn.trim();
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column c_client_invoice.RELA_TELEX
*
* @return the value of c_client_invoice.RELA_TELEX
*
* @mbg.generated
*/
public String getRelaTelex() {
return relaTelex;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column c_client_invoice.RELA_TELEX
*
* @param relaTelex the value for c_client_invoice.RELA_TELEX
*
* @mbg.generated
*/
public void setRelaTelex(String relaTelex) {
this.relaTelex = relaTelex == null ? null : relaTelex.trim();
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column c_client_invoice.RELA_MAN
*
* @return the value of c_client_invoice.RELA_MAN
*
* @mbg.generated
*/
public String getRelaMan() {
return relaMan;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column c_client_invoice.RELA_MAN
*
* @param relaMan the value for c_client_invoice.RELA_MAN
*
* @mbg.generated
*/
public void setRelaMan(String relaMan) {
this.relaMan = relaMan == null ? null : relaMan.trim();
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column c_client_invoice.SETTLE_WAY_ID
*
* @return the value of c_client_invoice.SETTLE_WAY_ID
*
* @mbg.generated
*/
public String getSettleWayId() {
return settleWayId;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column c_client_invoice.SETTLE_WAY_ID
*
* @param settleWayId the value for c_client_invoice.SETTLE_WAY_ID
*
* @mbg.generated
*/
public void setSettleWayId(String settleWayId) {
this.settleWayId = settleWayId == null ? null : settleWayId.trim();
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column c_client_invoice.INV_KIND_FLAG
*
* @return the value of c_client_invoice.INV_KIND_FLAG
*
* @mbg.generated
*/
public String getInvKindFlag() {
return invKindFlag;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column c_client_invoice.INV_KIND_FLAG
*
* @param invKindFlag the value for c_client_invoice.INV_KIND_FLAG
*
* @mbg.generated
*/
public void setInvKindFlag(String invKindFlag) {
this.invKindFlag = invKindFlag == null ? null : invKindFlag.trim();
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column c_client_invoice.INV_TAX_RATE
*
* @return the value of c_client_invoice.INV_TAX_RATE
*
* @mbg.generated
*/
public BigDecimal getInvTaxRate() {
return invTaxRate;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column c_client_invoice.INV_TAX_RATE
*
* @param invTaxRate the value for c_client_invoice.INV_TAX_RATE
*
* @mbg.generated
*/
public void setInvTaxRate(BigDecimal invTaxRate) {
this.invTaxRate = invTaxRate;
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column c_client_invoice.INV_TAX_NO
*
* @return the value of c_client_invoice.INV_TAX_NO
*
* @mbg.generated
*/
public String getInvTaxNo() {
return invTaxNo;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column c_client_invoice.INV_TAX_NO
*
* @param invTaxNo the value for c_client_invoice.INV_TAX_NO
*
* @mbg.generated
*/
public void setInvTaxNo(String invTaxNo) {
this.invTaxNo = invTaxNo == null ? null : invTaxNo.trim();
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column c_client_invoice.INV_TEL
*
* @return the value of c_client_invoice.INV_TEL
*
* @mbg.generated
*/
public String getInvTel() {
return invTel;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column c_client_invoice.INV_TEL
*
* @param invTel the value for c_client_invoice.INV_TEL
*
* @mbg.generated
*/
public void setInvTel(String invTel) {
this.invTel = invTel == null ? null : invTel.trim();
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column c_client_invoice.INV_ADDRESS
*
* @return the value of c_client_invoice.INV_ADDRESS
*
* @mbg.generated
*/
public String getInvAddress() {
return invAddress;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column c_client_invoice.INV_ADDRESS
*
* @param invAddress the value for c_client_invoice.INV_ADDRESS
*
* @mbg.generated
*/
public void setInvAddress(String invAddress) {
this.invAddress = invAddress == null ? null : invAddress.trim();
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column c_client_invoice.INV_CNY_BANK
*
* @return the value of c_client_invoice.INV_CNY_BANK
*
* @mbg.generated
*/
public String getInvCnyBank() {
return invCnyBank;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column c_client_invoice.INV_CNY_BANK
*
* @param invCnyBank the value for c_client_invoice.INV_CNY_BANK
*
* @mbg.generated
*/
public void setInvCnyBank(String invCnyBank) {
this.invCnyBank = invCnyBank == null ? null : invCnyBank.trim();
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column c_client_invoice.INV_CNY_BANK_NO
*
* @return the value of c_client_invoice.INV_CNY_BANK_NO
*
* @mbg.generated
*/
public String getInvCnyBankNo() {
return invCnyBankNo;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column c_client_invoice.INV_CNY_BANK_NO
*
* @param invCnyBankNo the value for c_client_invoice.INV_CNY_BANK_NO
*
* @mbg.generated
*/
public void setInvCnyBankNo(String invCnyBankNo) {
this.invCnyBankNo = invCnyBankNo == null ? null : invCnyBankNo.trim();
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column c_client_invoice.INV_USD_BANK
*
* @return the value of c_client_invoice.INV_USD_BANK
*
* @mbg.generated
*/
public String getInvUsdBank() {
return invUsdBank;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column c_client_invoice.INV_USD_BANK
*
* @param invUsdBank the value for c_client_invoice.INV_USD_BANK
*
* @mbg.generated
*/
public void setInvUsdBank(String invUsdBank) {
this.invUsdBank = invUsdBank == null ? null : invUsdBank.trim();
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column c_client_invoice.INV_USD_BANK_NO
*
* @return the value of c_client_invoice.INV_USD_BANK_NO
*
* @mbg.generated
*/
public String getInvUsdBankNo() {
return invUsdBankNo;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column c_client_invoice.INV_USD_BANK_NO
*
* @param invUsdBankNo the value for c_client_invoice.INV_USD_BANK_NO
*
* @mbg.generated
*/
public void setInvUsdBankNo(String invUsdBankNo) {
this.invUsdBankNo = invUsdBankNo == null ? null : invUsdBankNo.trim();
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column c_client_invoice.NOTES
*
* @return the value of c_client_invoice.NOTES
*
* @mbg.generated
*/
public String getNotes() {
return notes;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column c_client_invoice.NOTES
*
* @param notes the value for c_client_invoice.NOTES
*
* @mbg.generated
*/
public void setNotes(String notes) {
this.notes = notes == null ? null : notes.trim();
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column c_client_invoice.CREATED_BY
*
* @return the value of c_client_invoice.CREATED_BY
*
* @mbg.generated
*/
public String getCreatedBy() {
return createdBy;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column c_client_invoice.CREATED_BY
*
* @param createdBy the value for c_client_invoice.CREATED_BY
*
* @mbg.generated
*/
public void setCreatedBy(String createdBy) {
this.createdBy = createdBy == null ? null : createdBy.trim();
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column c_client_invoice.CREATED_ON
*
* @return the value of c_client_invoice.CREATED_ON
*
* @mbg.generated
*/
public Date getCreatedOn() {
return createdOn;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column c_client_invoice.CREATED_ON
*
* @param createdOn the value for c_client_invoice.CREATED_ON
*
* @mbg.generated
*/
public void setCreatedOn(Date createdOn) {
this.createdOn = createdOn;
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column c_client_invoice.UPDATED_BY
*
* @return the value of c_client_invoice.UPDATED_BY
*
* @mbg.generated
*/
public String getUpdatedBy() {
return updatedBy;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column c_client_invoice.UPDATED_BY
*
* @param updatedBy the value for c_client_invoice.UPDATED_BY
*
* @mbg.generated
*/
public void setUpdatedBy(String updatedBy) {
this.updatedBy = updatedBy == null ? null : updatedBy.trim();
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column c_client_invoice.UPDATED_ON
*
* @return the value of c_client_invoice.UPDATED_ON
*
* @mbg.generated
*/
public Date getUpdatedOn() {
return updatedOn;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column c_client_invoice.UPDATED_ON
*
* @param updatedOn the value for c_client_invoice.UPDATED_ON
*
* @mbg.generated
*/
public void setUpdatedOn(Date updatedOn) {
this.updatedOn = updatedOn;
}
}

View File

@@ -0,0 +1,806 @@
package com.ag.dynamicmodule.basecode.pojo;
import java.io.Serializable;
import java.util.Date;
public class CClientLinkman implements Serializable {
/**
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column c_client_linkman.ID
*
* @mbg.generated
*/
private String id;
/**
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column c_client_linkman.CLIENT_CODE
*
* @mbg.generated
*/
private String clientCode;
/**
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column c_client_linkman.TENANCY_ID
*
* @mbg.generated
*/
private String tenancyId;
/**
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column c_client_linkman.LINK_MAN
*
* @mbg.generated
*/
private String linkMan;
/**
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column c_client_linkman.DUTY
*
* @mbg.generated
*/
private String duty;
/**
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column c_client_linkman.SEX
*
* @mbg.generated
*/
private String sex;
/**
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column c_client_linkman.ADDRESS_TXT
*
* @mbg.generated
*/
private String addressTxt;
/**
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column c_client_linkman.POSTAL_CODE
*
* @mbg.generated
*/
private String postalCode;
/**
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column c_client_linkman.TEL
*
* @mbg.generated
*/
private String tel;
/**
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column c_client_linkman.FAX
*
* @mbg.generated
*/
private String fax;
/**
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column c_client_linkman.HANDSET
*
* @mbg.generated
*/
private String handset;
/**
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column c_client_linkman.HOME_PAGE
*
* @mbg.generated
*/
private String homePage;
/**
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column c_client_linkman.EMAIL
*
* @mbg.generated
*/
private String email;
/**
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column c_client_linkman.BIRTHDAT
*
* @mbg.generated
*/
private Date birthdat;
/**
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column c_client_linkman.LOVE_TXT
*
* @mbg.generated
*/
private String loveTxt;
/**
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column c_client_linkman.HOME_ADDR
*
* @mbg.generated
*/
private String homeAddr;
/**
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column c_client_linkman.RELA_POST
*
* @mbg.generated
*/
private String relaPost;
/**
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column c_client_linkman.LINK_TEL
*
* @mbg.generated
*/
private String linkTel;
/**
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column c_client_linkman.LINK_FAX
*
* @mbg.generated
*/
private String linkFax;
/**
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column c_client_linkman.NOTES
*
* @mbg.generated
*/
private String notes;
/**
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column c_client_linkman.CREATED_BY
*
* @mbg.generated
*/
private String createdBy;
/**
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column c_client_linkman.CREATED_ON
*
* @mbg.generated
*/
private Date createdOn;
/**
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column c_client_linkman.UPDATED_BY
*
* @mbg.generated
*/
private String updatedBy;
/**
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column c_client_linkman.UPDATED_ON
*
* @mbg.generated
*/
private Date updatedOn;
/**
* This field was generated by MyBatis Generator.
* This field corresponds to the database table c_client_linkman
*
* @mbg.generated
*/
private static final long serialVersionUID = 1L;
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column c_client_linkman.ID
*
* @return the value of c_client_linkman.ID
*
* @mbg.generated
*/
public String getId() {
return id;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column c_client_linkman.ID
*
* @param id the value for c_client_linkman.ID
*
* @mbg.generated
*/
public void setId(String id) {
this.id = id == null ? null : id.trim();
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column c_client_linkman.CLIENT_CODE
*
* @return the value of c_client_linkman.CLIENT_CODE
*
* @mbg.generated
*/
public String getClientCode() {
return clientCode;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column c_client_linkman.CLIENT_CODE
*
* @param clientCode the value for c_client_linkman.CLIENT_CODE
*
* @mbg.generated
*/
public void setClientCode(String clientCode) {
this.clientCode = clientCode == null ? null : clientCode.trim();
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column c_client_linkman.TENANCY_ID
*
* @return the value of c_client_linkman.TENANCY_ID
*
* @mbg.generated
*/
public String getTenancyId() {
return tenancyId;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column c_client_linkman.TENANCY_ID
*
* @param tenancyId the value for c_client_linkman.TENANCY_ID
*
* @mbg.generated
*/
public void setTenancyId(String tenancyId) {
this.tenancyId = tenancyId == null ? null : tenancyId.trim();
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column c_client_linkman.LINK_MAN
*
* @return the value of c_client_linkman.LINK_MAN
*
* @mbg.generated
*/
public String getLinkMan() {
return linkMan;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column c_client_linkman.LINK_MAN
*
* @param linkMan the value for c_client_linkman.LINK_MAN
*
* @mbg.generated
*/
public void setLinkMan(String linkMan) {
this.linkMan = linkMan == null ? null : linkMan.trim();
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column c_client_linkman.DUTY
*
* @return the value of c_client_linkman.DUTY
*
* @mbg.generated
*/
public String getDuty() {
return duty;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column c_client_linkman.DUTY
*
* @param duty the value for c_client_linkman.DUTY
*
* @mbg.generated
*/
public void setDuty(String duty) {
this.duty = duty == null ? null : duty.trim();
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column c_client_linkman.SEX
*
* @return the value of c_client_linkman.SEX
*
* @mbg.generated
*/
public String getSex() {
return sex;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column c_client_linkman.SEX
*
* @param sex the value for c_client_linkman.SEX
*
* @mbg.generated
*/
public void setSex(String sex) {
this.sex = sex == null ? null : sex.trim();
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column c_client_linkman.ADDRESS_TXT
*
* @return the value of c_client_linkman.ADDRESS_TXT
*
* @mbg.generated
*/
public String getAddressTxt() {
return addressTxt;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column c_client_linkman.ADDRESS_TXT
*
* @param addressTxt the value for c_client_linkman.ADDRESS_TXT
*
* @mbg.generated
*/
public void setAddressTxt(String addressTxt) {
this.addressTxt = addressTxt == null ? null : addressTxt.trim();
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column c_client_linkman.POSTAL_CODE
*
* @return the value of c_client_linkman.POSTAL_CODE
*
* @mbg.generated
*/
public String getPostalCode() {
return postalCode;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column c_client_linkman.POSTAL_CODE
*
* @param postalCode the value for c_client_linkman.POSTAL_CODE
*
* @mbg.generated
*/
public void setPostalCode(String postalCode) {
this.postalCode = postalCode == null ? null : postalCode.trim();
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column c_client_linkman.TEL
*
* @return the value of c_client_linkman.TEL
*
* @mbg.generated
*/
public String getTel() {
return tel;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column c_client_linkman.TEL
*
* @param tel the value for c_client_linkman.TEL
*
* @mbg.generated
*/
public void setTel(String tel) {
this.tel = tel == null ? null : tel.trim();
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column c_client_linkman.FAX
*
* @return the value of c_client_linkman.FAX
*
* @mbg.generated
*/
public String getFax() {
return fax;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column c_client_linkman.FAX
*
* @param fax the value for c_client_linkman.FAX
*
* @mbg.generated
*/
public void setFax(String fax) {
this.fax = fax == null ? null : fax.trim();
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column c_client_linkman.HANDSET
*
* @return the value of c_client_linkman.HANDSET
*
* @mbg.generated
*/
public String getHandset() {
return handset;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column c_client_linkman.HANDSET
*
* @param handset the value for c_client_linkman.HANDSET
*
* @mbg.generated
*/
public void setHandset(String handset) {
this.handset = handset == null ? null : handset.trim();
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column c_client_linkman.HOME_PAGE
*
* @return the value of c_client_linkman.HOME_PAGE
*
* @mbg.generated
*/
public String getHomePage() {
return homePage;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column c_client_linkman.HOME_PAGE
*
* @param homePage the value for c_client_linkman.HOME_PAGE
*
* @mbg.generated
*/
public void setHomePage(String homePage) {
this.homePage = homePage == null ? null : homePage.trim();
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column c_client_linkman.EMAIL
*
* @return the value of c_client_linkman.EMAIL
*
* @mbg.generated
*/
public String getEmail() {
return email;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column c_client_linkman.EMAIL
*
* @param email the value for c_client_linkman.EMAIL
*
* @mbg.generated
*/
public void setEmail(String email) {
this.email = email == null ? null : email.trim();
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column c_client_linkman.BIRTHDAT
*
* @return the value of c_client_linkman.BIRTHDAT
*
* @mbg.generated
*/
public Date getBirthdat() {
return birthdat;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column c_client_linkman.BIRTHDAT
*
* @param birthdat the value for c_client_linkman.BIRTHDAT
*
* @mbg.generated
*/
public void setBirthdat(Date birthdat) {
this.birthdat = birthdat;
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column c_client_linkman.LOVE_TXT
*
* @return the value of c_client_linkman.LOVE_TXT
*
* @mbg.generated
*/
public String getLoveTxt() {
return loveTxt;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column c_client_linkman.LOVE_TXT
*
* @param loveTxt the value for c_client_linkman.LOVE_TXT
*
* @mbg.generated
*/
public void setLoveTxt(String loveTxt) {
this.loveTxt = loveTxt == null ? null : loveTxt.trim();
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column c_client_linkman.HOME_ADDR
*
* @return the value of c_client_linkman.HOME_ADDR
*
* @mbg.generated
*/
public String getHomeAddr() {
return homeAddr;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column c_client_linkman.HOME_ADDR
*
* @param homeAddr the value for c_client_linkman.HOME_ADDR
*
* @mbg.generated
*/
public void setHomeAddr(String homeAddr) {
this.homeAddr = homeAddr == null ? null : homeAddr.trim();
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column c_client_linkman.RELA_POST
*
* @return the value of c_client_linkman.RELA_POST
*
* @mbg.generated
*/
public String getRelaPost() {
return relaPost;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column c_client_linkman.RELA_POST
*
* @param relaPost the value for c_client_linkman.RELA_POST
*
* @mbg.generated
*/
public void setRelaPost(String relaPost) {
this.relaPost = relaPost == null ? null : relaPost.trim();
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column c_client_linkman.LINK_TEL
*
* @return the value of c_client_linkman.LINK_TEL
*
* @mbg.generated
*/
public String getLinkTel() {
return linkTel;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column c_client_linkman.LINK_TEL
*
* @param linkTel the value for c_client_linkman.LINK_TEL
*
* @mbg.generated
*/
public void setLinkTel(String linkTel) {
this.linkTel = linkTel == null ? null : linkTel.trim();
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column c_client_linkman.LINK_FAX
*
* @return the value of c_client_linkman.LINK_FAX
*
* @mbg.generated
*/
public String getLinkFax() {
return linkFax;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column c_client_linkman.LINK_FAX
*
* @param linkFax the value for c_client_linkman.LINK_FAX
*
* @mbg.generated
*/
public void setLinkFax(String linkFax) {
this.linkFax = linkFax == null ? null : linkFax.trim();
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column c_client_linkman.NOTES
*
* @return the value of c_client_linkman.NOTES
*
* @mbg.generated
*/
public String getNotes() {
return notes;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column c_client_linkman.NOTES
*
* @param notes the value for c_client_linkman.NOTES
*
* @mbg.generated
*/
public void setNotes(String notes) {
this.notes = notes == null ? null : notes.trim();
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column c_client_linkman.CREATED_BY
*
* @return the value of c_client_linkman.CREATED_BY
*
* @mbg.generated
*/
public String getCreatedBy() {
return createdBy;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column c_client_linkman.CREATED_BY
*
* @param createdBy the value for c_client_linkman.CREATED_BY
*
* @mbg.generated
*/
public void setCreatedBy(String createdBy) {
this.createdBy = createdBy == null ? null : createdBy.trim();
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column c_client_linkman.CREATED_ON
*
* @return the value of c_client_linkman.CREATED_ON
*
* @mbg.generated
*/
public Date getCreatedOn() {
return createdOn;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column c_client_linkman.CREATED_ON
*
* @param createdOn the value for c_client_linkman.CREATED_ON
*
* @mbg.generated
*/
public void setCreatedOn(Date createdOn) {
this.createdOn = createdOn;
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column c_client_linkman.UPDATED_BY
*
* @return the value of c_client_linkman.UPDATED_BY
*
* @mbg.generated
*/
public String getUpdatedBy() {
return updatedBy;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column c_client_linkman.UPDATED_BY
*
* @param updatedBy the value for c_client_linkman.UPDATED_BY
*
* @mbg.generated
*/
public void setUpdatedBy(String updatedBy) {
this.updatedBy = updatedBy == null ? null : updatedBy.trim();
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column c_client_linkman.UPDATED_ON
*
* @return the value of c_client_linkman.UPDATED_ON
*
* @mbg.generated
*/
public Date getUpdatedOn() {
return updatedOn;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column c_client_linkman.UPDATED_ON
*
* @param updatedOn the value for c_client_linkman.UPDATED_ON
*
* @mbg.generated
*/
public void setUpdatedOn(Date updatedOn) {
this.updatedOn = updatedOn;
}
}

View File

@@ -0,0 +1,344 @@
package com.ag.dynamicmodule.basecode.pojo;
import java.io.Serializable;
import java.util.Date;
public class CClientType implements Serializable {
/**
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column c_client_type.ID
*
* @mbg.generated
*/
private String id;
/**
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column c_client_type.TENANCY_ID
*
* @mbg.generated
*/
private String tenancyId;
/**
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column c_client_type.TYPE_CODE
*
* @mbg.generated
*/
private String typeCode;
/**
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column c_client_type.TYPE_NAME
*
* @mbg.generated
*/
private String typeName;
/**
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column c_client_type.SEQ_NO
*
* @mbg.generated
*/
private Short seqNo;
/**
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column c_client_type.NOTES
*
* @mbg.generated
*/
private String notes;
/**
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column c_client_type.CREATED_BY
*
* @mbg.generated
*/
private String createdBy;
/**
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column c_client_type.CREATED_ON
*
* @mbg.generated
*/
private Date createdOn;
/**
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column c_client_type.UPDATED_BY
*
* @mbg.generated
*/
private String updatedBy;
/**
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column c_client_type.UPDATED_ON
*
* @mbg.generated
*/
private Date updatedOn;
/**
* This field was generated by MyBatis Generator.
* This field corresponds to the database table c_client_type
*
* @mbg.generated
*/
private static final long serialVersionUID = 1L;
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column c_client_type.ID
*
* @return the value of c_client_type.ID
*
* @mbg.generated
*/
public String getId() {
return id;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column c_client_type.ID
*
* @param id the value for c_client_type.ID
*
* @mbg.generated
*/
public void setId(String id) {
this.id = id == null ? null : id.trim();
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column c_client_type.TENANCY_ID
*
* @return the value of c_client_type.TENANCY_ID
*
* @mbg.generated
*/
public String getTenancyId() {
return tenancyId;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column c_client_type.TENANCY_ID
*
* @param tenancyId the value for c_client_type.TENANCY_ID
*
* @mbg.generated
*/
public void setTenancyId(String tenancyId) {
this.tenancyId = tenancyId == null ? null : tenancyId.trim();
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column c_client_type.TYPE_CODE
*
* @return the value of c_client_type.TYPE_CODE
*
* @mbg.generated
*/
public String getTypeCode() {
return typeCode;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column c_client_type.TYPE_CODE
*
* @param typeCode the value for c_client_type.TYPE_CODE
*
* @mbg.generated
*/
public void setTypeCode(String typeCode) {
this.typeCode = typeCode == null ? null : typeCode.trim();
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column c_client_type.TYPE_NAME
*
* @return the value of c_client_type.TYPE_NAME
*
* @mbg.generated
*/
public String getTypeName() {
return typeName;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column c_client_type.TYPE_NAME
*
* @param typeName the value for c_client_type.TYPE_NAME
*
* @mbg.generated
*/
public void setTypeName(String typeName) {
this.typeName = typeName == null ? null : typeName.trim();
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column c_client_type.SEQ_NO
*
* @return the value of c_client_type.SEQ_NO
*
* @mbg.generated
*/
public Short getSeqNo() {
return seqNo;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column c_client_type.SEQ_NO
*
* @param seqNo the value for c_client_type.SEQ_NO
*
* @mbg.generated
*/
public void setSeqNo(Short seqNo) {
this.seqNo = seqNo;
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column c_client_type.NOTES
*
* @return the value of c_client_type.NOTES
*
* @mbg.generated
*/
public String getNotes() {
return notes;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column c_client_type.NOTES
*
* @param notes the value for c_client_type.NOTES
*
* @mbg.generated
*/
public void setNotes(String notes) {
this.notes = notes == null ? null : notes.trim();
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column c_client_type.CREATED_BY
*
* @return the value of c_client_type.CREATED_BY
*
* @mbg.generated
*/
public String getCreatedBy() {
return createdBy;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column c_client_type.CREATED_BY
*
* @param createdBy the value for c_client_type.CREATED_BY
*
* @mbg.generated
*/
public void setCreatedBy(String createdBy) {
this.createdBy = createdBy == null ? null : createdBy.trim();
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column c_client_type.CREATED_ON
*
* @return the value of c_client_type.CREATED_ON
*
* @mbg.generated
*/
public Date getCreatedOn() {
return createdOn;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column c_client_type.CREATED_ON
*
* @param createdOn the value for c_client_type.CREATED_ON
*
* @mbg.generated
*/
public void setCreatedOn(Date createdOn) {
this.createdOn = createdOn;
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column c_client_type.UPDATED_BY
*
* @return the value of c_client_type.UPDATED_BY
*
* @mbg.generated
*/
public String getUpdatedBy() {
return updatedBy;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column c_client_type.UPDATED_BY
*
* @param updatedBy the value for c_client_type.UPDATED_BY
*
* @mbg.generated
*/
public void setUpdatedBy(String updatedBy) {
this.updatedBy = updatedBy == null ? null : updatedBy.trim();
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column c_client_type.UPDATED_ON
*
* @return the value of c_client_type.UPDATED_ON
*
* @mbg.generated
*/
public Date getUpdatedOn() {
return updatedOn;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column c_client_type.UPDATED_ON
*
* @param updatedOn the value for c_client_type.UPDATED_ON
*
* @mbg.generated
*/
public void setUpdatedOn(Date updatedOn) {
this.updatedOn = updatedOn;
}
}

View File

@@ -0,0 +1,178 @@
package com.ag.dynamicmodule.basecode.pojo;
import java.io.Serializable;
public class CClientTypeRelaData implements Serializable {
/**
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column c_client_type_rela_data.ID
*
* @mbg.generated
*/
private String id;
/**
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column c_client_type_rela_data.TENANCY_ID
*
* @mbg.generated
*/
private String tenancyId;
/**
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column c_client_type_rela_data.CLIENT_TYPE_CODE
*
* @mbg.generated
*/
private String clientTypeCode;
/**
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column c_client_type_rela_data.CLIENT_CODE
*
* @mbg.generated
*/
private String clientCode;
/**
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column c_client_type_rela_data.CHECK_FLAG
*
* @mbg.generated
*/
private String checkFlag;
/**
* This field was generated by MyBatis Generator.
* This field corresponds to the database table c_client_type_rela_data
*
* @mbg.generated
*/
private static final long serialVersionUID = 1L;
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column c_client_type_rela_data.ID
*
* @return the value of c_client_type_rela_data.ID
*
* @mbg.generated
*/
public String getId() {
return id;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column c_client_type_rela_data.ID
*
* @param id the value for c_client_type_rela_data.ID
*
* @mbg.generated
*/
public void setId(String id) {
this.id = id == null ? null : id.trim();
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column c_client_type_rela_data.TENANCY_ID
*
* @return the value of c_client_type_rela_data.TENANCY_ID
*
* @mbg.generated
*/
public String getTenancyId() {
return tenancyId;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column c_client_type_rela_data.TENANCY_ID
*
* @param tenancyId the value for c_client_type_rela_data.TENANCY_ID
*
* @mbg.generated
*/
public void setTenancyId(String tenancyId) {
this.tenancyId = tenancyId == null ? null : tenancyId.trim();
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column c_client_type_rela_data.CLIENT_TYPE_CODE
*
* @return the value of c_client_type_rela_data.CLIENT_TYPE_CODE
*
* @mbg.generated
*/
public String getClientTypeCode() {
return clientTypeCode;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column c_client_type_rela_data.CLIENT_TYPE_CODE
*
* @param clientTypeCode the value for c_client_type_rela_data.CLIENT_TYPE_CODE
*
* @mbg.generated
*/
public void setClientTypeCode(String clientTypeCode) {
this.clientTypeCode = clientTypeCode == null ? null : clientTypeCode.trim();
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column c_client_type_rela_data.CLIENT_CODE
*
* @return the value of c_client_type_rela_data.CLIENT_CODE
*
* @mbg.generated
*/
public String getClientCode() {
return clientCode;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column c_client_type_rela_data.CLIENT_CODE
*
* @param clientCode the value for c_client_type_rela_data.CLIENT_CODE
*
* @mbg.generated
*/
public void setClientCode(String clientCode) {
this.clientCode = clientCode == null ? null : clientCode.trim();
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column c_client_type_rela_data.CHECK_FLAG
*
* @return the value of c_client_type_rela_data.CHECK_FLAG
*
* @mbg.generated
*/
public String getCheckFlag() {
return checkFlag;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column c_client_type_rela_data.CHECK_FLAG
*
* @param checkFlag the value for c_client_type_rela_data.CHECK_FLAG
*
* @mbg.generated
*/
public void setCheckFlag(String checkFlag) {
this.checkFlag = checkFlag == null ? null : checkFlag.trim();
}
}

View File

@@ -0,0 +1,89 @@
package com.ag.dynamicmodule.common;
import org.apache.poi.hssf.usermodel.HSSFWorkbook;
import org.apache.poi.poifs.filesystem.POIFSFileSystem;
import org.apache.poi.ss.usermodel.Row;
import org.apache.poi.ss.usermodel.Sheet;
import org.apache.poi.ss.usermodel.Workbook;
import java.io.*;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
* Created by Administrator on 2018/1/7.
*/
public class ExpPoiSimExcel {
/**
* 导出excel文档
* @param data
* @param isFilePath
* @param osFilePath
* @return
* @throws Exception
*/
public static String expExcel(List data,String isFilePath,String osFilePath)throws Exception{
Workbook wb=ExpPoiSimExcel.fillExcelDataWithTemplate(data,isFilePath);
ExpPoiSimExcel.export( wb,osFilePath);
return osFilePath;
}
/**
* 循环处理数据
* @param data
* @param isFilePath
* @return
* @throws Exception
*/
public static Workbook fillExcelDataWithTemplate(List data, String isFilePath)throws Exception{
InputStream is = new FileInputStream(isFilePath);
POIFSFileSystem fs=new POIFSFileSystem(is);
Workbook wb=new HSSFWorkbook(fs);
Sheet sheet=wb.getSheetAt(0);
//得到标题行列数
int cellNums=sheet.getRow(0).getLastCellNum();
int rowIndex=1;
for (int i= 0; data !=null && i < data.size();i++) {
Row row = sheet.createRow(rowIndex++);
List slist = (List) data.get(i);
for (int j = 0; j < cellNums; j++) {
row.createCell(j).setCellValue(String.valueOf(slist.get(j)));
}
}
return wb;
}
/**
* 输出文件
* @param wb
* @param osFileName
* @throws Exception
*/
public static void export(Workbook wb, String osFileName)throws Exception{
File outFile = new File(osFileName);
OutputStream out= new FileOutputStream(outFile);
wb.write(out);
out.flush();
out.close();
}
public static void main(String[] args) {
try {
List data = new ArrayList();
List list = new ArrayList();
list.add(2);
list.add(3);
list.add(4);
list.add(5);
data.add(list);
String isFilePath = "F:\\cntrExcel.xls";
String osFilePath = "F:\\s" + System.currentTimeMillis() + ".xls";
ExpPoiSimExcel.expExcel(data,isFilePath,osFilePath);
} catch (Exception e) {
e.printStackTrace();
}
}
}

View File

@@ -0,0 +1,116 @@
package com.ag.dynamicmodule.common;
import com.ag.base.DefaultBussniessImpl;
import com.ag.log.OperLogServcie;
import com.ag.log.entity.LogParam;
import com.ag.util.CommonUtil;
import com.ag.dynamicmodule.service.IBaseServiceImpl;
import com.alibaba.fastjson.JSON;
import com.wb.util.WebUtil;
import org.json.JSONObject;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.util.List;
/**
* Created by WangN on 2017/9/9.
* 用于可编辑Grid增删改最终保存
*/
/**
*
*/
@Service
public class PsamatheComBean {
/*@Autowired
private SqlSessionTemplate sqlSessionTemplate;*/
@Autowired
private IBaseServiceImpl baseService;
@Autowired
private DefaultBussniessImpl bizDao;
@Autowired
private OperLogServcie logServcie;
public String forItem(List list, HttpServletRequest request, String dataJson) {
for (int i = 0; list != null && i < list.size(); i++) {
Object appt = list.get(i);
baseService.setParameterValue(appt,request);
dataJson += JSON.toJSONString(appt) + ",";
/*if (type.equals("insertSql")) {
baseService.setParameterValue(appt,request);
sqlSessionTemplate.insert(request.getParameter("insertSql"), appt);
dataJson += JSON.toJSONString(appt) + ",";
}
if (type.equals("updateSql")) {
baseService.setParameterValue(appt,request);
sqlSessionTemplate.update(request.getParameter("updateSql"), appt);
dataJson += JSON.toJSONString(appt) + ",";
}
if (type.equals("deleteSql")) {
sqlSessionTemplate.delete(request.getParameter("deleteSql"), appt);
dataJson += JSON.toJSONString(appt) + ",";
}*/
}
if (dataJson != null) {
dataJson = dataJson.substring(0, dataJson.length() - 1);
dataJson = dataJson.substring(4, dataJson.length());
}
return dataJson;
}
@Transactional
public void saveGrid(JSONObject object, HttpServletResponse response, HttpServletRequest request) throws ClassNotFoundException, NoSuchMethodException {
// SpringApplicationContext.getBean(bean)
String[] needCols = CommonUtil.getNeedColsByJson(object, null);
Class objectClass = Class.forName(request.getParameter("className"));
List createList = CommonUtil.getBeanlist(object, "datatable", "create", objectClass);
List updateList = CommonUtil.getBeanlist(object, "datatable", "update", objectClass);
List destroyList = CommonUtil.getBeanlist(object, "datatable", "destroy", objectClass);
String dataJson = null;
String createReturn=forItem(createList, request, dataJson);
String updateReturn=forItem(updateList, request, dataJson);
bizDao.saveAll(createList);
bizDao.updateAll(updateList, needCols, "ID");
bizDao.deleteAll(destroyList, "ID");
//删除的就不返回了
//forItem(destroyList, "deleteSql", request, dataJson);
//拼JSON
if(createReturn!=null){
dataJson+="["+createReturn;
dataJson=dataJson.substring(4,dataJson.length());
}else{
dataJson+="[";
dataJson=dataJson.substring(4,dataJson.length());
}
if(updateReturn!=null&&createReturn!=null){
dataJson+=","+updateReturn+"]";
}else if (updateReturn!=null&&createReturn==null){
dataJson+=updateReturn+"]";
}else{
dataJson+="]";
}
if (object.has("keyword") && object.has("bizType")){
try {
LogParam logParam = new LogParam(object, object.getString("keyword"), object.getString("bizType"), null, "datatable");
logParam.setMenuName(objectClass.getSimpleName());
logParam.setCreate(createList);
logServcie.saveLogGrid(logParam, response);
} catch (IOException e) {
e.printStackTrace();
}
}
try {
WebUtil.send(response, dataJson);
} catch(IOException e) {
e.printStackTrace();
}
}
}

View File

@@ -0,0 +1,120 @@
package com.ag.dynamicmodule.common;
import cn.hutool.core.collection.CollectionUtil;
import com.ag.base.BaseService;
import com.ag.base.DefaultBussniessImpl;
import com.ag.entity.account.SerialConfig;
import com.ag.entity.account.SerialNo;
import com.ag.util.CommonUtil;
import com.ag.util.StrUtil;
import com.ag.util.TimeUtil;
import com.ag.util.UUIDUtil;
import com.wb.util.WebUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.Assert;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.util.Date;
import java.util.List;
/**
* Created by yangxh on 2019/11/16.
* 流水号生成支持3种模式调用
*/
@Service
public class SerialNoService extends BaseService {
@Autowired
private DefaultBussniessImpl bizDao;
/**
* 提供给wb页面使用
* @param json
* @param response
* @param request
* @throws IOException
*/
@Transactional
public void findSerialNo(org.json.JSONObject json, HttpServletResponse response, HttpServletRequest request) throws IOException {
String code = json.getString("serialCode");
//主工程获取发票号
if (StrUtil.isEmpty(code) && json.has("mainParams")){
code = json.getString("mainParams");
}
Assert.isTrue(!StrUtil.isEmpty(code), "获取流水号失败流水code为空");
String serialNo = findSerialNo(code, super.getTenancyId(request));
WebUtil.send(response, serialNo);
}
/**
* 提供给java使用
*/
@Transactional
public String findSerialNoForMain(org.json.JSONObject json, HttpServletResponse response, HttpServletRequest request) {
String code = json.getString("mainParams");
Assert.isTrue(!StrUtil.isEmpty(code), "获取流水号失败流水code为空");
return findSerialNo(code, null);
}
@Transactional
public synchronized String findSerialNo(String code, String tenancyId){
Integer num = 1;
String numStr = "";
SerialConfig entity = new SerialConfig();
entity.setCode(code);
entity.setTenancyId(tenancyId);
List<SerialConfig> configs = bizDao.findByEntity(entity, SerialConfig.class);
if (CollectionUtil.isEmpty(configs)){
throw new RuntimeException("无效的代码流水号【" + code + "");
}
SerialConfig config = configs.get(0);
if (config.getValidFlag() != 1){
throw new RuntimeException("代码流水号未启用【" + code + "");
}
SerialNo noSerialNo = new SerialNo();
noSerialNo.setConfigId(config.getId());
String sql = bizDao.getSelectByEntity(noSerialNo, false);
sql += " and DAY >= to_date('"+ TimeUtil.getDate()+"','yyyy-MM-dd HH24:MI:SS')";
SerialNo dayNum = (SerialNo) bizDao.get(sql, SerialNo.class);
if (dayNum == null){
noSerialNo.setId(UUIDUtil.getUUID());
noSerialNo.setDay(new Date());
noSerialNo.setCurrentNo(num);
bizDao.save(noSerialNo);
} else {
num = dayNum.getCurrentNo() + 1;
SerialNo updSerial = new SerialNo();
updSerial.setId(dayNum.getId());
updSerial.setCurrentNo(num);
updSerial.setDay(new Date());
bizDao.update(updSerial, "ID");
}
numStr = String.valueOf(num);
while(numStr.length() < config.getNumLength()){
numStr = "0" + numStr;
}
String dateFormat = TimeUtil.getDate("yyyyMMdd");
return StrUtil.join(config.getPrefix(), dateFormat, numStr, config.getPostfix());
}
@Transactional
public void save(org.json.JSONObject param, HttpServletResponse response, HttpServletRequest request){
List<SerialConfig> adds = CommonUtil.getBeanlist(param, "datatable", "create", SerialConfig.class);
List<SerialConfig> upds = CommonUtil.getBeanlist(param, "datatable", "update", SerialConfig.class);
List<SerialConfig> dels = CommonUtil.getBeanlist(param, "datatable", "destroy", SerialConfig.class);
String[] needCols = CommonUtil.getNeedColsByJson(param, null);
adds.forEach(x->{
super.setSaveUser(param, x);
x.setId(UUIDUtil.getUUID());
});
upds.forEach(x->super.setUpdateUser(param, x));
bizDao.saveAll(adds);
bizDao.updateAll(upds, needCols, "ID");
bizDao.deleteAll(dels, "ID");
}
}

View File

@@ -0,0 +1,570 @@
package com.ag.dynamicmodule.common;
import org.apache.commons.lang3.StringUtils;
import java.sql.Timestamp;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.time.LocalDate;
import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;
import java.util.Calendar;
import java.util.Date;
/**
* Created by Administrator on 2017/6/23 0023.
*/
public class TimeUtil {
public static String getDate() {
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
return sdf.format(new Date());
}
public static String getDate(Date date) {
if (date == null || "".equals(date)) {
return null;
}
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
return sdf.format(date);
}
public static String getSerDate() {
SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMdd");
return sdf.format(new Date());
}
public static String getSerDate(Date date) {
SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMdd");
return sdf.format(date);
}
public static String getTime() {
SimpleDateFormat sdf = new SimpleDateFormat("HH:mm:ss");
return sdf.format(new Date());
}
public static String getTime(Date dt) {
SimpleDateFormat sdf = new SimpleDateFormat("HH:mm:ss");
return sdf.format(dt);
}
/**
* Description: 处理时间
* @param dt
* Note: Nothing much.
*/
public static Date getMinute(Date dt){
SimpleDateFormat sdf=new SimpleDateFormat("HH:mm");
String strdt = sdf.format(dt);
try {
return sdf.parse(strdt);
} catch (ParseException e) {
e.printStackTrace();
}
return null;
}
/**
* Description: 处理时间
* @param hm
* Note: Nothing much.
*/
public static Date getMinute(String hm){
SimpleDateFormat sdf=new SimpleDateFormat("HH:mm");
try {
return sdf.parse(hm);
} catch (ParseException e) {
e.printStackTrace();
}
return null;
}
public static String getDateTime() {
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
return sdf.format(new Date());
}
public static String getDateTime(Date dt) {
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
return sdf.format(dt);
}
public static String getDateTimeSSS() {
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss SSS");
return sdf.format(new Date());
}
public static Date getTimestamp(String strDate) {
try {
return Timestamp.valueOf(strDate);
} catch (Exception e) {
e.printStackTrace();
return null;
}
}
/**
* 通过出生日期返回年龄
*/
public static Integer getAge(String DCsrq) throws Exception {
if (StringUtils.isEmpty(DCsrq)) {
return 0;
}
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
Date birthDay = sdf.parse(DCsrq);
Calendar cal = Calendar.getInstance();
if (cal.before(birthDay)) {
return 0;
/*throw new IllegalArgumentException(
"The birthDay is before Now.It's unbelievable!");*/
}
int yearNow = cal.get(Calendar.YEAR);
int monthNow = cal.get(Calendar.MONTH);
int dayOfMonthNow = cal.get(Calendar.DAY_OF_MONTH);
cal.setTime(birthDay);
int yearBirth = cal.get(Calendar.YEAR);
int monthBirth = cal.get(Calendar.MONTH);
int dayOfMonthBirth = cal.get(Calendar.DAY_OF_MONTH);
int age = yearNow - yearBirth;
if (monthNow <= monthBirth) {
if (monthNow == monthBirth) {
// monthNow==monthBirth
if (dayOfMonthNow < dayOfMonthBirth) {
age--;
} else {
// do nothing
}
} else {
// monthNow>monthBirth
age--;
}
} else {
// monthNow<monthBirth
// donothing
}
return age;
}
/**
* 通过年龄返回出生日期 月和日为当前日期
public static String getCsrq(String csrq, String ageStr) {
if (csrq != null && !"".equals(csrq)) {
return csrq;
}
if (ageStr == null || "".equals(ageStr)) {
return null;
}
int age = Integer.parseInt(ageStr);
if (age <= 0 && age > 100) {
return null;
} */
/*
* SimpleDateFormat sdf1 = new SimpleDateFormat("yyyy");
* SimpleDateFormat sdf2 = new SimpleDateFormat("-MM-dd"); int year_age
* = Integer.valueOf(sdf1.format(new Date())) - age; String md_age =
* sdf2.format(new Date());
*/
/**
SimpleDateFormat sdf1 = new SimpleDateFormat("yyyy");
int year_age = Integer.valueOf(sdf1.format(new Date())) - age;
return year_age + "-01-01";
}*/
/**
* 获取当前日期是星期几<br>
*
* @param dt
* @return 当前日期是星期几
*/
public static String getWeekOfDate(Date dt) {
String[] weekDays = { "星期日", "星期一", "星期二", "星期三", "星期四", "星期五", "星期六" };
Calendar cal = Calendar.getInstance();
cal.setTime(dt);
int w = cal.get(Calendar.DAY_OF_WEEK) - 1;
if (w < 0) {
w = 0;
}
return weekDays[w];
}
/**
* 返回当前日期的指定范围日期dt正数则为当前日期后几天负则为前几天
*
* @param dt
* @return
*/
@SuppressWarnings("static-access")
public static String getSomeDayOfToday(int dt) {
Calendar ca = Calendar.getInstance();
ca.add(Calendar.DAY_OF_MONTH, dt);
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
return sdf.format(ca.getTime());
}
/**
* 返回当前日期的指定范围日期,
*
* @param min 正数则为当前时间后几分钟,负则为前几分钟
* @return
*/
@SuppressWarnings("static-access")
public static Date getSomeTimeOfMinute(int min) {
Calendar ca = Calendar.getInstance();
ca.add(Calendar.MINUTE, min);
return ca.getTime();
/*SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
return sdf.format(ca.getTime());*/
}
/**
* 补齐日期类型
*/
public static String getFullYYMMDD(String date) {
if (null == date || "".equals(date)) {
return null;
}
Calendar ca = Calendar.getInstance();
int month = ca.get(Calendar.MONTH) + 1;
int day = ca.get(Calendar.DATE);
// 小于7位只取年
String rtnDate = "";
if (date.length() < 7) {
rtnDate = date.substring(0, 4) + "-" + String.valueOf(month) + "-"
+ String.valueOf(day);
} else if (date.length() < 10) {// 小于10位只取年月
rtnDate = date.substring(0, 4) + "-" + date.substring(5, 7) + "-"
+ String.valueOf(day);
} else {
rtnDate = date.substring(0, 4) + "-" + date.substring(5, 7) + "-"
+ date.substring(8, 10);
}
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
try {
return sdf.format(sdf.parse(rtnDate));
} catch (ParseException e) {
e.printStackTrace();
return null;
}
}
/**
* 获得当月第一天
*
* @param date
* @return
public static String getFirstDay() {
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM");
return sdf.format(new Date()).concat("-01");
}*/
/**
* 获得当月最后一天
*
public static String getLastDay() {
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM");
String yearAndMonth = sdf.format(new Date());
Integer days = getDays(yearAndMonth.split("-")[1],
yearAndMonth.split("-")[0]);
return yearAndMonth.concat("-" + days);
}*/
public static Integer getDays(String month, String year) {
String months1 = "01,03,05,07,08,10,12,";
String months2 = "04,06,09,11,";
if (months1.contains(month + ",")) {
return 31;
} else if (months2.contains(month + ",")) {
return 30;
} else {
if (0 == Integer.parseInt(year) % 4
&& 0 != Integer.parseInt(year) % 100) {
return 29;
} else {
return 28;
}
}
}
/**
* 给定时间前后i天
* @param date
* @return
*/
public static Date getTimeLaterDay(Date date, int i){
Calendar calendar = Calendar.getInstance();
calendar.setTime(date);
if (i < 0){
i = i + 1;
}
calendar.add(Calendar.DATE, i);
return calendar.getTime();
}
/**
* 给定时间加月份
* @param date
* @param month
* @return
*/
public static Date getTimeByAddMonth(Date date ,Integer month) {
Calendar calendar=Calendar.getInstance();
calendar.setTime(date);
calendar.add(Calendar.MONTH, month);
return new Timestamp(calendar.getTimeInMillis());
}
/**
* 返回yyMMdd格式
* @return
*/
public static String getDemandDate() {
SimpleDateFormat sdf = new SimpleDateFormat("yyMMdd");
return sdf.format(new Date());
}
/**
* 判断两个时间是否在差值范围内是返回true否返回false
* @param date1 时间小
* @param date1 时间大
* @param subdu 差值
* @return
*/
public static boolean getDValueByTime(Date date1, Date date2, int subdu){
long time1 = date1.getTime();
long time2 = date2.getTime();
if(time2 - time1 > subdu){
return false;
}else{
return true;
}
}
public static Date getDateFromString(String str) {
SimpleDateFormat sdf=new SimpleDateFormat("yyyy-MM-dd");
Date date = null;
try {
date=sdf.parse(str);
} catch (ParseException e) {
e.printStackTrace();
}
return date;
}
public static Date StrToDate(String s) {
SimpleDateFormat sdf=new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
try {
return sdf.parse(s);
} catch (ParseException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
return null;
}
public static Date getDateFromToday() {
SimpleDateFormat sdf=new SimpleDateFormat("yyyy-MM-dd");
Date date = null;
try {
date=sdf.parse(getDate());
} catch (ParseException e) {
e.printStackTrace();
}
return date;
}
public static int compareDate(String DATE1, String DATE2) {
if(DATE1 == null || DATE2 == null){
return 0;
}
SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd");
try {
Date dt1 = df.parse(DATE1);
Date dt2 = df.parse(DATE2);
if (dt1.getTime() > dt2.getTime()) {
return 1;
} else if (dt1.getTime() < dt2.getTime()) {
return -1;
} else {
return 0;
}
} catch (Exception exception) {
throw new RuntimeException("日期格式异常");
}
}
/**
*两时间比较日期差值堆存天当天返回0
* @param start
* @param end
* @return
*/
public static int compareDaysLimit(Date start, Date end){
long dayLong = 1000*60*60*24;
long dv = (getDayZero(end).getTime() - getDayZero(start).getTime()) / dayLong;
return (int)dv;
}
/**
* 两时间比较,日期差值,堆存小时,不满一小时=1小时
* @param start
* @param end
* @return
*/
public static int compareHoursLimit(Date start, Date end){
long hourLong = 1000*60*60;
long dv = (end.getTime() - start.getTime()) / hourLong;
return (int)dv + 1;
}
/**
* 两时间比较开始时间小于结束时间返回true
* @param start
* @param end
* @return
*/
public static boolean compareDate(Date start, Date end){
return (end.getTime() - start.getTime()) > 0;
}
/**
* 两个日期之间间隔天数
*
* @param isWork true: 包含工作日 false: 不包含工作日
*
* @return
*/
public static int workDays(String beginDATE, String endDATE, boolean isWork) {
if(beginDATE == null || endDATE == null){
return 0;
}
SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
try {
Date dt1 = df.parse(beginDATE);
Date dt2 = df.parse(endDATE);
int days = (int) ((dt2.getTime()-dt1.getTime())/(1000*60*60*24))+1;
if(isWork){
return days;
}else{
int weeks = days / 7;
int rs = 0;
// 整数周
if (days % 7 == 0) {
rs = days - 2 * weeks;
}
else {
Calendar begCalendar = Calendar.getInstance();
Calendar endCalendar = Calendar.getInstance();
begCalendar.setTime(dt1);
endCalendar.setTime(dt2);
// 周日为1周六为7
int beg = begCalendar.get(Calendar.DAY_OF_WEEK);
int end = endCalendar.get(Calendar.DAY_OF_WEEK);
if (beg > end) {
rs = days - 2 * (weeks + 1);
} else if (beg < end) {
if (end == 7) {
rs = days - 2 * weeks - 1;
} else {
rs = days - 2 * weeks;
}
} else {
if (beg == 1 || beg == 7) {
rs = days - 2 * weeks - 1;
} else {
rs = days - 2 * weeks;
}
}
}
return rs;
}
} catch (Exception exception) {
throw new RuntimeException("日期格式异常");
}
}
/**
* 变更字符串时间转换格式
*
* @param fromFormat 变换前的日期格式
* @param toFormat 变换后的日期格式
* @param date 符合fromFormat格式的日期字符串
*/
public static String changeFormat(String fromFormat, String toFormat, String date) {
SimpleDateFormat oldFormat=new SimpleDateFormat(fromFormat);
Date date1;
String newDate="";
try {
date1 = oldFormat.parse(date);
SimpleDateFormat newFormat=new SimpleDateFormat(toFormat);
newDate = newFormat.format(date1);
} catch (ParseException e) {
e.printStackTrace();
}
return newDate;
}
//获取时间的零点
public static Date getDayZero(Date date) {
Calendar calendar = Calendar.getInstance();
calendar.setTime(date);
calendar.set(Calendar.HOUR_OF_DAY, 0);
calendar.set(Calendar.MINUTE, 0);
calendar.set(Calendar.SECOND, 0);
return calendar.getTime();
}
/**
* 相差分钟
* @param beginTime
* @param endTime
* @return
*/
public static int differSecond(String beginTime, String endTime) {
if (StringUtils.isEmpty(beginTime) || StringUtils.isEmpty(endTime)) {
return 0;
}
SimpleDateFormat df = new SimpleDateFormat("HH:mm:ss");
try {
Date beginDate = df.parse(beginTime);
Date endDate = df.parse(endTime);
return (int) ((endDate.getTime()-beginDate.getTime())/(1000*60));
} catch (Exception exception) {
throw new RuntimeException("日期格式异常");
}
}
public static void main(String arg[]) {
// System.out.println(TimeUtil.getDValueByTime(TimeUtil.getDayBegin(),TimeUtil.getNowTimestamp(),0));
// System.out.println(TimeUtil.getDValueByTime(TimeUtil.getNowTimestamp(),TimeUtil.getDayBegin(),0));
//System.out.println(compareDate(Timestamp.valueOf("2017-07-09 15:26:07"), Timestamp.valueOf("2017-07-10 00:00:00")));
//System.out.println(toOrclDate(new Date()));
//System.out.println(TimeUtil.getDateTime(TimeUtil.getTimeLaterDay(new Date(), -2)));
// 取当前日期:
System.out.println(LocalDate.now());// -> 2014-12-24
// 根据年月日取日期12月就是12
//LocalDate crischristmas = LocalDate.of(2014,-25
// 根据字符串取: 12, 25); // -> 2014-12
System.out.println(LocalDate.parse("2018-02-01")); // 严格按照ISO yyyy-MM-dd验证02写成2都不行当然也有一个重载方法允许自己定义格式
System.out.println(LocalDateTime.now());
System.out.println(LocalDateTime.parse("2018-02-01 13:59:56", DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss")));
System.out.println(LocalDateTime.parse("2018-02-01T13:59:56").toString());
Integer one = 128,two = 128;
}
}

View File

@@ -0,0 +1,14 @@
package com.ag.dynamicmodule.main;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.ImportResource;
/**
* @author shaofq
* @version 2018.03.28 21:31
*/
@Configuration
@ImportResource("classpath:META-INF/spring/dynamciContext.xml")
public class Application {
}

View File

@@ -0,0 +1,40 @@
package com.ag.dynamicmodule.main;
import org.springframework.beans.BeansException;
import org.springframework.context.ApplicationContext;
import org.springframework.context.ApplicationContextAware;
import org.springframework.stereotype.Component;
/**
* Created by yangxh on 2019/8/12.
*/
@Component
public class HotApplicationContext implements ApplicationContextAware {
private static ApplicationContext appContext;
@Override
public void setApplicationContext(ApplicationContext applicationContext)
throws BeansException {
appContext = applicationContext;
}
public static Object getBean(String beanName) {
return appContext.getBean(beanName);
}
public static <T> Object getBean(Class<T> c) {
return appContext.getBean(c);
}
public static boolean isContainsMain(String beanName){
return appContext.containsBeanDefinition(beanName);
}
public static Boolean containsBean(String beanName){
return appContext.containsBean(beanName);
}
public static String[] findAllBeans(){
return appContext.getBeanDefinitionNames();
}
}

View File

@@ -0,0 +1,53 @@
package com.ag.dynamicmodule.service;
import com.ag.base.DefaultBussniessImpl;
import com.ag.dynamicmodule.main.HotApplicationContext;
import java.util.List;
/**
* 对象操作基类
* @author running
* @since 2020-11-09
*/
public class BaseEntiy {
/**
* 保存
*/
public void save() {
DefaultBussniessImpl defaultBussniess = (DefaultBussniessImpl) HotApplicationContext.getBean("defaultBussniessImpl");
defaultBussniess.save(this);
}
/**
* 删除
* 用法 delete( "CONTRACT_ID", "CATEGORY_ID", "ITEM_ID")可以定义多个参数
* @param colName
*/
public void delete(Object... colName) {
DefaultBussniessImpl defaultBussniess = (DefaultBussniessImpl) HotApplicationContext.getBean("defaultBussniessImpl");
defaultBussniess.delete(this, colName);
}
/**
* 查询
* 用法 queryList("ID","NAME","") 可以定义多个参数
* @param colName
*/
public List queryList( Object... colName) {
DefaultBussniessImpl defaultBussniess = (DefaultBussniessImpl) HotApplicationContext.getBean("defaultBussniessImpl");
return defaultBussniess.findByEqCriteria(this, this.getClass(), colName);
}
/**
* 更新
* 用法 update( "CONTRACT_ID", "CATEGORY_ID", "ITEM_ID")
* @param colName
*/
public void update(Object... colName) {
DefaultBussniessImpl defaultBussniess = (DefaultBussniessImpl) HotApplicationContext.getBean("defaultBussniessImpl");
defaultBussniess.update(this, colName);
}
}

View File

@@ -0,0 +1,47 @@
package com.ag.dynamicmodule.service;
import org.mybatis.spring.SqlSessionTemplate;
import java.lang.reflect.Proxy;
/**
* @description: 用于基本数据save构造
* @author: WangNan
* @create: 2019-04-10 16:20
*/
public class BaseMapperRepository {
private Object bean;
private SqlSessionTemplate sqlSessionTemplate;
private Object mapper;
private String myBatisNameSpace;
String getMyBatisNameSpace(){return myBatisNameSpace;}
Object getBean(){return this.bean;}
Object getMapper(){return this.mapper;}
SqlSessionTemplate getSqlSessionTemplate(){return this.sqlSessionTemplate;}
public BaseMapperRepository(Object bean, SqlSessionTemplate sqlSessionTemplate,
String myBatisNameSpace) {
this.bean = bean;
this.sqlSessionTemplate = sqlSessionTemplate;
this.myBatisNameSpace=myBatisNameSpace;
}
public BaseMapperRepository(Object bean, Object mapper) {
/**
* 必须是mybatis动态代理对象
*/
if (!Proxy.isProxyClass(mapper.getClass())){
throw new RuntimeException("Constructor Fail.... The second parameter must be the interface for Mybatis dynamic Proxy");
}
this.bean = bean;
this.mapper = mapper;
}
}

View File

@@ -0,0 +1,57 @@
package com.ag.dynamicmodule.service;
import org.mybatis.spring.SqlSessionTemplate;
import java.util.List;
/**
*
* @author WangN
* @date 2017/4/8
*
*/
public abstract class IBaseRepository {
private SqlSessionTemplate sqlSessionTemplate;
private List<?> beanList;
private String sqlType;
/**
* namespace+tag
*/
private String myBatisNameSpace;
public static final String INSERT="insert";
public static final String UPDATE="update";
public static final String DELETE="delete";
SqlSessionTemplate getSqlSessionTemplate() {
return sqlSessionTemplate;
}
List<?> beanList() {
return beanList;
}
public abstract Object mbtParams(Object bean,int index) throws Exception;
String sqlType() {
return sqlType;
}
String myBatisNameSpace() {
return myBatisNameSpace;
}
public IBaseRepository(SqlSessionTemplate sqlSessionTemplate,
List<?> beanList, String sqlType, String myBatisNameSpace) {
this.sqlSessionTemplate=sqlSessionTemplate;
this.beanList = beanList;
this.sqlType = sqlType;
this.myBatisNameSpace = myBatisNameSpace;
}
}

View File

@@ -0,0 +1,92 @@
package com.ag.dynamicmodule.service;
import javax.servlet.http.HttpServletRequest;
/**
* @description: 批处理封装 executeBatch,基本维护 save
* @author: WangNan
* @create: 2019-04-10 16:20
*/
public interface IBaseService {
/**
* 带id保存
* @param baseRepository
*/
Object savewithid(BaseMapperRepository baseRepository);
/**
* 造一个有ID,tenancyId,createdBy,createdOn,updatedBy,updatedOn的 对象
* 构造PojoBuilder的时候使用Class的方式构造
* @param pojoBuilder session构造
* @return
*/
Object buildObj(PojoBuilder pojoBuilder);
/**
* 给对象赋值ID,tenancyId,createdBy,createdOn,updatedBy,updatedOn
* 构造PojoBuilder的时候使用Object的方式构造
* @param pojoBuilder
* @return
*/
Object initObj(PojoBuilder pojoBuilder);
/**
* 反射赋值
* @param pojoBuilder
* @param isInit 是否初始化,TRUE的话就造一个ID,tenancyId
* @return
*/
Object invokeObj(PojoBuilder pojoBuilder, Boolean isInit);
/**
* mybatis批处理动态构造条件
* @param baseRepository
* @return
*/
String executeBatch(IBaseRepository baseRepository);
/**
* 普通表单保存方法:默认主键为:"id"
* @param baseRepository
*/
void save(BaseMapperRepository baseRepository);
/**
* 针对主键不是id的
* @param baseRepository
* @param primaryName
*/
void save(BaseMapperRepository baseRepository, String primaryName);
/**
* 普通表单新增
* @param baseRepository
*/
void insert(BaseMapperRepository baseRepository);
/**
* 普通表单新增自带id
* @param baseRepository
*/
void insertWithId(BaseMapperRepository baseRepository);
/**
* 普通表单修改
* @param baseRepository
*/
void update(BaseMapperRepository baseRepository);
/**
* 普通表单删除方法:默认主键为:"id"
* @param baseRepository
*/
void delete(BaseMapperRepository baseRepository);
void deleteBySomeone(BaseMapperRepository baseRepository, String someone);
/**
* 给bean赋值
* @param bean
* @param request
* @return
*/
Object setParameterValue(Object bean, HttpServletRequest request);
}

View File

@@ -0,0 +1,290 @@
package com.ag.dynamicmodule.service;
import com.ag.util.CommonUtil;
import com.ag.util.UUIDUtil;
import com.alibaba.fastjson.JSON;
import com.google.common.collect.Maps;
import com.wb.util.SysUtil;
import org.apache.commons.beanutils.BeanUtils;
import org.apache.commons.beanutils.PropertyUtils;
import org.apache.ibatis.session.ExecutorType;
import org.apache.ibatis.session.SqlSession;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Component;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.CollectionUtils;
import org.springframework.util.ObjectUtils;
import org.springframework.util.ReflectionUtils;
import org.springframework.util.StringUtils;
import javax.servlet.http.HttpServletRequest;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import java.util.Map;
import static com.google.common.base.Preconditions.checkNotNull;
/**
* @description: 批处理封装 executeBatch,基本维护 save
* @author: WangNan
* @create: 2019-04-10 16:20
*/
@Component
public class IBaseServiceImpl implements IBaseService {
private static final Logger LOGGER = LoggerFactory.getLogger(IBaseServiceImpl.class);
/**
* 一般表主键名称
*/
private final static String PRIMARY_KEY = "id";
/**
* mybatis 新增标签
*/
private final static String MYBATINS_INSERT_TAG = "insertSelective";
/**
* mybatis 修改标签
*/
private final static String MYBATINS_UPDATE_TAG = "updateByPrimaryKeySelective";
/**
* mybatis 删除标签
*/
private final static String MYBATINS_DELETE_TAG = "deleteByPrimaryKey";
/**
* 存放属性
*/
private Map<String, Object> invokeMap;
@Override
@Transactional
public String executeBatch(IBaseRepository baseRepository) {
SqlSession sqlsession = baseRepository.getSqlSessionTemplate().getSqlSessionFactory().openSession(ExecutorType.BATCH, false);
Object obj;
String dataJson = null;
if (!CollectionUtils.isEmpty(baseRepository.beanList())) {
try {
for (int i = 0; i < baseRepository.beanList().size(); i++) {
obj = baseRepository.beanList().get(i);
//这三个if一点都不冗余你给我找出第四种类型来
if (IBaseRepository.INSERT.equals(baseRepository.sqlType())) {
sqlsession.insert(baseRepository.myBatisNameSpace(), baseRepository.mbtParams(obj, i));
}
if (IBaseRepository.UPDATE.equals(baseRepository.sqlType())) {
sqlsession.update(baseRepository.myBatisNameSpace(), baseRepository.mbtParams(obj, i));
}
if (IBaseRepository.DELETE.equals(baseRepository.sqlType())) {
sqlsession.delete(baseRepository.myBatisNameSpace(), baseRepository.mbtParams(obj, i));
}
dataJson += JSON.toJSONString(obj) + ",";
if (i % 1000 == 0 || i == baseRepository.beanList().size() - 1) {
//会回滚
sqlsession.commit();
sqlsession.clearCache();
}
}
} catch (Exception e) {
e.printStackTrace();
sqlsession.rollback();
LOGGER.error(e.getMessage());
throw new RuntimeException(e.getCause());
} finally {
sqlsession.close();
}
}
if (dataJson != null) {
dataJson = dataJson.substring(0, dataJson.length() - 1);
dataJson = dataJson.substring(4);
}
return dataJson;
}
@Override
public Object buildObj(PojoBuilder pojoBuilder) {
Object obj = null;
try {
pojoBuilder.setBaseObj(Class.forName((pojoBuilder.getBaseClass() == null ? pojoBuilder.getBaseObj().getClass() :
pojoBuilder.getBaseClass()).getName()).newInstance());
obj = this.invokeObj(pojoBuilder, Boolean.TRUE);
} catch (Exception e) {
LOGGER.error(e.getLocalizedMessage());
}
return obj;
}
@Override
public Object initObj(PojoBuilder pojoBuilder) {
checkNotNull(pojoBuilder.getBaseObj(), "pojoBuilder's baseObj can not be null when initObj....");
return this.invokeObj(pojoBuilder, Boolean.TRUE);
}
@Override
public Object invokeObj(PojoBuilder pojoBuilder, Boolean isInit) {
checkNotNull(pojoBuilder.getBaseObj(), "pojoBuilder's baseObj can not be null when invoke....");
invokeMap = Maps.newConcurrentMap();
if (isInit) {
invokeMap.put("id", SysUtil.getId());
}
try {
for (Map.Entry<String, Object> entry : invokeMap.entrySet()) {
PropertyUtils.setProperty(pojoBuilder.getBaseObj(), entry.getKey(), entry.getValue());
}
} catch (Exception e) {
LOGGER.error(e.getLocalizedMessage());
throw new RuntimeException("Fail to invokeObj ........ in" + this.getClass().getName());
}
return pojoBuilder.getBaseObj();
}
@Override
public void save(BaseMapperRepository baseRepository) {
this.saveMethod(baseRepository, null);
}
@Override
public void save(BaseMapperRepository baseRepository, String primaryName) {
this.saveMethod(baseRepository, primaryName);
}
@Override
public Object savewithid(BaseMapperRepository baseRepository) {
return this.saveMethodwithid(baseRepository, null);
}
@Transactional
Object saveMethodwithid(BaseMapperRepository baseRepository, String primaryName) {
Object bean = null;
try {
if (StringUtils.isEmpty(PropertyUtils.getProperty(baseRepository.getBean(), StringUtils.isEmpty(primaryName) ? PRIMARY_KEY : primaryName))) {
bean = this.insertByInvokereturnId(baseRepository);
} else {
this.updateByInvoke(baseRepository);
// bean=null;
}
return bean;
} catch (Exception e) {
throw new RuntimeException(e.getCause());
}
}
private Object insertByInvokereturnId(BaseMapperRepository baseRepository) {
this.invokeObj(new PojoBuilder(baseRepository.getBean()), Boolean.TRUE);
if (ObjectUtils.isEmpty(baseRepository.getMapper())) {
baseRepository.getSqlSessionTemplate().insert(baseRepository.getMyBatisNameSpace() + "." + MYBATINS_INSERT_TAG,
baseRepository.getBean());
} else {
this.invokeMethod(baseRepository, MYBATINS_INSERT_TAG);
}
return baseRepository.getBean();
}
@Override
public void insert(BaseMapperRepository baseRepository) {
this.insertByInvoke(baseRepository);
}
@Override
public void insertWithId(BaseMapperRepository baseRepository) {
this.insertByInvokeWithId(baseRepository);
}
@Override
public void update(BaseMapperRepository baseRepository) {
this.updateByInvoke(baseRepository);
}
@Override
public void delete(BaseMapperRepository baseRepository) {
this.deleteByInvoke(baseRepository);
}
@Override
public void deleteBySomeone(BaseMapperRepository baseRepository, String someone) {
this.deleteByInvokeSomeone(baseRepository, someone);
}
@Override
public Object setParameterValue(Object bean, HttpServletRequest request) {
try {
if (StringUtils.isEmpty(BeanUtils.getProperty(bean, "id"))) {
BeanUtils.setProperty(bean, "createdBy", request.getSession().getAttribute("sys.username"));
BeanUtils.setProperty(bean, "createdOn", CommonUtil.getNowDate());
BeanUtils.setProperty(bean, "id", UUIDUtil.getUUID());
}
BeanUtils.setProperty(bean, "updatedBy", request.getSession().getAttribute("sys.username"));
BeanUtils.setProperty(bean, "updatedOn", CommonUtil.getNowDate());
} catch (IllegalAccessException e) {
e.printStackTrace();
} catch (InvocationTargetException e) {
e.printStackTrace();
} catch (NoSuchMethodException e) {
e.printStackTrace();
}
return bean;
}
@Transactional
void saveMethod(BaseMapperRepository baseRepository, String primaryName) {
try {
if (StringUtils.isEmpty(PropertyUtils.getProperty(baseRepository.getBean(), StringUtils.isEmpty(primaryName) ? PRIMARY_KEY : primaryName))) {
this.insertByInvoke(baseRepository);
} else {
this.updateByInvoke(baseRepository);
}
} catch (Exception e) {
throw new RuntimeException(e.getCause());
}
}
private void insertByInvoke(BaseMapperRepository baseRepository) {
this.invokeObj(new PojoBuilder(baseRepository.getBean()), Boolean.TRUE);
if (ObjectUtils.isEmpty(baseRepository.getMapper())) {
baseRepository.getSqlSessionTemplate().insert(baseRepository.getMyBatisNameSpace() + "." + MYBATINS_INSERT_TAG,
baseRepository.getBean());
} else {
this.invokeMethod(baseRepository, MYBATINS_INSERT_TAG);
}
}
private void insertByInvokeWithId(BaseMapperRepository baseRepository) {
this.invokeObj(new PojoBuilder(baseRepository.getBean()), Boolean.FALSE);
if (ObjectUtils.isEmpty(baseRepository.getMapper())) {
baseRepository.getSqlSessionTemplate().insert(baseRepository.getMyBatisNameSpace() + "." + MYBATINS_INSERT_TAG,
baseRepository.getBean());
} else {
this.invokeMethod(baseRepository, MYBATINS_INSERT_TAG);
}
}
private void updateByInvoke(BaseMapperRepository baseRepository) {
this.invokeObj(new PojoBuilder(baseRepository.getBean()), Boolean.FALSE);
if (ObjectUtils.isEmpty(baseRepository.getMapper())) {
baseRepository.getSqlSessionTemplate().update(baseRepository.getMyBatisNameSpace() + "." + MYBATINS_UPDATE_TAG,
baseRepository.getBean());
} else {
this.invokeMethod(baseRepository, MYBATINS_UPDATE_TAG);
}
}
private void deleteByInvoke(BaseMapperRepository baseRepository) {
if (ObjectUtils.isEmpty(baseRepository.getMapper())) {
baseRepository.getSqlSessionTemplate().delete(baseRepository.getMyBatisNameSpace() + "." + MYBATINS_DELETE_TAG,
baseRepository.getBean());
}
}
private void deleteByInvokeSomeone(BaseMapperRepository baseRepository, String someone) {
if (ObjectUtils.isEmpty(baseRepository.getMapper())) {
baseRepository.getSqlSessionTemplate().delete(baseRepository.getMyBatisNameSpace() + "." + someone,
baseRepository.getBean());
}
}
private void invokeMethod(BaseMapperRepository baseRepository, String methodName) {
Method m = ReflectionUtils.findMethod(baseRepository.getMapper().getClass(),
methodName, baseRepository.getBean().getClass());
ReflectionUtils.invokeMethod(m, baseRepository.getMapper(), baseRepository.getBean());
}
}

View File

@@ -0,0 +1,41 @@
package com.ag.dynamicmodule.service;
import com.ag.base.ISerializable;
/**
* @description: pojo类生成器
* @author: WangN
* @create: 2019-07-12
*/
public class PojoBuilder<T> implements ISerializable {
private Object baseObj;
private Class<T> baseClass;
public PojoBuilder(Class<T> baseClass) {
this.baseClass = baseClass;
}
public PojoBuilder(Object baseObj) {
this.baseObj = baseObj;
}
public Object getBaseObj() {
return baseObj;
}
public void setBaseObj(Object baseObj) {
this.baseObj = baseObj;
}
public Class<T> getBaseClass() {
return baseClass;
}
public void setBaseClass(Class<T> baseClass) {
this.baseClass = baseClass;
}
}

View File

@@ -0,0 +1,46 @@
package com.ag.dynamicmodule.util;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.BeanWrapper;
import org.springframework.beans.BeanWrapperImpl;
import java.util.HashSet;
import java.util.Set;
/**
* Description:解决空赋值问题
* Author: wangll
* Version: 1.0
* Create Date: 2020/3/30 0030
*/
public class CopyUtils {
/**
* Description: 去除空值
* @param source
* @return Note: Nothing much.
*/
public static String[] getNullPropertyNames (Object source) {
final BeanWrapper src = new BeanWrapperImpl(source);
java.beans.PropertyDescriptor[] pds = src.getPropertyDescriptors();
Set<String> emptyNames = new HashSet<String>();
for(java.beans.PropertyDescriptor pd : pds) {
Object srcValue = src.getPropertyValue(pd.getName());
if (srcValue == null){
emptyNames.add(pd.getName());
}
}
String[] result = new String[emptyNames.size()];
return emptyNames.toArray(result);
}
/**
* Description: 复制属性去掉空的值
* @param src
* @param target
* @return Note: Nothing much.
*/
public static void copyProperties(Object src, Object target) {
BeanUtils.copyProperties(src, target, getNullPropertyNames(src));
}
}

View File

@@ -0,0 +1,126 @@
package com.ag.dynamicmodule.util;
import net.sourceforge.pinyin4j.PinyinHelper;
import net.sourceforge.pinyin4j.format.HanyuPinyinCaseType;
import net.sourceforge.pinyin4j.format.HanyuPinyinOutputFormat;
import net.sourceforge.pinyin4j.format.HanyuPinyinToneType;
import net.sourceforge.pinyin4j.format.HanyuPinyinVCharType;
import net.sourceforge.pinyin4j.format.exception.BadHanyuPinyinOutputFormatCombination;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
/**
* 字符串转换为拼音工具类
*
* @projectName: PinyinDome
*/
public class PinyinUtils {
/**
* 获得汉语拼音首字母
* @param chines
* 汉字
* @return
*/
public static String getAlpha(String chines) {
chines = cleanChar(chines);
String pinyinName = "";
char[] nameChar = chines.toCharArray();
HanyuPinyinOutputFormat defaultFormat = new HanyuPinyinOutputFormat();
defaultFormat.setCaseType(HanyuPinyinCaseType.UPPERCASE);
defaultFormat.setToneType(HanyuPinyinToneType.WITHOUT_TONE);
for (int i = 0; i < nameChar.length; i++) {
if (nameChar[i] > 128) {
try {
pinyinName += PinyinHelper.toHanyuPinyinStringArray(nameChar[i], defaultFormat)[0].charAt(0);
} catch (BadHanyuPinyinOutputFormatCombination e) {
e.printStackTrace();
}
} else {
pinyinName += nameChar[i];
}
}
return pinyinName;
}
/**
* 将字符串中的中文转化为拼音,英文字符不变
*
* @param inputString
* 汉字
* @return
*/
public static String getPingYin(String inputString) {
inputString = cleanChar(inputString);
HanyuPinyinOutputFormat format = new HanyuPinyinOutputFormat();
format.setCaseType(HanyuPinyinCaseType.LOWERCASE);
format.setToneType(HanyuPinyinToneType.WITHOUT_TONE);
format.setVCharType(HanyuPinyinVCharType.WITH_V);
String output = "";
if (inputString != null && inputString.length() > 0 && !"null".equals(inputString)) {
char[] input = inputString.trim().toCharArray();
try {
for (int i = 0; i < input.length; i++) {
if (Character.toString(input[i]).matches("[\\u4E00-\\u9FA5]+")) {
String[] temp = PinyinHelper.toHanyuPinyinStringArray(input[i], format);
output += temp[0];
} else
output += Character.toString(input[i]);
}
} catch (BadHanyuPinyinOutputFormatCombination e) {
e.printStackTrace();
}
} else {
return "*";
}
return output;
}
/**
* 汉字转换位汉语拼音首字母,英文字符不变
*
* @param chines
* 汉字
* @return 拼音
*/
public static String converterToFirstSpell(String chines) {
chines = cleanChar(chines);
String pinyinName = "";
char[] nameChar = chines.toCharArray();
HanyuPinyinOutputFormat defaultFormat = new HanyuPinyinOutputFormat();
defaultFormat.setCaseType(HanyuPinyinCaseType.UPPERCASE);
defaultFormat.setToneType(HanyuPinyinToneType.WITHOUT_TONE);
for (int i = 0; i < nameChar.length; i++) {
if (nameChar[i] > 128) {
try {
pinyinName += PinyinHelper.toHanyuPinyinStringArray(nameChar[i], defaultFormat)[0].charAt(0);
} catch (BadHanyuPinyinOutputFormatCombination e) {
e.printStackTrace();
}
} else {
pinyinName += nameChar[i];
}
}
return pinyinName;
}
/**
* 清理特殊字符以便得到
* @param chines
* @return
*/
public static String cleanChar(String chines) {
chines = chines.replaceAll("[\\p{Punct}\\p{Space}]+", ""); // 正则去掉所有字符操作
// 正则表达式去掉所有中文的特殊符号
String regEx = "[`~!@#$%^&*()+=|{}':;',\\[\\].<>/?~@#¥%……&*()——+|{}<>《》【】‘;:”“’。,、?]";
Pattern pattern = Pattern.compile(regEx);
Matcher matcher = pattern.matcher(chines);
chines = matcher.replaceAll("").trim();
return chines;
}
public static void main(String[] args) {
System.out.println(PinyinUtils.getAlpha("中文9"));
}
}

View File

@@ -0,0 +1,49 @@
package com.ag.dynamicmodule.wbgrid.domain;
import cn.hutool.core.collection.CollectionUtil;
import cn.hutool.core.util.ObjectUtil;
import com.ag.base.DefaultBussniessImpl;
import com.ag.entity.webbuiler.WbDeptPerm;
import com.ag.util.UUIDUtil;
import com.alibaba.fastjson.JSON;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.util.List;
/**
* Created by yangxh on 2022/6/20.
*/
@Service
public class WbDataPermService {
@Autowired
private DefaultBussniessImpl bizDao;
public void save(org.json.JSONObject object, HttpServletResponse response, HttpServletRequest request){
String data = object.getString("data");
System.out.println(data);
List<WbDeptPerm> perms = JSON.parseArray(data, WbDeptPerm.class);
if (CollectionUtil.isEmpty(perms)){
return;
}
WbDeptPerm query = new WbDeptPerm();
query.setDeptId(perms.get(0).getDeptId());
List<WbDeptPerm> finds = bizDao.findByEntity(query, WbDeptPerm.class);
perms.removeIf(x->isEqual(x, finds));
perms.forEach(x->x.setId(UUIDUtil.getUUID()));
bizDao.saveAll(perms);
}
private boolean isEqual(WbDeptPerm perm, List<WbDeptPerm> finds){
for (WbDeptPerm find : finds){
if (ObjectUtil.equal(perm.getDataDeptId(), find.getDataDeptId())){
return true;
}
}
return false;
}
}

View File

@@ -0,0 +1,67 @@
package com.ag.dynamicmodule.wbgrid.domain;
import com.ag.dynamicmodule.service.BaseMapperRepository;
import com.ag.dynamicmodule.service.IBaseServiceImpl;
import com.ag.dynamicmodule.wbgrid.pojo.WbResource;
import org.mybatis.spring.SqlSessionTemplate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
/**
* Description:
* Author: wangll
* Version: 1.0
* Create Date: 2020-11-12 11:26:34
*/
@Service
public class WbResourceBO {
@Autowired
SqlSessionTemplate sqlSessionTemplate;
@Autowired
private IBaseServiceImpl baseService;
/**
* Description: 新增和修改
* @param wbResource
* @return
* Note: Nothing much.
*/
public void save(WbResource wbResource){
baseService.save(new BaseMapperRepository(wbResource,sqlSessionTemplate,
"resources/platform/wbgrid.WbResourceMapper"));
}
/**
* Description: 新增
* @param wbResource
* @return
* Note: Nothing much.
*/
public void insert(WbResource wbResource){
baseService.insert(new BaseMapperRepository(wbResource,sqlSessionTemplate,
"resources/platform/wbgrid.WbResourceMapper"));
}
/**
* Description: 修改
* @param wbResource
* @return
* Note: Nothing much.
*/
public void update(WbResource wbResource){
baseService.update(new BaseMapperRepository(wbResource,sqlSessionTemplate,
"resources/platform/wbgrid.WbResourceMapper"));
}
/**
* Description: 删除
* @param id
* @return
* Note: Nothing much.
*/
public void delete(String id){
baseService.delete(new BaseMapperRepository(id,sqlSessionTemplate,
"resources/platform/wbgrid.WbResourceMapper"));
}
}

View File

@@ -0,0 +1,69 @@
package com.ag.dynamicmodule.wbgrid.domain;
import com.ag.dynamicmodule.service.IBaseServiceImpl;
import com.ag.dynamicmodule.wbgrid.pojo.WbResource;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray;
import com.wb.util.WebUtil;
import org.json.JSONObject;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import org.springframework.transaction.annotation.Transactional;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.io.UnsupportedEncodingException;
import java.util.List;
/**
* Description: 表格定制
* Author: running
* Version: 1.0
* Create Date: 2020-11-12 10:40:09
*/
@Component
public class WbgridService {
@Autowired
private IBaseServiceImpl baseService;
@Autowired
private WbResourceBO wbResourceBO;
/**
* Description: 表格定制保存
*
* @param object
* @param response
* @param request
* @return Note: Nothing much.
*/
@Transactional(rollbackFor = Exception.class)
public void saveResourceinfo(JSONObject object, HttpServletResponse response, HttpServletRequest request) throws UnsupportedEncodingException {
String dataarr = object.getString("dataArray");
WbResource wbResource = new WbResource();
wbResource.setResContent(dataarr.getBytes("UTF-8"));
wbResource.setResId(object.getString("name") + "@" + request.getSession().getAttribute("sys.user"));
List<WbResource> datalit = wbResource.queryList("RES_ID");
if (datalit.size() == 0) {
wbResourceBO.save(wbResource);
} else {
wbResource.delete("RES_ID");
wbResourceBO.save(wbResource);
}
try {
String reJson = JSON.toJSONString(null);
WebUtil.send(response, null);
} catch (IOException e) {
e.printStackTrace();
}
}
}

View File

@@ -0,0 +1,113 @@
package com.ag.dynamicmodule.wbgrid.pojo;
import com.ag.dynamicmodule.service.BaseEntiy;
import java.io.Serializable;
public class WbResource extends BaseEntiy implements Serializable {
/**
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column AG_SECP_SHHH.WB_RESOURCE.RES_ID
*
* @mbg.generated
*/
private String resId;
/**
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column AG_SECP_SHHH.WB_RESOURCE.ID
*
* @mbg.generated
*/
private String id;
/**
*
* This field was generated by MyBatis Generator.
* This field corresponds to the database column AG_SECP_SHHH.WB_RESOURCE.RES_CONTENT
*
* @mbg.generated
*/
private byte[] resContent;
/**
* This field was generated by MyBatis Generator.
* This field corresponds to the database table AG_SECP_SHHH.WB_RESOURCE
*
* @mbg.generated
*/
private static final long serialVersionUID = 1L;
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column AG_SECP_SHHH.WB_RESOURCE.RES_ID
*
* @return the value of AG_SECP_SHHH.WB_RESOURCE.RES_ID
*
* @mbg.generated
*/
public String getResId() {
return resId;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column AG_SECP_SHHH.WB_RESOURCE.RES_ID
*
* @param resId the value for AG_SECP_SHHH.WB_RESOURCE.RES_ID
*
* @mbg.generated
*/
public void setResId(String resId) {
this.resId = resId == null ? null : resId.trim();
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column AG_SECP_SHHH.WB_RESOURCE.ID
*
* @return the value of AG_SECP_SHHH.WB_RESOURCE.ID
*
* @mbg.generated
*/
public String getId() {
return id;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column AG_SECP_SHHH.WB_RESOURCE.ID
*
* @param id the value for AG_SECP_SHHH.WB_RESOURCE.ID
*
* @mbg.generated
*/
public void setId(String id) {
this.id = id == null ? null : id.trim();
}
/**
* This method was generated by MyBatis Generator.
* This method returns the value of the database column AG_SECP_SHHH.WB_RESOURCE.RES_CONTENT
*
* @return the value of AG_SECP_SHHH.WB_RESOURCE.RES_CONTENT
*
* @mbg.generated
*/
public byte[] getResContent() {
return resContent;
}
/**
* This method was generated by MyBatis Generator.
* This method sets the value of the database column AG_SECP_SHHH.WB_RESOURCE.RES_CONTENT
*
* @param resContent the value for AG_SECP_SHHH.WB_RESOURCE.RES_CONTENT
*
* @mbg.generated
*/
public void setResContent(byte[] resContent) {
this.resContent = resContent;
}
}

View File

@@ -0,0 +1,15 @@
package com.ag.learn;
import org.json.JSONObject;
import org.springframework.stereotype.Component;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
@Component
public class Test2Service {
public void test(JSONObject object, HttpServletResponse response, HttpServletRequest request){
System.out.println("Hello world");
}
}

View File

@@ -0,0 +1,427 @@
package com.ag.log;
import cn.hutool.core.collection.CollUtil;
import cn.hutool.core.convert.Convert;
import cn.hutool.core.date.DateUtil;
import cn.hutool.core.lang.Assert;
import cn.hutool.core.map.MapUtil;
import cn.hutool.core.util.ObjectUtil;
import com.ag.base.BaseService;
import com.ag.base.DefaultBussniessImpl;
import com.ag.base.IRedisService;
import com.ag.entity.log.DefineLogConfig;
import com.ag.log.entity.LogParam;
import com.ag.log.entity.OperLog;
import com.ag.log.entity.OperLogMain;
import com.ag.util.StrUtil;
import com.ag.util.UUIDUtil;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.wb.util.WebUtil;
import lombok.extern.log4j.Log4j;
import org.json.JSONTokener;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.io.Serializable;
import java.lang.reflect.Field;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.Map;
/**
* Created by yangxh on 2022/3/9.
*/
@Service
@Log4j
public class OperLogServcie extends BaseService {
@Autowired
private DefaultBussniessImpl bizDao;
@Autowired
private IRedisService redis;
/**
* 公共保存方法的日志记录
* @param logParam
* @param response
* @throws IOException
*/
@Transactional
public void saveLogCommon(LogParam logParam, HttpServletResponse response) throws IOException {
try {
saveLogGrid(logParam, "common");
} catch (Exception ex) {
log.error(ex.getMessage());
WebUtil.send(response, "日志记录异常!");
}
}
/**
* grid页面数据日志保存同时支持新增和删除=后台数据的日志保存wb控件参数可为空
* @param logParam
* @param response
* @throws IOException
*/
@Transactional
public void saveLogGrid(LogParam logParam, HttpServletResponse response) throws IOException {
try {
saveLogGrid(logParam, "grid");
} catch (Exception ex) {
log.error(ex.getMessage());
WebUtil.send(response, "日志记录异常!");
}
}
public void saveLogGrid(LogParam logParam, String sourceType) {
org.json.JSONObject reqParam = logParam.getReqParam();
JSONArray createArray = new JSONArray();
JSONArray updateArray = new JSONArray();
JSONArray deleteArray = new JSONArray();
if (!StrUtil.isEmpty(logParam.getWbName())){
JSONObject datatable = JSON.parseArray(reqParam.getString(logParam.getWbName())).getJSONObject(0);
createArray = JSON.parseArray(datatable.getString("create"));
updateArray = JSON.parseArray(datatable.getString("update"));
deleteArray = JSON.parseArray(datatable.getString("destroy"));
}
if (CollUtil.isNotEmpty(logParam.getCreate())) {
createArray = JSON.parseArray(JSON.toJSONString(logParam.getCreate()));
}
if (CollUtil.isNotEmpty(logParam.getDestroy())) {
deleteArray = JSON.parseArray(JSON.toJSONString(logParam.getDestroy()));
}
OperLogMain logMain = new OperLogMain();
List<OperLog> creates = new ArrayList<>();
List<OperLog> updates = new ArrayList<>();
List<OperLog> deletes = new ArrayList<>();
super.setSaveUser(reqParam, logMain);
logMain.setId(UUIDUtil.getUUID());
logMain.setIp(super.getUserIpAddress(reqParam));
logMain.setBizType(logParam.getBizType());
logMain.setKeyword(logParam.getKeyword());
logMain.setSourceType(sourceType);
logMain.setMenuName(logParam.getMenuName());
DefineLogConfig query = new DefineLogConfig();
query.setBizType(logParam.getBizType());
List<DefineLogConfig> configs = bizDao.findByEntity(query, DefineLogConfig.class, false);
logParam.setCudType("C");
executeSaveOrDel(createArray, creates, configs, logParam);
executeUpdate(updateArray, updates, configs, logParam);
logParam.setCudType("D");
executeSaveOrDel(deleteArray, deletes, configs, logParam);
creates.forEach(x -> x.setMainId(logMain.getId()));
updates.forEach(x -> x.setMainId(logMain.getId()));
deletes.forEach(x -> x.setMainId(logMain.getId()));
bizDao.save(logMain);
bizDao.saveAll(creates);
bizDao.saveAll(updates);
bizDao.saveAll(deletes);
}
/**
* panel页面数据日志保存同时支持修改前数据=后台数据的日志保存wb控件参数不能为空
* @param logParam
* @param response
* @throws IOException
*/
@Transactional
public void saveLogPanel(LogParam logParam, HttpServletResponse response) throws IOException {
try {
saveLogPanel(logParam);
} catch (Exception ex) {
log.error(ex.getMessage());
WebUtil.send(response, "日志记录异常!");
}
}
public void saveLogPanel(LogParam logParam) {
org.json.JSONObject reqParam = logParam.getReqParam();
Assert.isTrue(StrUtil.isNotEmpty(logParam.getWbName()), "panel日志保存wb组件名称不可为空");
String reqStr = reqParam.getString(logParam.getWbName());
JSONArray array = new JSONArray();
if (checkJSONArray(reqStr)) {
array = JSON.parseArray(reqStr);
} else {
JSONObject data = JSON.parseObject(reqStr);
array.add(data);
if (!StrUtil.isEmpty(logParam.getCreateDataId())) {
data.put(logParam.getPrimaryKeyColName(), logParam.getCreateDataId());
}
}
OperLogMain logMain = new OperLogMain();
List<OperLog> operLogs = new ArrayList<>();
super.setSaveUser(reqParam, logMain);
logMain.setId(UUIDUtil.getUUID());
logMain.setIp(super.getUserIpAddress(reqParam));
logMain.setBizType(logParam.getBizType());
logMain.setKeyword(logParam.getKeyword());
logMain.setSourceType("panel");
logMain.setMenuName(logParam.getMenuName());
DefineLogConfig query = new DefineLogConfig();
query.setBizType(logParam.getBizType());
List<DefineLogConfig> configs = bizDao.findByEntity(query, DefineLogConfig.class, false);
if (ObjectUtil.equal("U", logParam.getCudType())) {
//修改panel补充原始数据
mergeUpdateBean(logParam, array);
executeUpdate(array, operLogs, configs, logParam);
} else {
executeSaveOrDel(array, operLogs, configs, logParam);
}
//无修改数据不记录
if (CollUtil.isEmpty(operLogs)) {
return;
}
operLogs.forEach(x -> {
x.setMainId(logMain.getId());
x.setBizType(logMain.getBizType());
super.setSaveUser(reqParam, x);
});
bizDao.save(logMain);
bizDao.saveAll(operLogs);
}
private void executeSaveOrDel(JSONArray createArray, List<OperLog> creates, List<DefineLogConfig> configs, LogParam logParam) {
//对象循环
for (int i = 0; i < createArray.size(); i++) {
JSONObject create = createArray.getJSONObject(i);
OperLog operLog = new OperLog();
creates.add(operLog);
operLog.setId(UUIDUtil.getUUID());
operLog.setCudType(logParam.getCudType());
String changeKey = "", changeVal = "";
//属性循环
for (Map.Entry entry : create.entrySet()) {
String key = Convert.toStr(entry.getKey());
String val = Convert.toStr(entry.getValue());
if (key.startsWith("#")) {
continue;
}
if (key.startsWith("sys.")) {
continue;
}
//key不是列名大写将驼峰改大写
if (!StrUtil.equals(key, key.toUpperCase())) {
key = StrUtil.toUpperCol(key);
}
//保存业务id
if (ObjectUtil.equal(key, logParam.getPrimaryKeyColName())) {
operLog.setBizId(val);
}
if (!StrUtil.isEmpty(val)) {
changeKey = StrUtil.join(changeKey, key, ":[", val, "],");
//配置表
for (DefineLogConfig config : configs) {
if (ObjectUtil.equal(config.getBizCol(), key)) {
changeVal = StrUtil.join(changeVal, config.getMenuName(), ":");
//keyname转换
if (!StrUtil.isEmpty(config.getKeywordCol())) {
if (!StrUtil.isEmpty(val)) {
val = redis.getTargetName(config.getKeywordCol(), val);
} else {
val = "''";
}
}
changeVal = StrUtil.join(changeVal, val, ",");
break;
}
}
}
}
if (changeKey.length() > 2000) {
changeKey = changeKey.substring(0, 2000);
}
if (changeVal.length() > 2000) {
changeVal = changeVal.substring(0, 2000);
}
operLog.setChangeKey(changeKey);
operLog.setChangeVal(changeVal);
}
}
private void executeUpdate(JSONArray updateArray, List<OperLog> updates, List<DefineLogConfig> configs, LogParam logParam) {
//对象循环
for (int i = 0; i < updateArray.size(); i++) {
JSONObject update = updateArray.getJSONObject(i);
OperLog operLog = new OperLog();
operLog.setId(UUIDUtil.getUUID());
operLog.setCudType("U");
String changeKey = "", changeVal = "";
//属性循环
for (Map.Entry entry : update.entrySet()) {
String key = Convert.toStr(entry.getKey());
String val = Convert.toStr(entry.getValue());
//保存业务id
if (ObjectUtil.equal(key.toUpperCase(), logParam.getPrimaryKeyColName())) {
operLog.setBizId(val);
}
//只保存有变更的值
if (!key.startsWith("#")) {
continue;
}
key = key.substring(1, key.length());
String newVal = update.getString(key);
//只保存有变更的值
if (ObjectUtil.equal(val, newVal)) {
continue;
}
if (StrUtil.isEmpty(val) && StrUtil.isEmpty(newVal)){
continue;
}
/*if (StrUtil.isEmpty(val)) {
continue;
}*/
if (StrUtil.isEmpty(val)){
changeKey = StrUtil.join(changeKey, key, ":[null->");
}else{
changeKey = StrUtil.join(changeKey, key, ":[", val, "->");
}
if (StrUtil.isEmpty(newVal)){
changeKey = StrUtil.join(changeKey, "null],");
}else {
changeKey = StrUtil.join(changeKey, newVal, "],");
}
// changeKey = StrUtil.join(changeKey, key, ":[", val, "->", newVal, "],");
for (DefineLogConfig config : configs) {
if (ObjectUtil.equal(config.getBizCol(), key)) {
changeVal = StrUtil.join(changeVal, config.getMenuName());
//keyname转换
if (!StrUtil.isEmpty(config.getKeywordCol())) {
if (!StrUtil.isEmpty(val)) {
val = redis.getTargetName(config.getKeywordCol(), val);
} else {
val = "''";
}
if (!StrUtil.isEmpty(newVal)) {
newVal = redis.getTargetName(config.getKeywordCol(), newVal);
} else {
newVal = "''";
}
}
if (StrUtil.isEmpty(val)){
changeVal = StrUtil.join(changeVal, ":[null->");
}else{
changeVal = StrUtil.join(changeVal, ":[", val, "->");
}
if (StrUtil.isEmpty(newVal)){
changeVal = StrUtil.join(changeVal, "null],");
}else {
changeVal = StrUtil.join(changeVal, newVal, "],");
}
// changeVal = StrUtil.join(changeVal, val, "->", newVal, "],");
break;
}
}
}
if (changeKey.length() > 2000) {
changeKey = changeKey.substring(0, 2000);
}
if (changeVal.length() > 2000) {
changeVal = changeVal.substring(0, 2000);
}
operLog.setChangeKey(changeKey);
operLog.setChangeVal(changeVal);
//无数据变化不记录
if (StrUtil.isEmpty(changeKey)) {
continue;
}
updates.add(operLog);
}
}
private void mergeUpdateBean(LogParam logParam, JSONArray array) {
if (CollUtil.isEmpty(logParam.getUpdate())){
return;
}
for (Serializable source : logParam.getUpdate()){
Map<String, Object> sourceMap = objectToMap(source);
for (Map.Entry<String, Object> sourceEntry : sourceMap.entrySet()) {
String sourceKey = Convert.toStr(sourceEntry.getKey());
Object sourceVal = sourceEntry.getValue();
for (int i=0; i<array.size(); i++){
JSONObject target = array.getJSONObject(i);
if (!target.containsKey(logParam.getPrimaryKeyColName())){
continue;
}
for (Map.Entry targetEntry : target.entrySet()) {
String targetKey = Convert.toStr(targetEntry.getKey());
//String targetVal = Convert.toStr(targetEntry.getValue());
if (StrUtil.startsWithAny(targetKey, "#", "%")){
continue;
}
if (ObjectUtil.equal(sourceMap.get(logParam.getPrimaryKeyColName()), target.get(logParam.getPrimaryKeyColName())) && ObjectUtil.equal(sourceKey, targetKey)){
target.put("#"+sourceKey, valToStr(sourceVal));
break;
}
}
}
}
}
}
private Map<String, Object> objectToMap(Object object){
Map<String,Object> dataMap = MapUtil.newHashMap();
Class<?> clazz = object.getClass();
for (Field field : clazz.getDeclaredFields()) {
try {
field.setAccessible(true);
dataMap.put(StrUtil.toUpperCol(field.getName()), field.get(object));
} catch (IllegalAccessException e) {
e.printStackTrace();
}
}
return dataMap;
}
private String valToStr(Object val){
if (val == null){
return null;
}
if (val instanceof String || val instanceof Number || val instanceof Boolean){
return Convert.toStr(val);
}
if(val instanceof Date) {
return DateUtil.formatDateTime((Date)val);
}
return null;
}
public boolean checkJSONArray(String str) {
Object json = new JSONTokener(str).nextValue();
if (json instanceof org.json.JSONObject) {
return false;
} else if (json instanceof org.json.JSONArray) {
return true;
}
throw new RuntimeException("报文格式错误!");
}
public static void main(String[] args) {
String str = "[{\"S_ID\":\"01059b60bf574ac295759adf08bbfd1f\",\"NAME\":\"test\",\"SEX\":\"\",\"AGE\":18,\"C_ID\":\"\",\"T_ID\":\"\",\"SUB_ID\":\"\",\"CREATED_BY\":\"\",\"CREATED_ON\":null,\"UPDATED_BY\":\"\",\"UPDATED_ON\":null},{\"S_ID\":\"01e37822d4aa4e27a35e6293534c71ca\",\"NAME\":\"test\",\"SEX\":\"\",\"AGE\":18,\"C_ID\":\"\",\"T_ID\":\"\",\"SUB_ID\":\"\",\"CREATED_BY\":\"\",\"CREATED_ON\":null,\"UPDATED_BY\":\"\",\"UPDATED_ON\":null},{\"S_ID\":\"02607039d05f4d859625aa75feeec5fe\",\"NAME\":\"test\",\"SEX\":\"\",\"AGE\":18,\"C_ID\":\"\",\"T_ID\":\"\",\"SUB_ID\":\"\",\"CREATED_BY\":\"\",\"CREATED_ON\":null,\"UPDATED_BY\":\"\",\"UPDATED_ON\":null}]";
Object json = new JSONTokener(str).nextValue();
if (json instanceof org.json.JSONObject) {
System.out.println("JSONObject");
} else if (json instanceof org.json.JSONArray) {
System.out.println("JSONArray");
} else {
System.out.println("非法数据");
}
}
}

View File

@@ -0,0 +1,58 @@
package com.ag.log;
import com.ag.base.BaseService;
import com.ag.base.DefaultBussniessImpl;
import com.ag.log.entity.LogParam;
import com.ag.log.entity.UserDefineLog;
import com.ag.util.StrUtil;
import com.ag.util.UUIDUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.Assert;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
/**
* Created by yangxh on 2022/4/14.
*/
@Service
public class UserDefineLogService extends BaseService {
@Autowired
private DefaultBussniessImpl bizDao;
@Transactional
public void saveLog(org.json.JSONObject param, HttpServletResponse response, HttpServletRequest request){
Assert.isTrue(param.has("bizType") && !StrUtil.isEmpty(param.getString("bizType")), "参数异常bizType不能为空!");
Assert.isTrue(param.has("keyword") && !StrUtil.isEmpty(param.getString("keyword")), "参数异常keyword不能为空!");
Assert.isTrue(param.has("info") && !StrUtil.isEmpty(param.getString("info")), "参数异常info不能为空!");
LogParam logParam = new LogParam(param, param.getString("keyword"), param.getString("bizType"), param.getString("info"));
saveLog(logParam, "wb");
}
private void saveLog(LogParam logParam, String sourceType){
UserDefineLog userLog = new UserDefineLog();
userLog.setId(UUIDUtil.getUUID());
userLog.setKeyword(logParam.getKeyword());
userLog.setSourceType(sourceType);
userLog.setBizType(logParam.getBizType());
userLog.setContext(logParam.getDefineInfo());
super.setSaveUser(logParam.getReqParam(), userLog);
userLog.setIp(super.getUserIpAddress(logParam.getReqParam()));
bizDao.save(userLog);
}
@Transactional
public void saveLog(LogParam logParam){
Assert.notNull(logParam.getDefineInfo(), "参数异常,记录内容不能为空!");
Assert.notNull(logParam.getKeyword(), "参数异常,关键字不能为空!");
Assert.notNull(logParam.getBizType(), "参数异常,业务类型不能为空!");
try {
saveLog(logParam, "java");
}catch (Exception ex){
ex.printStackTrace();
}
}
}

View File

@@ -0,0 +1,151 @@
package com.ag.log.entity;
import com.ag.util.StrUtil;
import org.json.JSONObject;
import java.io.Serializable;
import java.util.List;
/**
* Created by yangxh on 2022/3/9.
*/
public class LogParam {
private JSONObject reqParam;
private String cudType;
private String bizType;
private String keyword;
private String wbName;
private String defineInfo;
private String menuName;
private String createDataId;
private String primaryKeyColName;
private List<Serializable> create;
private List<Serializable> update;
private List<Serializable> destroy;
public LogParam(){
}
/**
* @param reqParam requestAg请求发送到后台组装的参数
* @param keyword 关键字,方便日志查询的筛选条件(可以是提单号、箱号、船名等常用数据)
* @param bizType 业务类型,方便日志查询的筛选条件
* @param cudType 增删改类型主要针对panel提交grid提交传null
* @param wbName 控件的参数名称
*/
public LogParam(JSONObject reqParam, String keyword, String bizType, String cudType, String wbName){
this.reqParam = reqParam;
this.keyword = keyword;
this.bizType = bizType;
this.cudType = cudType;
this.wbName = wbName;
}
public LogParam(JSONObject reqParam, String keyword, String bizType, String defineInfo){
this.reqParam = reqParam;
this.keyword = keyword;
this.bizType = bizType;
this.defineInfo = defineInfo;
}
public JSONObject getReqParam() {
return reqParam;
}
public void setReqParam(JSONObject reqParam) {
this.reqParam = reqParam;
}
public String getCudType() {
return cudType;
}
public void setCudType(String cudType) {
this.cudType = cudType;
}
public String getBizType() {
return bizType;
}
public void setBizType(String bizType) {
this.bizType = bizType;
}
public String getKeyword() {
return keyword;
}
public void setKeyword(String keyword) {
this.keyword = keyword;
}
public String getWbName() {
return wbName;
}
public void setWbName(String wbName) {
this.wbName = wbName;
}
public String getDefineInfo() {
return defineInfo;
}
public void setDefineInfo(String defineInfo) {
this.defineInfo = defineInfo;
}
public String getMenuName() {
return menuName;
}
public void setMenuName(String menuName) {
this.menuName = menuName;
}
public String getCreateDataId() {
return createDataId;
}
public void setCreateDataId(String createDataId) {
this.createDataId = createDataId;
}
public List<Serializable> getCreate() {
return create;
}
public void setCreate(List<Serializable> create) {
this.create = create;
}
public List<Serializable> getUpdate() {
return update;
}
public void setUpdate(List<Serializable> update) {
this.update = update;
}
public List<Serializable> getDestroy() {
return destroy;
}
public void setDestroy(List<Serializable> destroy) {
this.destroy = destroy;
}
public String getPrimaryKeyColName() {
if (StrUtil.isEmpty(primaryKeyColName)){
primaryKeyColName = "ID";
}
return primaryKeyColName;
}
public void setPrimaryKeyColName(String primaryKeyColName) {
this.primaryKeyColName = primaryKeyColName;
}
}

View File

@@ -0,0 +1,118 @@
package com.ag.log.entity;
import com.ag.base.ISerializable;
import java.util.Date;
public class OperLog implements ISerializable {
private String id;
private String mainId;
private String bizId;
private String changeKey;
private String changeVal;
private String oriSql;
private String analysis;
private String cudType;
private String bizType;
private String createdBy;
private Date createdOn;
private String tenancyId;
public String getId() {
return id;
}
public void setId(String id) {
this.id = id;
}
public String getMainId() {
return mainId;
}
public void setMainId(String mainId) {
this.mainId = mainId;
}
public String getBizId() {
return bizId;
}
public void setBizId(String bizId) {
this.bizId = bizId;
}
public String getChangeKey() {
return changeKey;
}
public void setChangeKey(String changeKey) {
this.changeKey = changeKey;
}
public String getChangeVal() {
return changeVal;
}
public void setChangeVal(String changeVal) {
this.changeVal = changeVal;
}
public String getOriSql() {
return oriSql;
}
public void setOriSql(String oriSql) {
this.oriSql = oriSql;
}
public String getAnalysis() {
return analysis;
}
public void setAnalysis(String analysis) {
this.analysis = analysis;
}
public String getCudType() {
return cudType;
}
public void setCudType(String cudType) {
this.cudType = cudType;
}
public String getBizType() {
return bizType;
}
public void setBizType(String bizType) {
this.bizType = bizType;
}
public String getCreatedBy() {
return createdBy;
}
public void setCreatedBy(String createdBy) {
this.createdBy = createdBy;
}
public Date getCreatedOn() {
return createdOn;
}
public void setCreatedOn(Date createdOn) {
this.createdOn = createdOn;
}
public String getTenancyId() {
return tenancyId;
}
public void setTenancyId(String tenancyId) {
this.tenancyId = tenancyId;
}
}

View File

@@ -0,0 +1,92 @@
package com.ag.log.entity;
import com.ag.base.ISerializable;
import java.util.Date;
public class OperLogMain implements ISerializable {
private String id;
private String sourceType;
private String bizType;
private String keyword;
private String ip;
private String createdBy;
private Date createdOn;
private String tenancyId;
private String menuName;
public String getId() {
return id;
}
public void setId(String id) {
this.id = id;
}
public String getSourceType() {
return sourceType;
}
public void setSourceType(String sourceType) {
this.sourceType = sourceType;
}
public String getBizType() {
return bizType;
}
public void setBizType(String bizType) {
this.bizType = bizType;
}
public String getKeyword() {
return keyword;
}
public void setKeyword(String keyword) {
this.keyword = keyword;
}
public String getIp() {
return ip;
}
public void setIp(String ip) {
this.ip = ip;
}
public String getCreatedBy() {
return createdBy;
}
public void setCreatedBy(String createdBy) {
this.createdBy = createdBy;
}
public Date getCreatedOn() {
return createdOn;
}
public void setCreatedOn(Date createdOn) {
this.createdOn = createdOn;
}
public String getTenancyId() {
return tenancyId;
}
@Override
public void setTenancyId(String tenancyId) {
this.tenancyId = tenancyId;
}
public String getMenuName() {
return menuName;
}
public void setMenuName(String menuName) {
this.menuName = menuName;
}
}

View File

@@ -0,0 +1,64 @@
package com.ag.log.entity;
import com.ag.base.ISerializable;
import java.util.Date;
public class SysExceptionLog implements ISerializable {
private String id;
private String message;
private String printStackTrace;
private String createdBy;
private java.util.Date createdOn;
private String ip;
public String getId() {
return id;
}
public void setId(String id) {
this.id = id;
}
public String getMessage() {
return message;
}
public void setMessage(String message) {
this.message = message;
}
public String getPrintStackTrace() {
return printStackTrace;
}
public void setPrintStackTrace(String printStackTrace) {
this.printStackTrace = printStackTrace;
}
public String getCreatedBy() {
return createdBy;
}
public void setCreatedBy(String createdBy) {
this.createdBy = createdBy;
}
public Date getCreatedOn() {
return createdOn;
}
public void setCreatedOn(Date createdOn) {
this.createdOn = createdOn;
}
public String getIp() {
return ip;
}
public void setIp(String ip) {
this.ip = ip;
}
}

View File

@@ -0,0 +1,64 @@
package com.ag.log.entity;
import com.ag.base.ISerializable;
import java.util.Date;
public class SysOperLog implements ISerializable {
private String id;
private String bean;
private String method;
private String createdBy;
private java.util.Date createdOn;
private String ip;
public String getId() {
return id;
}
public void setId(String id) {
this.id = id;
}
public String getBean() {
return bean;
}
public void setBean(String bean) {
this.bean = bean;
}
public String getMethod() {
return method;
}
public void setMethod(String method) {
this.method = method;
}
public String getCreatedBy() {
return createdBy;
}
public void setCreatedBy(String createdBy) {
this.createdBy = createdBy;
}
public Date getCreatedOn() {
return createdOn;
}
public void setCreatedOn(Date createdOn) {
this.createdOn = createdOn;
}
public String getIp() {
return ip;
}
public void setIp(String ip) {
this.ip = ip;
}
}

View File

@@ -0,0 +1,82 @@
package com.ag.log.entity;
import com.ag.base.ISerializable;
import java.util.Date;
public class UserDefineLog implements ISerializable {
private String id;
private String bizType;
private String keyword;
private String ip;
private String context;
private String createdBy;
private java.util.Date createdOn;
private String sourceType;
public String getId() {
return id;
}
public void setId(String id) {
this.id = id;
}
public String getBizType() {
return bizType;
}
public void setBizType(String bizType) {
this.bizType = bizType;
}
public String getKeyword() {
return keyword;
}
public void setKeyword(String keyword) {
this.keyword = keyword;
}
public String getIp() {
return ip;
}
public void setIp(String ip) {
this.ip = ip;
}
public String getContext() {
return context;
}
public void setContext(String context) {
this.context = context;
}
public String getCreatedBy() {
return createdBy;
}
public void setCreatedBy(String createdBy) {
this.createdBy = createdBy;
}
public Date getCreatedOn() {
return createdOn;
}
public void setCreatedOn(Date createdOn) {
this.createdOn = createdOn;
}
public String getSourceType() {
return sourceType;
}
public void setSourceType(String sourceType) {
this.sourceType = sourceType;
}
}

View File

@@ -0,0 +1,61 @@
package com.ag.until;
import org.apache.ibatis.session.ExecutorType;
import org.apache.ibatis.session.SqlSession;
import org.apache.ibatis.session.SqlSessionFactory;
import org.springframework.stereotype.Component;
import org.springframework.transaction.support.TransactionSynchronizationManager;
import javax.annotation.Resource;
import java.util.List;
import java.util.function.BiFunction;
/**
* @description: 批量插入工具类
* batchUpdateOrInsert(list,XMapper.class,
* @author: fengjun
* @time: 2022/12/8 11:22
*/
@Component
public class MybatisBatchUtil {
/**
* 每次处理1000条
*/
private static final int BATCH_SIZE = 1000;
@Resource
private SqlSessionFactory sqlSessionFactory;
/**
* 批量处理修改或者插入
*
* @param data 需要被处理的数据
* @param mapperClass Mybatis的Mapper类
* @param function 自定义处理逻辑
* @return int 影响的总行数
*/
public <T,U,R> int batchUpdateOrInsert(List<T> data, Class<U> mapperClass, BiFunction<T,U,R> function) {
int i = 1;
SqlSession batchSqlSession = sqlSessionFactory.openSession(ExecutorType.BATCH);
try {
U mapper = batchSqlSession.getMapper(mapperClass);
int size = data.size();
for (T element : data) {
function.apply(element,mapper);
if ((i % BATCH_SIZE == 0) || i == size) {
batchSqlSession.flushStatements();
}
i++;
}
// 非事务环境下强制commit事务情况下该commit相当于无效
batchSqlSession.commit(!TransactionSynchronizationManager.isSynchronizationActive());
} catch (Exception e) {
batchSqlSession.rollback();
throw e;
} finally {
batchSqlSession.close();
}
return i - 1;
}
}

View File

@@ -0,0 +1,162 @@
package com.ag.util;
import java.lang.reflect.Field;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
* 反射处理Bean得到里面的属性值
*
* @author liulinsen
*
*/
public class ReflexObjectUtil {
/**
* 单个对象的所有键值
*
* @param obj 单个对象
*
* @return Map<String, Object> map 所有 String键 Object值 ex{pjzyfy=0.00,
* xh=01, zzyl=0.00, mc=住院患者压疮发生率, pjypfy=0.00, rs=0, pjzyts=0.00,
* czydm=0037, lx=921, zssl=0.00}
*/
public static Map<String, Object> getKeyAndValue(Object obj) {
Map<String, Object> map = new HashMap<String, Object>();
// 得到类对象
Class userCla = (Class) obj.getClass();
/* 得到类中的所有属性集合 */
Field[] fs = userCla.getDeclaredFields();
for (int i = 0; i < fs.length; i++) {
Field f = fs[i];
f.setAccessible(true); // 设置些属性是可以访问的
Object val = new Object();
try {
val = f.get(obj);
// 得到此属性的值
map.put(f.getName(), val);// 设置键值
} catch (IllegalArgumentException e) {
e.printStackTrace();
} catch (IllegalAccessException e) {
e.printStackTrace();
}
}
System.out.println("单个对象的所有键值==反射==" + map.toString());
return map;
}
/**
* 单个对象的某个键的值
*
* @param obj
* 对象
*
* @param key
* 键
*
* @return Object 键在对象中所对应得值 没有查到时返回空字符串
*/
public static Object getValueByKey(Object obj, String key) {
// 得到类对象
Class userCla = (Class) obj.getClass();
/* 得到类中的所有属性集合 */
Field[] fs = userCla.getDeclaredFields();
for (int i = 0; i < fs.length; i++) {
Field f = fs[i];
f.setAccessible(true); // 设置些属性是可以访问的
try {
if (f.getName().endsWith(key)) {
System.out.println("单个对象的某个键的值==反射==" + f.get(obj));
return f.get(obj);
}
} catch (IllegalArgumentException e) {
e.printStackTrace();
} catch (IllegalAccessException e) {
e.printStackTrace();
}
}
// 没有查到时返回空字符串
return "";
}
/**
* 多个(列表)对象的所有键值
*
* @param object
* @return List<Map<String,Object>> 列表中所有对象的所有键值 ex:[{pjzyfy=0.00, xh=01,
* zzyl=0.00, mc=住院患者压疮发生率, pjypfy=0.00, rs=0, pjzyts=0.00,
* czydm=0037, lx=921, zssl=0.00}, {pjzyfy=0.00, xh=02, zzyl=0.00,
* mc=新生儿产伤发生率, pjypfy=0.00, rs=0, pjzyts=0.00, czydm=0037, lx=13,
* zssl=0.00}, {pjzyfy=0.00, xh=03, zzyl=0.00, mc=阴道分娩产妇产伤发生率,
* pjypfy=0.00, rs=0, pjzyts=0.00, czydm=0037, lx=0, zssl=0.00},
* {pjzyfy=0.00, xh=04, zzyl=0.75, mc=输血反应发生率, pjypfy=0.00, rs=0,
* pjzyts=0.00, czydm=0037, lx=0, zssl=0.00}, {pjzyfy=5186.12,
* xh=05, zzyl=0.00, mc=剖宫产率, pjypfy=1611.05, rs=13, pjzyts=7.15,
* czydm=0037, lx=13, zssl=0.00}]
*/
public static List<Map<String, Object>> getKeysAndValues(List<Object> object) {
List<Map<String, Object>> list = new ArrayList<Map<String, Object>>();
for (Object obj : object) {
Class userCla;
// 得到类对象
userCla = (Class) obj.getClass();
/* 得到类中的所有属性集合 */
Field[] fs = userCla.getDeclaredFields();
Map<String, Object> listChild = new HashMap<String, Object>();
for (int i = 0; i < fs.length; i++) {
Field f = fs[i];
f.setAccessible(true); // 设置些属性是可以访问的
Object val = new Object();
try {
val = f.get(obj);
// 得到此属性的值
listChild.put(f.getName(), val);// 设置键值
} catch (IllegalArgumentException e) {
e.printStackTrace();
} catch (IllegalAccessException e) {
e.printStackTrace();
}
}
list.add(listChild);// 将map加入到list集合中
}
System.out.println("多个(列表)对象的所有键值====" + list.toString());
return list;
}
/**
* 多个(列表)对象的某个键的值
*
* @param object
* @param key
* @return List<Object> 键在列表中对应的所有值 ex:key为上面方法中的mc字段 那么返回的数据就是: [住院患者压疮发生率,
* 新生儿产伤发生率, 阴道分娩产妇产伤发生率, 输血反应发生率, 剖宫产率]
*/
public static List<Object> getValuesByKey(List<Object> object, String key) {
List<Object> list = new ArrayList<Object>();
for (Object obj : object) {
// 得到类对象
Class userCla = (Class) obj.getClass();
/* 得到类中的所有属性集合 */
Field[] fs = userCla.getDeclaredFields();
for (int i = 0; i < fs.length; i++) {
Field f = fs[i];
f.setAccessible(true); // 设置些属性是可以访问的
try {
if (f.getName().endsWith(key)) {
list.add(f.get(obj));
}
} catch (IllegalArgumentException e) {
e.printStackTrace();
} catch (IllegalAccessException e) {
e.printStackTrace();
}
}
}
System.out.println("多个(列表)对象的某个键的值列表====" + list.toString());
return list;
}
}

View File

@@ -0,0 +1,960 @@
package com.ag.util;
import com.wb.common.Base;
import com.wb.interact.IDE;
import com.wb.util.WebUtil;
import org.json.JSONArray;
import org.json.JSONObject;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.File;
import java.io.IOException;
import java.sql.ResultSet;
import java.util.ArrayList;
import java.util.Map.Entry;
/**
* ??wb????
*/
//@Component
public class WbUtil {
static String[] iconarr={"fa-home","fa-laptop","fa-book","fa-cogs","fa-bullhorn",
"fa-envelope","fa-tasks","fa-bar-chart-o","fa-th-list","fa-map-marker","fa-file-text"};
static String[] sa={"fa-home","fa-laptop","fa-book","fa-cogs","fa-bullhorn",
"fa-envelope","fa-tasks","fa-bar-chart-o","fa-th-list","fa-map-marker","fa-file-text"};
private static void getModuleList(HttpServletRequest request,HttpServletResponse response, int type) throws Exception {
getBasicsList(request, response, 1);
}
public static void getBasicsListsession(HttpServletRequest request,HttpServletResponse response){
String menuid=request.getParameter("subsId");
request.getSession().setAttribute("menuid",menuid);
}
/**
* ?????????????
* ?1????2??????3??????
*/
public static void getBasicsListA(HttpServletRequest request,HttpServletResponse response) throws Exception {
String menuid=request.getParameter("subsId");
request.getSession().setAttribute("menuid",menuid);
int type=1;
String userid= (String) request.getSession().getAttribute("sys.user");
String menuida="";
if(request.getSession().getAttribute("menuid")!=null) {
menuida = (String) request.getSession().getAttribute("menuid");
}
//String iconarr[]={"fa-laptop","fa-cogs","fa-bullhorn","fa-envelope","fa-bar-chart-o"};
StringBuilder sb = new StringBuilder();
String sqlRoleA="SELECT *\n" +
" FROM wb_menu\n" +
" WHERE menu_id IN\n" +
" (SELECT DISTINCT parent_menu\n" +
" FROM wb_menu wm, wb_role_resource wrr\n" +
" WHERE wm.menu_id = wrr.menu_id\n" +
" AND wrr.role_id IN (SELECT role_id\n" +
" FROM wb_user_role\n" +
" WHERE user_id ='"+userid+"'\n" +
" AND wm.parent_menu IN\n" +
" (SELECT menu_id\n" +
" FROM wb_menu\n" +
" WHERE parent_menu ='"+menuida+"' \n" +
" AND menu_type = '0'))\n" +
" ORDER BY order_index ";
ResultSet roles = (ResultSet) com.wb.util.DbUtil.run(request,sqlRoleA);
int i=0;
while (roles.next()) {
String icon="fa-book";
if(iconarr[i]==null){
icon="fa-book";
}else{
icon=iconarr[i];
}
sb.append("<li class=\"menu-list\">");
sb.append("<a>");
sb.append("<i class=\"fa "+icon+"\"></i>");
sb.append("<span>"+roles.getString("MENU_NAME")+"</span>");
sb.append("</a>");
String sqlRoleA1 = "SELECT *\n" +
" FROM wb_menu\n" +
" WHERE parent_menu ='"+roles.getString("MENU_ID")+"'\n" +
" AND menu_id IN\n" +
" (SELECT menu_id\n" +
" FROM wb_user_role, wb_role_resource\n" +
" WHERE wb_user_role.role_id = wb_role_resource.role_id\n" +
" AND user_id ='"+userid+"')\n" +
" ORDER BY order_index";
ResultSet roles1 = (ResultSet) com.wb.util.DbUtil.run(request,sqlRoleA1);
while (roles1.next()) {
sb.append("<ul class=\"sub-menu-list\">");
sb.append("<li>");
sb.append("<a onclick=\"changeurl('" + roles1.getString("MENU_URL") + "','" + roles1.getString("MENU_NAME") + "','',false,'null' )\">"
+ roles1.getString("MENU_NAME") + "</a>");
sb.append("</li>");
sb.append("</ul>");
}
sb.append("</li>");
i++;
}
request.getSession().setAttribute("basicsLust", sb.toString());
WebUtil.send(response, sb.toString());
}
/**
* ?????????????
* @param type ?????????1????2??????3??????
*/
private static void getBasicsList(HttpServletRequest request,HttpServletResponse response, int type) throws Exception {
//String iconarr[]={"fa-laptop","fa-cogs","fa-bullhorn","fa-envelope","fa-bar-chart-o"};
//AgCommonService agCommonService = new AgCommonService();
String username= (String) request.getSession().getAttribute("sys.user");
String menuida="";
if(request.getSession().getAttribute("sys.menuid")!=null) {
menuida = (String) request.getSession().getAttribute("sys.menuid");
}
StringBuilder sb = new StringBuilder();
String sqlRole = "SELECT *\n" +
" FROM wb_menu\n" +
" WHERE menu_id IN\n" +
" (SELECT DISTINCT parent_menu\n" +
" FROM wb_menu wm, wb_role_resource wrr\n" +
" WHERE wm.menu_id = wrr.menu_id\n" +
" AND wrr.role_id = '"+username+"'\n" +
" AND wm.parent_menu IN\n" +
" (SELECT menu_id\n" +
" FROM wb_menu\n" +
" WHERE parent_menu ='"+menuida+"' AND menu_type = '0'))\n" +
" ORDER BY order_index";
ResultSet roles = (ResultSet) com.wb.util.DbUtil.run(request,sqlRole);
int i=0;
while(roles.next()){
String icon="fa-book";
if(iconarr[i]==null){
icon="fa-book";
}else{
icon=iconarr[i];
}
sb.append("<li class=\"menu-list\">");
sb.append("<a>");
sb.append("<i class=\"fa "+icon+"\"></i>");
sb.append("<span>"+roles.getString("MENU_NAME")+"</span>");
sb.append("</a>");
String sqlRole1 = " select wm.*,role_id from wb_menu wm,wb_role_resource wrr where wm.menu_id=wrr.menu_id\n" +
" and wm.parent_menu = '"+roles.getString("MENU_ID")+"' and wrr.role_id='"+username+"'\n" +
" order by order_index";
ResultSet role1 = (ResultSet) com.wb.util.DbUtil.run(request,sqlRole1);
while(role1.next()){
sb.append("<ul class=\"sub-menu-list\">");
sb.append("<li>");
sb.append("<a onclick=\"changeurl('"+role1.getString("MENU_URL")+"','"+role1.getString("MENU_NAME")+"','',false,'null' )\">"
+role1.getString("MENU_NAME")+"</a>");
sb.append("</li>");
sb.append("</ul>");
}
sb.append("</li>");
i++;
}
request.setAttribute("basicsLust", sb.toString());
}
public static String getStringBuffer1(JSONObject o,int i)
{
StringBuffer str=new StringBuffer("<li class=\"menu-list\"><a ><i class=\""+sa[i]+"\"></i> " +
"<span>"+o.get("text")+"</span></a><ul class=\"sub-menu-list\">");
return str.toString();
}
public static String getStringBuffer2(JSONObject o)
{
Object pageLink=null;
if(!o.isNull("pageLink"))
pageLink=o.get("pageLink").toString().replace("'", "*");
StringBuffer str=new StringBuffer("<li><a onclick=\"changeurl('"+o.get("path")+"','"+o.get("text")+"','"+o.get("iconCls")+"',"+o.get("inframe")+" ,'"+pageLink+"' )\"> "+o.get("text")+"</a></li>");
return str.toString();
}
private static String getModuleListNext(HttpServletRequest request,
HttpServletResponse response, int type,String path2) throws Exception {
String path = path2;
String iconCls, fileName, pageLink, relPath, title;
File file, base;
int displayType = (type == 1 ? 1 : 3);
String[] roles = com.wb.common.Session.getRoles(request);
if (path == null)
base = Base.modulePath;
else {
base = new File(Base.modulePath, path);
if (!com.wb.util.FileUtil.isAncestor(Base.modulePath, base))
com.wb.util.SysUtil.accessDenied();
}
path = path + "/";
ArrayList<Entry<String, Integer>> fileNames = IDE.getSortedFile(base);
JSONObject content = null, fileObject;
JSONArray fileArray;
boolean isFolder;
StringBuffer str=new StringBuffer("");
fileArray = new JSONArray();
for (Entry<String, Integer> entry : fileNames) {
fileName = entry.getKey();
file = new File(base, fileName);
// ??????????????????
if (!file.exists())
continue;
if (!com.wb.common.XwlBuffer.canDisplay(file, roles, displayType))
continue;
isFolder = file.isDirectory();
if (isFolder) {
if (type != 1 && !hasLoginModule(file))
continue;
File configFile = new File(file, "folder.json");
if (configFile.exists())
content = com.wb.util.JsonUtil.readObject(configFile);
else
content = new JSONObject();
} else {
// ?????????????????
if (type != 1 && !file.getName().endsWith(".xwl"))
continue;
content = com.wb.common.XwlBuffer.get(path + fileName, false);
// ??????????????
if (type != 1
&& Boolean.FALSE.equals(content.opt("loginRequired")))
continue;
}
fileObject = new JSONObject();
title = content.optString("title");
if (title.startsWith("Str."))
title = com.wb.common.Str.format(request, title.substring(4));
fileObject.put("text", com.wb.util.StringUtil.select(title, fileName));
relPath = com.wb.util.FileUtil.getModulePath(file);
fileObject.put("path", relPath);
fileObject.put("fileName", fileName);
fileObject.put("inframe", Boolean.TRUE.equals(content
.opt("inframe")));
if (isFolder) {
if (!hasChildren(file))
fileObject.put("children", new JSONArray());
continue;
} else {
pageLink = (String) content.opt("pageLink");
if (!com.wb.util.StringUtil.isEmpty(pageLink))
fileObject.put("pageLink", pageLink);
fileObject.put("leaf", true);
}
fileObject.put("cls", "wb_pointer");
iconCls = content.optString("iconCls");
//if (!StringUtil.isEmpty(iconCls))
fileObject.put("iconCls", iconCls);
if (type == 2 && !isFolder)
fileObject.put("checked", false);
str.append(getStringBuffer2(fileObject));
}
return str.toString();
}
/**
* ??????????????????
* @param path ?????
* @return true??????????false???????????
* @throws IOException
*/
private static boolean hasLoginModule(File path) throws IOException {
File[] files = com.wb.util.FileUtil.listFiles(path);
for (File file : files) {
if (file.isDirectory()) {
if (hasLoginModule(file))
return true;
} else {
if (file.getName().endsWith(".xwl")) {
JSONObject content = com.wb.common.XwlBuffer.get(com.wb.util.FileUtil
.getModulePath(file), true);
if (Boolean.TRUE.equals(content.opt("loginRequired")))
return true;
}
}
}
return false;
}
/**
* ??????
*/
public static void initHome(HttpServletRequest request,
HttpServletResponse response) throws Exception {
String desktopString = com.wb.common.Resource.getString(request, "desktop", null);
int treeWidth;
boolean treeCollapsed, treeHidden;
if (desktopString == null)
desktopString = com.wb.common.Resource.getString("sys.home.desktop", null);
if (desktopString != null) {
JSONObject desktop = new JSONObject(desktopString);
treeWidth = desktop.optInt("treeWidth", 200);
treeCollapsed = desktop.optBoolean("treeCollapsed", false);
treeHidden = desktop.optBoolean("treeHidden", false);
JSONArray pages = desktop.optJSONArray("pages");
if (pages != null) {
int i, j = pages.length(), activeIndex = desktop.optInt(
"active", 0);
String url, title, pageLink, params, rawUrl;
JSONObject page, module, item;
JSONArray tabItems = new JSONArray();
for (i = 0; i < j; i++) {
page = pages.optJSONObject(i);
rawUrl = page.optString("url");
url = com.wb.util.FileUtil.getModuleFile(rawUrl, true);
module = com.wb.common.XwlBuffer.get(url, true);
if (module == null) {
if (i <= activeIndex)
activeIndex--;
} else {
item = new JSONObject();
item.put("url", rawUrl);
title = (String) module.opt("title");
if (title.startsWith("Str."))
title = com.wb.common.Str.format(request, title.substring(4));
item.put("title", com.wb.util.StringUtil.select(title, com.wb.util.FileUtil
.getFilename(url)));
item.put("iconCls", (String) module.opt("iconCls"));
item.put("useIFrame", Boolean.TRUE.equals(module
.opt("inframe")));
params = page.optString("params");
if (!com.wb.util.StringUtil.isEmpty(params))
item.put("params", new JSONObject(params));
pageLink = (String) module.opt("pageLink");
if (!com.wb.util.StringUtil.isEmpty(pageLink))
com.wb.util.JsonUtil.apply(item, new JSONObject(pageLink));
tabItems.put(item);
}
}
request.setAttribute("activeIndex", activeIndex);
request.setAttribute("tabItems", com.wb.util.StringUtil.text(tabItems
.toString()));
}
JSONArray portlets = desktop.optJSONArray("portlets");
if (portlets != null) {
int i, j = portlets.length(), k, l;
String url, title, pageLink;
JSONArray cols;
JSONObject portlet, module;
for (i = 0; i < j; i++) {
cols = portlets.optJSONArray(i);
l = cols.length();
for (k = 0; k < l; k++) {
portlet = cols.optJSONObject(k);
url = com.wb.util.FileUtil.getModuleFile(portlet.optString("url"),
true);
module = com.wb.common.XwlBuffer.get(url, true);
if (module == null) {
cols.remove(k);
k--;
l--;
continue;
}
title = (String) module.opt("title");
if (title.startsWith("Str."))
title = com.wb.common.Str.format(request, title.substring(4));
portlet.put("title", com.wb.util.StringUtil.select(title, com.wb.util.FileUtil
.getFilename(url)));
portlet.put("iconCls", (String) module.opt("iconCls"));
portlet.put("useIFrame", Boolean.TRUE.equals(module
.opt("inframe")));
pageLink = (String) module.opt("pageLink");
if (!com.wb.util.StringUtil.isEmpty(pageLink))
com.wb.util.JsonUtil.apply(portlet, new JSONObject(pageLink));
}
}
request.setAttribute("portlets", com.wb.util.StringUtil.text(portlets
.toString()));
}
} else {
treeWidth = 200;
treeCollapsed = false;
treeHidden = false;
}
request.setAttribute("treeWidth", treeWidth);
request.setAttribute("treeCollapsed", treeCollapsed);
request.setAttribute("treeHidden", treeHidden);
request.setAttribute("hideSetDefaultDesktop", !com.wb.common.XwlBuffer.canAccess(
request, "m?xwl=sys/portal/home/save-default-desktop"));
request.setAttribute("hideSetAllDesktop", !com.wb.common.XwlBuffer.canAccess(request,
"m?xwl=sys/portal/home/save-all-desktop"));
}
/**
* ???????????????
*/
public static void getAppList(HttpServletRequest request,HttpServletResponse response) throws Exception {
getModuleList(request, response, 1);
}
/**
* ?????????
*/
public static void saveDesktop(HttpServletRequest request,
HttpServletResponse response) throws Exception {
doSaveDesktop(request, 1);
}
/**
* ????????????
*/
public static void saveAsDefaultDesktop(HttpServletRequest request,
HttpServletResponse response) throws Exception {
doSaveDesktop(request, 2);
}
/**
* ??????????????
*/
public static void saveAsAllDesktop(HttpServletRequest request,
HttpServletResponse response) throws Exception {
doSaveDesktop(request, 3);
}
/**
* ???????
* @param request ?????
* @param type ?????1???????2?????3????
*/
private static void doSaveDesktop(HttpServletRequest request, int type)
throws Exception {
JSONObject desktop = new JSONObject();
desktop.put("treeWidth", Integer.parseInt(request
.getParameter("treeWidth")));
desktop.put("treeCollapsed", Boolean.parseBoolean(request
.getParameter("treeCollapsed")));
desktop.put("treeHidden", Boolean.parseBoolean(request
.getParameter("treeHidden")));
desktop.put("pages", new JSONArray(request.getParameter("pages")));
desktop
.put("portlets",
new JSONArray(request.getParameter("portlets")));
desktop.put("active", Integer.parseInt(request.getParameter("active")));
if (type == 1) {
com.wb.common.Resource.set(request, "desktop", desktop.toString());
} else {
if (type == 3)
com.wb.util.DbUtil
.run(request,
"delete from WB_RESOURCE where RES_ID like 'desktop@%'");
com.wb.common.Resource.set("sys.home.desktop", desktop.toString());
}
}
/**
* ???????????????
*/
public static void getPermList(HttpServletRequest request,
HttpServletResponse response) throws Exception {
getModuleList(request, response, 2);
}
/**
* ???????????????????
*/
public static void getUserPermList(HttpServletRequest request,
HttpServletResponse response) throws Exception {
getModuleList(request, response, 3);
}
/**
* ???????????
*/
public static void setTheme(HttpServletRequest request,
HttpServletResponse response) throws Exception {
String theme = request.getParameter("theme");
com.wb.common.Value.set(request, "theme", theme);
WebUtil.setSessionValue(request, "sys.theme", theme);
}
/**
* ???????????
*/
public static void setTouchTheme(HttpServletRequest request,
HttpServletResponse response) throws Exception {
String theme = request.getParameter("theme");
com.wb.common.Value.set(request, "touchTheme", theme);
WebUtil.setSessionValue(request, "sys.touchTheme", theme);
}
/**
* ???????????????
*/
private static void searchModule(HttpServletRequest request,
HttpServletResponse response, boolean isPerm) throws Exception {
JSONArray array = new JSONArray();
String query = request.getParameter("query").toLowerCase();
if (query.isEmpty())
query = ".xwl";
doSearchFile(request, Base.modulePath, query.toLowerCase(), "", "",
array, isPerm);
WebUtil.send(response, new JSONObject().put("rows", array));
}
/**
* ?????????????????
*/
public static void searchAppModule(HttpServletRequest request,
HttpServletResponse response) throws Exception {
searchModule(request, response, false);
}
/**
* ?????????????????
*/
public static void searchPermModule(HttpServletRequest request,
HttpServletResponse response) throws Exception {
searchModule(request, response, true);
}
/**
*
* ???????????????????????
* @param request ?????
* @param folder ???
* @param searchName ????????????????????????????
* @param parentText ?????????
* @param array ?????????
* @param isPerm ???????????
* @return ?????????????????100?????true?????false?
* @throws Exception ??????????
*/
private static boolean doSearchFile(HttpServletRequest request,
File folder, String searchName, String parentText,
String parentFile, JSONArray array, boolean isPerm)
throws Exception {
File files[] = com.wb.util.FileUtil.listFiles(folder);
String path, title;
for (File file : files) {
if (file.isDirectory()) {
File indexFile = new File(file, "folder.json");
String folderTitle, folderFile;
folderFile = file.getName();
if (indexFile.exists()) {
JSONObject jo = com.wb.util.JsonUtil.readObject(indexFile);
if (!isPerm && Boolean.TRUE.equals(jo.opt("hidden")))
continue;
folderTitle = jo.optString("title");
if (folderTitle.isEmpty())
folderTitle = folderFile;
} else
folderTitle = folderFile;
if (folderTitle.startsWith("Str."))
folderTitle = com.wb.common.Str.format(request, folderTitle.substring(4));
// ???????????????
if (!isPerm) {
if (folderTitle.toLowerCase().indexOf(searchName) != -1) {
JSONObject jo = new JSONObject();
jo.put("path", parentText);
jo.put("title", folderTitle);
jo.put("file", folderFile);
jo.put("parentFile", parentFile);
array.put(jo);
if (array.length() > 99)
return true;
}
}
if (doSearchFile(request, file, searchName, com.wb.util.StringUtil.concat(
parentText, "/", folderTitle), com.wb.util.StringUtil.concat(
parentFile, "/", folderFile), array, isPerm))
return true;
} else {
path = com.wb.util.FileUtil.getModulePath(file);
if (path.endsWith(".xwl")) {
JSONObject moduleData = com.wb.common.XwlBuffer.get(path, false);
if (!isPerm
&& Boolean.TRUE.equals(moduleData.opt("hidden")))
continue;
if (isPerm
&& Boolean.FALSE.equals(moduleData
.opt("loginRequired")))
continue;
title = moduleData.optString("title");
if (title.isEmpty())
title = path.substring(path.lastIndexOf('/') + 1);
if (title.startsWith("Str."))
title = com.wb.common.Str.format(request, title.substring(4));
if (title.toLowerCase().indexOf(searchName) != -1) {
JSONObject jo = new JSONObject();
jo.put("path", parentText);
jo.put("title", title);
jo.put("file", file.getName());
jo.put("parentFile", parentFile);
array.put(jo);
if (array.length() > 99)
return true;
}
}
}
}
return false;
}
/**
* ???????????????
*
* @param dir ??
* @return true?????false?????
*/
private static boolean hasChildren(File dir) {
File files[];
files = com.wb.util.FileUtil.listFiles(dir);
if (files == null)
return false;
for (File file : files) {
if (file.isDirectory()) {
return true;
} else if (!file.getName().equals("folder.json"))
return true;
}
return false;
}
/**
* ????????????????Viewport???????????null?
* @param
* @return Viewport???null?
*/
private static JSONObject getViewport(JSONObject rootNode) throws Exception {
int i, j;
JSONObject jo;
JSONArray items;
JSONObject module = (JSONObject) ((JSONArray) rootNode.opt("children"))
.opt(0);
items = (JSONArray) module.opt("children");
if (items == null)
return null;
j = items.length();
for (i = 0; i < j; i++) {
jo = ((JSONObject) items.opt(i));
if ("tviewport".equals(jo.opt("type")))
return jo;
}
return null;
}
}
// private static void getModuleList(HttpServletRequest request,
// HttpServletResponse response, int type) throws Exception {
// /**
// String path = request.getParameter("path");
// String iconCls, fileName, pageLink, relPath, title;
// File file, base;
// int displayType = (type == 1 ? 1 : 3);
// String[] roles = Session.getRoles(request);
//
// if (path == null)
// base = Base.modulePath;
// else {
// base = new File(Base.modulePath, path);
// if (!FileUtil.isAncestor(Base.modulePath, base))
// SysUtil.accessDenied();
// }
// path = path + "/";
// ArrayList<Entry<String, Integer>> fileNames = IDE.getSortedFile(base);
// JSONObject content = null, fileObject;
// JSONArray fileArray;
// boolean isFolder;
// StringBuffer str = new StringBuffer("");
// fileArray = new JSONArray();
// int i = 0;
// for (Entry<String, Integer> entry : fileNames) {
// fileName = entry.getKey();
// file = new File(base, fileName);
// // 文件列表取自配置文件,如果不存在返回
// if (!file.exists())
// continue;
// if (!XwlBuffer.canDisplay(file, roles, displayType))
// continue;
// isFolder = file.isDirectory();
// if (isFolder) {
// if (type != 1 && !hasLoginModule(file))
// continue;
// File configFile = new File(file, "folder.json");
// if (configFile.exists())
// content = JsonUtil.readObject(configFile);
// else
// content = new JSONObject();
// } else {
// // 如果设置模块权限且非模块文件则返回
// if (type != 1 && !file.getName().endsWith(".xwl"))
// continue;
// content = XwlBuffer.get(path + fileName, false);
// // 无需登录的模块不允许设置权限
// if (type != 1
// && Boolean.FALSE.equals(content.opt("loginRequired")))
// continue;
// }
// fileObject = new JSONObject();
// title = content.optString("title");
// if (title.startsWith("Str."))
// title = Str.format(request, title.substring(4));
// fileObject.put("text", StringUtil.select(title, fileName));
// relPath = FileUtil.getModulePath(file);
// fileObject.put("path", relPath);
// fileObject.put("fileName", fileName);
// fileObject.put("inframe", Boolean.TRUE.equals(content
// .opt("inframe")));
// if (isFolder) {
// if (!hasChildren(file))
// fileObject.put("children", new JSONArray());
// } else {
// pageLink = (String) content.opt("pageLink");
// if (!StringUtil.isEmpty(pageLink))
// fileObject.put("pageLink", pageLink);
// fileObject.put("leaf", true);
// }
// fileObject.put("cls", "wb_pointer");
//
// iconCls = content.optString("iconCls");
// if (!StringUtil.isEmpty(iconCls))
// fileObject.put("iconCls", iconCls);
// if (type == 2 && !isFolder)
// fileObject.put("checked", false);
// fileArray.put(fileObject);
// if (str.length() > 0)
// str.append(" </ul></li>");
// str.append(getStringBuffer1(fileObject, i));
// i++;
// str.append(getModuleListNext(request, response, type, fileObject.get("fileName").toString()));
// }
// request.setAttribute("ModuleLust", str.toString());
// */
// String username= (String) request.getSession().getAttribute("sys.user");
// try {
// Connection conn = null;
// Statement st = null;
// ResultSet rs = null;
// StringBuilder sb = new StringBuilder();
// //sb.append("<li class=\"active\"><a href=\"\"><i class=\"fa fa-home\"></i> <span>主页</span></a></li>");
// try {
// conn = DbUtil.getConnection();
// st = conn.createStatement();
// rs = st.executeQuery("select * from wb_menu \n" +
// "where menu_id in(\n" +
// " select distinct parent_menu from wb_menu wm,wb_role_resource wrr \n" +
// " where wm.menu_id=wrr.menu_id and wrr.role_id='"+username+"'\n" +
// " and wm.parent_menu in (\n" +
// " select menu_id from wb_menu where parent_menu='-1'\n" +
// " )\n" +
// " )\n" +
// " order by order_index");
// while (rs.next()) {
// sb.append("<li class=\"menu-list\">");
// sb.append("<a style=\"margin-top:50px;\">");
// sb.append("<i class=\"fa fa-book\"></i>");
// sb.append("<span>"+rs.getString("MENU_NAME")+"</span>");
// sb.append("</a>");
// Connection connection = null;
// Statement statement = null;
// ResultSet resultSet = null;
// try{
// connection=DbUtil1.getConnection();
// statement=connection.createStatement();
// resultSet = statement.executeQuery("select wm.*,role_id from wb_menu wm,wb_role_resource wrr where wm.menu_id=wrr.menu_id "
// + "and wm.parent_menu='"+rs.getString("MENU_ID")+ "' and wrr.role_id='"+username+"'");
// while(resultSet.next()){
// sb.append("<ul class=\"sub-menu-list\">");
// sb.append("<li>");
// sb.append("<a onclick=\"changeurl('"+resultSet.getString("MENU_URL")+"','"+resultSet.getString("MENU_NAME")+"','',false,'null' )\">"
// +resultSet.getString("MENU_NAME")+"</a>");
// sb.append("</li>");
// sb.append("</ul>");
// }
// }finally {
// DbUtil1.close(resultSet);
// DbUtil1.close(statement);
// DbUtil1.close(connection);
// }
// sb.append("</li>");
// }
// request.setAttribute("ModuleLust", sb.toString());
// } finally {
// DbUtil.close(rs);
// DbUtil.close(st);
// DbUtil.close(conn);
// }
// } catch (Throwable e) {
// throw new RuntimeException(e);
// }
//
//
// getSubsList(request, response, 1);
//
//// <li class="menu-list">
//// <a>
//// <i class="fa fa-cogs"></i>
//// <span>学习</span>
//// </a>
//// <ul class="sub-menu-list">
//// <li>
//// <a onclick="changeurl('Teacher/teacher.xwl','老师表','',false ,'null' )"> 老师表</a>
//// </li>
//// <li>
//// <a onclick="changeurl('Teacher/student.xwl','学生表','',false ,'null' )"> 学生表</a>
//// </li>
//// </ul>
//// </li>
//// <li class="menu-list">
//// <a>
//// <i class="fa fa-bullhorn"></i>
//// <span>货代业务管理</span>
//// </a>
//// <ul class="sub-menu-list">
//// <li>
//// <a onclick="changeurl('cargoBusinessManage/productSpu.xwl','航线维护','',false,'null' )">航线维护</a>
//// </li>
//// </ul>
//// </li>
//
//
// //WebUtil.send(response, new JSONObject().put("children", fileArray));
// }
/**
* 修改用户中心
* @param request
* @param response
* @param type
* @throws Exception
*/
// private static void getUserList(HttpServletRequest request,HttpServletResponse response, int type) throws Exception {
// String username= (String) request.getSession().getAttribute("sys.user");
// try {
// Connection conn = null;
// Statement st = null;
// ResultSet rs = null;
// StringBuilder sb = new StringBuilder();
// // sb.append("<li class=\"active\"><a href=\"\"><i class=\"fa fa-home\"></i> <span>主页</span></a></li>");
// try {
// conn = DbUtil.getConnection();
// st = conn.createStatement();
// rs = st.executeQuery("select * from wb_menu \n" +
// "where menu_id in(\n" +
// " select distinct parent_menu from wb_menu wm,wb_role_resource wrr \n" +
// " where wm.menu_id=wrr.menu_id and wrr.role_id='"+username+"'\n" +
// " and wm.parent_menu in (\n" +
// " select menu_id from wb_menu where parent_menu in(\n" +
// " select menu_id from wb_menu where parent_menu='-1' and menu_type='2' and menu_name='用户中心')\n" +
// " ) \n" +
// " ) \n" +
// "order by order_index");
// while (rs.next()) {
// sb.append("<li class=\"menu-list\">");
// sb.append("<a>");
// sb.append("<i class=\"fa fa-book\"></i>");
// sb.append("<span>"+rs.getString("MENU_NAME")+"</span>");
// sb.append("</a>");
// Connection connection = null;
// Statement statement = null;
// ResultSet resultSet = null;
// try{
// connection=DbUtil1.getConnection();
// statement=connection.createStatement();
// resultSet = statement.executeQuery("select wm.*,role_id from wb_menu wm,wb_role_resource wrr where wm.menu_id=wrr.menu_id "
// + "and wm.parent_menu='"+rs.getString("MENU_ID")+ "' and wrr.role_id='"+username+"'");
// while(resultSet.next()){
// sb.append("<ul class=\"sub-menu-list\">");
// sb.append("<li>");
// sb.append("<a onclick=\"changeurl('"+resultSet.getString("MENU_URL")+"','"+resultSet.getString("MENU_NAME")+"','',false,'null' )\">"
// +resultSet.getString("MENU_NAME")+"</a>");
// sb.append("</li>");
// sb.append("</ul>");
// }
// }finally {
// DbUtil1.close(resultSet);
// DbUtil1.close(statement);
// DbUtil1.close(connection);
// }
// sb.append("</li>");
// }
// request.setAttribute("userLust", sb.toString());
// } finally {
// DbUtil.close(rs);
// DbUtil.close(st);
// DbUtil.close(conn);
// }
// } catch (Throwable e) {
// throw new RuntimeException(e);
// }
//
// }
/**
// * 获取模块列表树的节点列表。
// * @param type 数据请求来源类型1主页2权限模块3用户模块。
// */
// private static void getBasicsList(HttpServletRequest request,HttpServletResponse response, int type) throws Exception {
// String username= (String) request.getSession().getAttribute("sys.user");
// try {
// Connection conn = null;
// Statement st = null;
// ResultSet rs = null;
// StringBuilder sb = new StringBuilder();
// //sb.append("<li class=\"active\"><a href=\"\"><i class=\"fa fa-home\"></i> <span>主页</span></a></li>");
// try {
// conn = DbUtil.getConnection();
// st = conn.createStatement();
// rs = st.executeQuery("select * from wb_menu \n" +
// "where menu_id in(\n" +
// " select distinct parent_menu from wb_menu wm,wb_role_resource wrr \n" +
// " where wm.menu_id=wrr.menu_id and wrr.role_id='"+username+"'\n" +
// " and wm.parent_menu in (\n" +
// " select menu_id from wb_menu where parent_menu='-1' and menu_type='0' \n" +
// " )\n" +
// " )\n" +
// " order by order_index");
// while (rs.next()) {
// sb.append("<li class=\"menu-list\">");
// sb.append("<a>");
// sb.append("<i class=\"fa fa-book\"></i>");
// sb.append("<span>"+rs.getString("MENU_NAME")+"</span>");
// sb.append("</a>");
// Connection connection = null;
// Statement statement = null;
// ResultSet resultSet = null;
// try{
// connection=DbUtil1.getConnection();
// statement=connection.createStatement();
// resultSet = statement.executeQuery("select wm.*,role_id from wb_menu wm,wb_role_resource wrr where wm.menu_id=wrr.menu_id "
// + "and wm.parent_menu='"+rs.getString("MENU_ID")+ "' and wrr.role_id='"+username+"'");
// while(resultSet.next()){
// sb.append("<ul class=\"sub-menu-list\">");
// sb.append("<li>");
// sb.append("<a onclick=\"changeurl('"+resultSet.getString("MENU_URL")+"','"+resultSet.getString("MENU_NAME")+"','',false,'null' )\">"
// +resultSet.getString("MENU_NAME")+"</a>");
// sb.append("</li>");
// sb.append("</ul>");
// }
// }finally {
// DbUtil1.close(resultSet);
// DbUtil1.close(statement);
// DbUtil1.close(connection);
// }
// sb.append("</li>");
// }
// request.setAttribute("basicsLust", sb.toString());
// } finally {
// DbUtil.close(rs);
// DbUtil.close(st);
// DbUtil.close(conn);
// }
// } catch (Throwable e) {
// throw new RuntimeException(e);
// }
// }

View File

@@ -0,0 +1,140 @@
package com.ag.web.agCommon;
import com.ag.base.BaseService;
import com.ag.dynamicmodule.main.HotApplicationContext;
import com.ag.util.CommonUtil;
import com.ag.log.entity.LogParam;
import com.ag.log.OperLogServcie;
import com.ag.util.StrUtil;
import com.alibaba.fastjson.JSON;
import com.baomidou.mybatisplus.extension.service.IService;
import com.wb.util.WebUtil;
import org.apache.commons.beanutils.PropertyUtils;
import org.json.JSONObject;
import org.mybatis.spring.SqlSessionTemplate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.util.List;
/**
* Created by WangN on 2017/9/9.
* 用于可编辑Grid增删改最终保存
*/
@Service
public class ComBean extends BaseService {
@Autowired
private SqlSessionTemplate sqlSessionTemplate;
@Autowired
private OperLogServcie logServcie;
public String forItem(List list, String type, HttpServletRequest request, String dataJson) {
for (int i = 0; list != null && i < list.size(); i++) {
Object appt = (Object) list.get(i);
if (type.equals("insertSql")) {
sqlSessionTemplate.insert(request.getParameter("insertSql"), appt);
dataJson += JSON.toJSONString(appt) + ",";
}
if (type.equals("updateSql")) {
try {
PropertyUtils.setProperty(appt, "updatedBy", (String) request.getSession().getAttribute("sys.username"));
PropertyUtils.setProperty(appt, "updatedOn", super.getNow());
} catch (Exception e) {
e.printStackTrace();
}
sqlSessionTemplate.update(request.getParameter("updateSql"), appt);
dataJson += JSON.toJSONString(appt) + ",";
}
if (type.equals("deleteSql")) {
sqlSessionTemplate.delete(request.getParameter("deleteSql"), appt);
dataJson += JSON.toJSONString(appt) + ",";
}
}
if (dataJson != null) {
dataJson = dataJson.substring(0, dataJson.length() - 1);
dataJson = dataJson.substring(4, dataJson.length());
}
return dataJson;
}
@Transactional
public void saveGrid(JSONObject object, HttpServletResponse response, HttpServletRequest request) throws ClassNotFoundException, NoSuchMethodException {
// SpringApplicationContext.getBean(bean)
Class objectClass = Class.forName(request.getParameter("className"));
List createList = CommonUtil.getBeanlist(object, "datatable", "create", objectClass);
List updateList = CommonUtil.getBeanlist(object, "datatable", "update", objectClass);
List destroyList = CommonUtil.getBeanlist(object, "datatable", "destroy", objectClass);
String dataJson=null;
String createReturn=forItem(createList, "insertSql", request, dataJson);
String updateReturn=forItem(updateList, "updateSql", request, dataJson);
//删除的就不返回了
forItem(destroyList, "deleteSql", request, dataJson);
//拼JSON
if(createReturn!=null){
dataJson+="["+createReturn;
dataJson=dataJson.substring(4,dataJson.length());
}else{
dataJson+="[";
dataJson=dataJson.substring(4,dataJson.length());
}
if(updateReturn!=null&&createReturn!=null){
dataJson+=","+updateReturn+"]";
}else if (updateReturn!=null&&createReturn==null){
dataJson+=updateReturn+"]";
}else{
dataJson+="]";
}
if (object.has("keyword") && object.has("bizType")){
try {
LogParam logParam = new LogParam(object, object.getString("keyword"), StrUtil.toUpperCol(objectClass.getSimpleName()), null, "datatable");
logParam.setMenuName(object.getString("bizType"));
logServcie.saveLogGrid(logParam, response);
} catch (IOException e) {
e.printStackTrace();
}
}
try {
WebUtil.send(response, dataJson);
} catch(IOException e) {
e.printStackTrace();
}
}
/**
* @Description: mybatisPlus 可编辑表格
* @return: void
* @Author: fengjun
* @Date: 2022/8/11
*/
public void saveGridPlus(JSONObject object, HttpServletResponse response, HttpServletRequest request) throws Exception {
Class objectClass = Class.forName(request.getParameter("className"));
IService service;
if (StrUtil.isNotEmpty(request.getParameter("service"))) {
Class serviceClass = Class.forName(request.getParameter("service"));
service = (IService) HotApplicationContext.getBean(serviceClass);
} else {
String serviceImpl = objectClass.getSimpleName()+"ServiceImpl";
serviceImpl = serviceImpl.substring(0, 1).toLowerCase() + serviceImpl.substring(1);
service = (IService) HotApplicationContext.getBean(serviceImpl);
}
List createList = CommonUtil.getBeanlist(object, "datatable", "create", objectClass);
List updateList = CommonUtil.getBeanlist(object, "datatable", "update", objectClass);
List destroyList = CommonUtil.getBeanlist(object, "datatable", "destroy", objectClass);
service.saveOrUpdateBatch(createList);
service.saveOrUpdateBatch(updateList);
service.removeBatchByIds(destroyList);
}
}

View File

@@ -0,0 +1,72 @@
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:util="http://www.springframework.org/schema/util"
xmlns:context="http://www.springframework.org/schema/context"
xmlns:tx="http://www.springframework.org/schema/tx" xmlns:aop="http://www.springframework.org/schema/aop"
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans.xsd
http://www.springframework.org/schema/context
http://www.springframework.org/schema/context/spring-context-3.0.xsd
http://www.springframework.org/schema/tx
http://www.springframework.org/schema/tx/spring-tx-3.0.xsd http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop.xsd
http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util-3.1.xsd">
<context:component-scan base-package="com.ag"/>
<!-- <aop:aspectj-autoproxy/> &lt;!&ndash; 要添加本行 &ndash;&gt;-->
<import resource="classpath*:/applicationContext-mapper.xml" />
<bean id="fodataBaseSource" class="com.ag.config.BaseDataSourceCfg"/>
<bean id="mybatisConfig" class="com.baomidou.mybatisplus.core.MybatisConfiguration">
<property name="mapUnderscoreToCamelCase" value="true"/>
<property name="logImpl" value="org.apache.ibatis.logging.stdout.StdOutImpl"/>
<!-- 部分数据库不识别默认的NULL类型比如oracle需要配置该属性 -->
<property name="jdbcTypeForNull">
<util:constant static-field="org.apache.ibatis.type.JdbcType.NULL"/>
</property>
</bean>
<bean id="sqlSessionFactory" class="com.baomidou.mybatisplus.extension.spring.MybatisSqlSessionFactoryBean">
<property name="dataSource" ref="fodataBaseSource"/>
<property name="configuration" ref="mybatisConfig"/> <!-- 非必须 -->
<property name="mapperLocations">
<list>
<value>classpath*:mapper/*.xml</value>
<value>classpath:platform/*/*Mapper.xml</value>
<value>classpath:basecode/*Mapper.xml</value>
<value>classpath:ctariff/*Mapper.xml</value>
</list>
</property>
<property name="plugins">
<array>
<bean class="com.baomidou.mybatisplus.extension.plugins.MybatisPlusInterceptor">
<property name="interceptors">
<array>
<bean class="com.baomidou.mybatisplus.extension.plugins.inner.PaginationInnerInterceptor">
<constructor-arg type="com.baomidou.mybatisplus.annotation.DbType" value="MYSQL"/>
</bean>
</array>
</property>
</bean>
</array>
</property>
</bean>
<bean id="sqlSessionTemplate" class="org.mybatis.spring.SqlSessionTemplate">
<constructor-arg index="0" ref="sqlSessionFactory" />
</bean>
<!-- 事务管理器 -->
<bean id="txManagerFo"
class="org.springframework.jdbc.datasource.DataSourceTransactionManager">
<property name="dataSource" ref="fodataBaseSource" />
</bean>
<!-- 事务注解驱动,标注@Transactional的类和方法将具有事务性 -->
<tx:annotation-driven transaction-manager="txManagerFo" proxy-target-class="true" />
<bean id="jdbcTemplatebusiness"
class="org.springframework.jdbc.core.JdbcTemplate" lazy-init="false">
<property name="dataSource" ref="fodataBaseSource"/>
</bean>
</beans>

View File

@@ -0,0 +1,20 @@
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:context="http://www.springframework.org/schema/context"
xmlns:mvc="http://www.springframework.org/schema/mvc"
xmlns:task="http://www.springframework.org/schema/task" xmlns:tx="http://www.springframework.org/schema/tx"
xmlns:util="http://www.springframework.org/schema/util"
xsi:schemaLocation="http://www.springframework.org/schema/mvc
http://www.springframework.org/schema/mvc/spring-mvc.xsd
http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans.xsd
http://www.springframework.org/schema/context
http://www.springframework.org/schema/context/spring-context-3.0.xsd
http://www.springframework.org/schema/task http://www.springframework.org/schema/task/spring-task-3.0.xsd http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx.xsd http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util.xsd">
<bean class="org.mybatis.spring.mapper.MapperScannerConfigurer">
<property name="basePackage" value="com.ag.demo.mapper;com.ag.example.mapper"/>
</bean>
</beans>

View File

@@ -0,0 +1,326 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="resources/basecode.CClientInvoiceMapper">
<resultMap id="BaseResultMap" type="com.ag.dynamicmodule.basecode.pojo.CClientInvoice">
<!--
WARNING - @mbg.generated
This element is automatically generated by MyBatis Generator, do not modify.
-->
<id column="ID" jdbcType="VARCHAR" property="id" />
<result column="CLIENT_CODE" jdbcType="VARCHAR" property="clientCode" />
<result column="INV_NAME" jdbcType="VARCHAR" property="invName" />
<result column="ADDRESS_CH" jdbcType="VARCHAR" property="addressCh" />
<result column="ADDRESS_EN" jdbcType="VARCHAR" property="addressEn" />
<result column="RELA_TELEX" jdbcType="VARCHAR" property="relaTelex" />
<result column="RELA_MAN" jdbcType="VARCHAR" property="relaMan" />
<result column="SETTLE_WAY_ID" jdbcType="VARCHAR" property="settleWayId" />
<result column="INV_KIND_FLAG" jdbcType="VARCHAR" property="invKindFlag" />
<result column="INV_TAX_RATE" jdbcType="DECIMAL" property="invTaxRate" />
<result column="INV_TAX_NO" jdbcType="VARCHAR" property="invTaxNo" />
<result column="INV_TEL" jdbcType="VARCHAR" property="invTel" />
<result column="INV_ADDRESS" jdbcType="VARCHAR" property="invAddress" />
<result column="INV_CNY_BANK" jdbcType="VARCHAR" property="invCnyBank" />
<result column="INV_CNY_BANK_NO" jdbcType="VARCHAR" property="invCnyBankNo" />
<result column="INV_USD_BANK" jdbcType="VARCHAR" property="invUsdBank" />
<result column="INV_USD_BANK_NO" jdbcType="VARCHAR" property="invUsdBankNo" />
<result column="NOTES" jdbcType="VARCHAR" property="notes" />
<result column="CREATED_BY" jdbcType="VARCHAR" property="createdBy" />
<result column="CREATED_ON" jdbcType="TIMESTAMP" property="createdOn" />
<result column="UPDATED_BY" jdbcType="VARCHAR" property="updatedBy" />
<result column="UPDATED_ON" jdbcType="TIMESTAMP" property="updatedOn" />
</resultMap>
<sql id="Base_Column_List">
<!--
WARNING - @mbg.generated
This element is automatically generated by MyBatis Generator, do not modify.
-->
ID, CLIENT_CODE, INV_NAME, ADDRESS_CH, ADDRESS_EN, RELA_TELEX, RELA_MAN, SETTLE_WAY_ID,
INV_KIND_FLAG, INV_TAX_RATE, INV_TAX_NO, INV_TEL, INV_ADDRESS, INV_CNY_BANK, INV_CNY_BANK_NO,
INV_USD_BANK, INV_USD_BANK_NO, NOTES, CREATED_BY, CREATED_ON, UPDATED_BY, UPDATED_ON
</sql>
<select id="selectByPrimaryKey" parameterType="java.lang.String" resultMap="BaseResultMap">
<!--
WARNING - @mbg.generated
This element is automatically generated by MyBatis Generator, do not modify.
-->
select
<include refid="Base_Column_List" />
from c_client_invoice
where ID = #{id,jdbcType=VARCHAR}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.String">
<!--
WARNING - @mbg.generated
This element is automatically generated by MyBatis Generator, do not modify.
-->
delete from c_client_invoice
where ID = #{id,jdbcType=VARCHAR}
</delete>
<insert id="insert" parameterType="com.ag.dynamicmodule.basecode.pojo.CClientInvoice">
<!--
WARNING - @mbg.generated
This element is automatically generated by MyBatis Generator, do not modify.
-->
insert into c_client_invoice (ID, CLIENT_CODE, INV_NAME,
ADDRESS_CH, ADDRESS_EN, RELA_TELEX,
RELA_MAN, SETTLE_WAY_ID, INV_KIND_FLAG,
INV_TAX_RATE, INV_TAX_NO, INV_TEL,
INV_ADDRESS, INV_CNY_BANK, INV_CNY_BANK_NO,
INV_USD_BANK, INV_USD_BANK_NO, NOTES,
CREATED_BY, CREATED_ON, UPDATED_BY,
UPDATED_ON)
values (#{id,jdbcType=VARCHAR}, #{clientCode,jdbcType=VARCHAR}, #{invName,jdbcType=VARCHAR},
#{addressCh,jdbcType=VARCHAR}, #{addressEn,jdbcType=VARCHAR}, #{relaTelex,jdbcType=VARCHAR},
#{relaMan,jdbcType=VARCHAR}, #{settleWayId,jdbcType=VARCHAR}, #{invKindFlag,jdbcType=VARCHAR},
#{invTaxRate,jdbcType=DECIMAL}, #{invTaxNo,jdbcType=VARCHAR}, #{invTel,jdbcType=VARCHAR},
#{invAddress,jdbcType=VARCHAR}, #{invCnyBank,jdbcType=VARCHAR}, #{invCnyBankNo,jdbcType=VARCHAR},
#{invUsdBank,jdbcType=VARCHAR}, #{invUsdBankNo,jdbcType=VARCHAR}, #{notes,jdbcType=VARCHAR},
#{createdBy,jdbcType=VARCHAR}, #{createdOn,jdbcType=TIMESTAMP}, #{updatedBy,jdbcType=VARCHAR},
#{updatedOn,jdbcType=TIMESTAMP})
</insert>
<insert id="insertSelective" parameterType="com.ag.dynamicmodule.basecode.pojo.CClientInvoice">
<!--
WARNING - @mbg.generated
This element is automatically generated by MyBatis Generator, do not modify.
-->
insert into c_client_invoice
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">
ID,
</if>
<if test="clientCode != null">
CLIENT_CODE,
</if>
<if test="invName != null">
INV_NAME,
</if>
<if test="addressCh != null">
ADDRESS_CH,
</if>
<if test="addressEn != null">
ADDRESS_EN,
</if>
<if test="relaTelex != null">
RELA_TELEX,
</if>
<if test="relaMan != null">
RELA_MAN,
</if>
<if test="settleWayId != null">
SETTLE_WAY_ID,
</if>
<if test="invKindFlag != null">
INV_KIND_FLAG,
</if>
<if test="invTaxRate != null">
INV_TAX_RATE,
</if>
<if test="invTaxNo != null">
INV_TAX_NO,
</if>
<if test="invTel != null">
INV_TEL,
</if>
<if test="invAddress != null">
INV_ADDRESS,
</if>
<if test="invCnyBank != null">
INV_CNY_BANK,
</if>
<if test="invCnyBankNo != null">
INV_CNY_BANK_NO,
</if>
<if test="invUsdBank != null">
INV_USD_BANK,
</if>
<if test="invUsdBankNo != null">
INV_USD_BANK_NO,
</if>
<if test="notes != null">
NOTES,
</if>
<if test="createdBy != null">
CREATED_BY,
</if>
<if test="createdOn != null">
CREATED_ON,
</if>
<if test="updatedBy != null">
UPDATED_BY,
</if>
<if test="updatedOn != null">
UPDATED_ON,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null">
#{id,jdbcType=VARCHAR},
</if>
<if test="clientCode != null">
#{clientCode,jdbcType=VARCHAR},
</if>
<if test="invName != null">
#{invName,jdbcType=VARCHAR},
</if>
<if test="addressCh != null">
#{addressCh,jdbcType=VARCHAR},
</if>
<if test="addressEn != null">
#{addressEn,jdbcType=VARCHAR},
</if>
<if test="relaTelex != null">
#{relaTelex,jdbcType=VARCHAR},
</if>
<if test="relaMan != null">
#{relaMan,jdbcType=VARCHAR},
</if>
<if test="settleWayId != null">
#{settleWayId,jdbcType=VARCHAR},
</if>
<if test="invKindFlag != null">
#{invKindFlag,jdbcType=VARCHAR},
</if>
<if test="invTaxRate != null">
#{invTaxRate,jdbcType=DECIMAL},
</if>
<if test="invTaxNo != null">
#{invTaxNo,jdbcType=VARCHAR},
</if>
<if test="invTel != null">
#{invTel,jdbcType=VARCHAR},
</if>
<if test="invAddress != null">
#{invAddress,jdbcType=VARCHAR},
</if>
<if test="invCnyBank != null">
#{invCnyBank,jdbcType=VARCHAR},
</if>
<if test="invCnyBankNo != null">
#{invCnyBankNo,jdbcType=VARCHAR},
</if>
<if test="invUsdBank != null">
#{invUsdBank,jdbcType=VARCHAR},
</if>
<if test="invUsdBankNo != null">
#{invUsdBankNo,jdbcType=VARCHAR},
</if>
<if test="notes != null">
#{notes,jdbcType=VARCHAR},
</if>
<if test="createdBy != null">
#{createdBy,jdbcType=VARCHAR},
</if>
<if test="createdOn != null">
#{createdOn,jdbcType=TIMESTAMP},
</if>
<if test="updatedBy != null">
#{updatedBy,jdbcType=VARCHAR},
</if>
<if test="updatedOn != null">
#{updatedOn,jdbcType=TIMESTAMP},
</if>
</trim>
</insert>
<update id="updateByPrimaryKeySelective" parameterType="com.ag.dynamicmodule.basecode.pojo.CClientInvoice">
<!--
WARNING - @mbg.generated
This element is automatically generated by MyBatis Generator, do not modify.
-->
update c_client_invoice
<set>
<if test="clientCode != null">
CLIENT_CODE = #{clientCode,jdbcType=VARCHAR},
</if>
<if test="invName != null">
INV_NAME = #{invName,jdbcType=VARCHAR},
</if>
<if test="addressCh != null">
ADDRESS_CH = #{addressCh,jdbcType=VARCHAR},
</if>
<if test="addressEn != null">
ADDRESS_EN = #{addressEn,jdbcType=VARCHAR},
</if>
<if test="relaTelex != null">
RELA_TELEX = #{relaTelex,jdbcType=VARCHAR},
</if>
<if test="relaMan != null">
RELA_MAN = #{relaMan,jdbcType=VARCHAR},
</if>
<if test="settleWayId != null">
SETTLE_WAY_ID = #{settleWayId,jdbcType=VARCHAR},
</if>
<if test="invKindFlag != null">
INV_KIND_FLAG = #{invKindFlag,jdbcType=VARCHAR},
</if>
<if test="invTaxRate != null">
INV_TAX_RATE = #{invTaxRate,jdbcType=DECIMAL},
</if>
<if test="invTaxNo != null">
INV_TAX_NO = #{invTaxNo,jdbcType=VARCHAR},
</if>
<if test="invTel != null">
INV_TEL = #{invTel,jdbcType=VARCHAR},
</if>
<if test="invAddress != null">
INV_ADDRESS = #{invAddress,jdbcType=VARCHAR},
</if>
<if test="invCnyBank != null">
INV_CNY_BANK = #{invCnyBank,jdbcType=VARCHAR},
</if>
<if test="invCnyBankNo != null">
INV_CNY_BANK_NO = #{invCnyBankNo,jdbcType=VARCHAR},
</if>
<if test="invUsdBank != null">
INV_USD_BANK = #{invUsdBank,jdbcType=VARCHAR},
</if>
<if test="invUsdBankNo != null">
INV_USD_BANK_NO = #{invUsdBankNo,jdbcType=VARCHAR},
</if>
<if test="notes != null">
NOTES = #{notes,jdbcType=VARCHAR},
</if>
<if test="createdBy != null">
CREATED_BY = #{createdBy,jdbcType=VARCHAR},
</if>
<if test="createdOn != null">
CREATED_ON = #{createdOn,jdbcType=TIMESTAMP},
</if>
<if test="updatedBy != null">
UPDATED_BY = #{updatedBy,jdbcType=VARCHAR},
</if>
<if test="updatedOn != null">
UPDATED_ON = #{updatedOn,jdbcType=TIMESTAMP},
</if>
</set>
where ID = #{id,jdbcType=VARCHAR}
</update>
<update id="updateByPrimaryKey" parameterType="com.ag.dynamicmodule.basecode.pojo.CClientInvoice">
<!--
WARNING - @mbg.generated
This element is automatically generated by MyBatis Generator, do not modify.
-->
update c_client_invoice
set CLIENT_CODE = #{clientCode,jdbcType=VARCHAR},
INV_NAME = #{invName,jdbcType=VARCHAR},
ADDRESS_CH = #{addressCh,jdbcType=VARCHAR},
ADDRESS_EN = #{addressEn,jdbcType=VARCHAR},
RELA_TELEX = #{relaTelex,jdbcType=VARCHAR},
RELA_MAN = #{relaMan,jdbcType=VARCHAR},
SETTLE_WAY_ID = #{settleWayId,jdbcType=VARCHAR},
INV_KIND_FLAG = #{invKindFlag,jdbcType=VARCHAR},
INV_TAX_RATE = #{invTaxRate,jdbcType=DECIMAL},
INV_TAX_NO = #{invTaxNo,jdbcType=VARCHAR},
INV_TEL = #{invTel,jdbcType=VARCHAR},
INV_ADDRESS = #{invAddress,jdbcType=VARCHAR},
INV_CNY_BANK = #{invCnyBank,jdbcType=VARCHAR},
INV_CNY_BANK_NO = #{invCnyBankNo,jdbcType=VARCHAR},
INV_USD_BANK = #{invUsdBank,jdbcType=VARCHAR},
INV_USD_BANK_NO = #{invUsdBankNo,jdbcType=VARCHAR},
NOTES = #{notes,jdbcType=VARCHAR},
CREATED_BY = #{createdBy,jdbcType=VARCHAR},
CREATED_ON = #{createdOn,jdbcType=TIMESTAMP},
UPDATED_BY = #{updatedBy,jdbcType=VARCHAR},
UPDATED_ON = #{updatedOn,jdbcType=TIMESTAMP}
where ID = #{id,jdbcType=VARCHAR}
</update>
</mapper>

View File

@@ -0,0 +1,350 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="resources/basecode.CClientLinkmanMapper">
<resultMap id="BaseResultMap" type="com.ag.dynamicmodule.basecode.pojo.CClientLinkman">
<!--
WARNING - @mbg.generated
This element is automatically generated by MyBatis Generator, do not modify.
-->
<id column="ID" jdbcType="VARCHAR" property="id" />
<result column="CLIENT_CODE" jdbcType="VARCHAR" property="clientCode" />
<result column="TENANCY_ID" jdbcType="VARCHAR" property="tenancyId" />
<result column="LINK_MAN" jdbcType="VARCHAR" property="linkMan" />
<result column="DUTY" jdbcType="VARCHAR" property="duty" />
<result column="SEX" jdbcType="VARCHAR" property="sex" />
<result column="ADDRESS_TXT" jdbcType="VARCHAR" property="addressTxt" />
<result column="POSTAL_CODE" jdbcType="VARCHAR" property="postalCode" />
<result column="TEL" jdbcType="VARCHAR" property="tel" />
<result column="FAX" jdbcType="VARCHAR" property="fax" />
<result column="HANDSET" jdbcType="VARCHAR" property="handset" />
<result column="HOME_PAGE" jdbcType="VARCHAR" property="homePage" />
<result column="EMAIL" jdbcType="VARCHAR" property="email" />
<result column="BIRTHDAT" jdbcType="DATE" property="birthdat" />
<result column="LOVE_TXT" jdbcType="VARCHAR" property="loveTxt" />
<result column="HOME_ADDR" jdbcType="VARCHAR" property="homeAddr" />
<result column="RELA_POST" jdbcType="VARCHAR" property="relaPost" />
<result column="LINK_TEL" jdbcType="VARCHAR" property="linkTel" />
<result column="LINK_FAX" jdbcType="VARCHAR" property="linkFax" />
<result column="NOTES" jdbcType="VARCHAR" property="notes" />
<result column="CREATED_BY" jdbcType="VARCHAR" property="createdBy" />
<result column="CREATED_ON" jdbcType="TIMESTAMP" property="createdOn" />
<result column="UPDATED_BY" jdbcType="VARCHAR" property="updatedBy" />
<result column="UPDATED_ON" jdbcType="TIMESTAMP" property="updatedOn" />
</resultMap>
<sql id="Base_Column_List">
<!--
WARNING - @mbg.generated
This element is automatically generated by MyBatis Generator, do not modify.
-->
ID, CLIENT_CODE, TENANCY_ID, LINK_MAN, DUTY, SEX, ADDRESS_TXT, POSTAL_CODE, TEL,
FAX, HANDSET, HOME_PAGE, EMAIL, BIRTHDAT, LOVE_TXT, HOME_ADDR, RELA_POST, LINK_TEL,
LINK_FAX, NOTES, CREATED_BY, CREATED_ON, UPDATED_BY, UPDATED_ON
</sql>
<select id="selectByPrimaryKey" parameterType="java.lang.String" resultMap="BaseResultMap">
<!--
WARNING - @mbg.generated
This element is automatically generated by MyBatis Generator, do not modify.
-->
select
<include refid="Base_Column_List" />
from c_client_linkman
where ID = #{id,jdbcType=VARCHAR}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.String">
<!--
WARNING - @mbg.generated
This element is automatically generated by MyBatis Generator, do not modify.
-->
delete from c_client_linkman
where ID = #{id,jdbcType=VARCHAR}
</delete>
<insert id="insert" parameterType="com.ag.dynamicmodule.basecode.pojo.CClientLinkman">
<!--
WARNING - @mbg.generated
This element is automatically generated by MyBatis Generator, do not modify.
-->
insert into c_client_linkman (ID, CLIENT_CODE, TENANCY_ID,
LINK_MAN, DUTY, SEX,
ADDRESS_TXT, POSTAL_CODE, TEL,
FAX, HANDSET, HOME_PAGE,
EMAIL, BIRTHDAT, LOVE_TXT,
HOME_ADDR, RELA_POST, LINK_TEL,
LINK_FAX, NOTES, CREATED_BY,
CREATED_ON, UPDATED_BY, UPDATED_ON
)
values (#{id,jdbcType=VARCHAR}, #{clientCode,jdbcType=VARCHAR}, #{tenancyId,jdbcType=VARCHAR},
#{linkMan,jdbcType=VARCHAR}, #{duty,jdbcType=VARCHAR}, #{sex,jdbcType=VARCHAR},
#{addressTxt,jdbcType=VARCHAR}, #{postalCode,jdbcType=VARCHAR}, #{tel,jdbcType=VARCHAR},
#{fax,jdbcType=VARCHAR}, #{handset,jdbcType=VARCHAR}, #{homePage,jdbcType=VARCHAR},
#{email,jdbcType=VARCHAR}, #{birthdat,jdbcType=DATE}, #{loveTxt,jdbcType=VARCHAR},
#{homeAddr,jdbcType=VARCHAR}, #{relaPost,jdbcType=VARCHAR}, #{linkTel,jdbcType=VARCHAR},
#{linkFax,jdbcType=VARCHAR}, #{notes,jdbcType=VARCHAR}, #{createdBy,jdbcType=VARCHAR},
#{createdOn,jdbcType=TIMESTAMP}, #{updatedBy,jdbcType=VARCHAR}, #{updatedOn,jdbcType=TIMESTAMP}
)
</insert>
<insert id="insertSelective" parameterType="com.ag.dynamicmodule.basecode.pojo.CClientLinkman">
<!--
WARNING - @mbg.generated
This element is automatically generated by MyBatis Generator, do not modify.
-->
insert into c_client_linkman
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">
ID,
</if>
<if test="clientCode != null">
CLIENT_CODE,
</if>
<if test="tenancyId != null">
TENANCY_ID,
</if>
<if test="linkMan != null">
LINK_MAN,
</if>
<if test="duty != null">
DUTY,
</if>
<if test="sex != null">
SEX,
</if>
<if test="addressTxt != null">
ADDRESS_TXT,
</if>
<if test="postalCode != null">
POSTAL_CODE,
</if>
<if test="tel != null">
TEL,
</if>
<if test="fax != null">
FAX,
</if>
<if test="handset != null">
HANDSET,
</if>
<if test="homePage != null">
HOME_PAGE,
</if>
<if test="email != null">
EMAIL,
</if>
<if test="birthdat != null">
BIRTHDAT,
</if>
<if test="loveTxt != null">
LOVE_TXT,
</if>
<if test="homeAddr != null">
HOME_ADDR,
</if>
<if test="relaPost != null">
RELA_POST,
</if>
<if test="linkTel != null">
LINK_TEL,
</if>
<if test="linkFax != null">
LINK_FAX,
</if>
<if test="notes != null">
NOTES,
</if>
<if test="createdBy != null">
CREATED_BY,
</if>
<if test="createdOn != null">
CREATED_ON,
</if>
<if test="updatedBy != null">
UPDATED_BY,
</if>
<if test="updatedOn != null">
UPDATED_ON,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null">
#{id,jdbcType=VARCHAR},
</if>
<if test="clientCode != null">
#{clientCode,jdbcType=VARCHAR},
</if>
<if test="tenancyId != null">
#{tenancyId,jdbcType=VARCHAR},
</if>
<if test="linkMan != null">
#{linkMan,jdbcType=VARCHAR},
</if>
<if test="duty != null">
#{duty,jdbcType=VARCHAR},
</if>
<if test="sex != null">
#{sex,jdbcType=VARCHAR},
</if>
<if test="addressTxt != null">
#{addressTxt,jdbcType=VARCHAR},
</if>
<if test="postalCode != null">
#{postalCode,jdbcType=VARCHAR},
</if>
<if test="tel != null">
#{tel,jdbcType=VARCHAR},
</if>
<if test="fax != null">
#{fax,jdbcType=VARCHAR},
</if>
<if test="handset != null">
#{handset,jdbcType=VARCHAR},
</if>
<if test="homePage != null">
#{homePage,jdbcType=VARCHAR},
</if>
<if test="email != null">
#{email,jdbcType=VARCHAR},
</if>
<if test="birthdat != null">
#{birthdat,jdbcType=DATE},
</if>
<if test="loveTxt != null">
#{loveTxt,jdbcType=VARCHAR},
</if>
<if test="homeAddr != null">
#{homeAddr,jdbcType=VARCHAR},
</if>
<if test="relaPost != null">
#{relaPost,jdbcType=VARCHAR},
</if>
<if test="linkTel != null">
#{linkTel,jdbcType=VARCHAR},
</if>
<if test="linkFax != null">
#{linkFax,jdbcType=VARCHAR},
</if>
<if test="notes != null">
#{notes,jdbcType=VARCHAR},
</if>
<if test="createdBy != null">
#{createdBy,jdbcType=VARCHAR},
</if>
<if test="createdOn != null">
#{createdOn,jdbcType=TIMESTAMP},
</if>
<if test="updatedBy != null">
#{updatedBy,jdbcType=VARCHAR},
</if>
<if test="updatedOn != null">
#{updatedOn,jdbcType=TIMESTAMP},
</if>
</trim>
</insert>
<update id="updateByPrimaryKeySelective" parameterType="com.ag.dynamicmodule.basecode.pojo.CClientLinkman">
<!--
WARNING - @mbg.generated
This element is automatically generated by MyBatis Generator, do not modify.
-->
update c_client_linkman
<set>
<if test="clientCode != null">
CLIENT_CODE = #{clientCode,jdbcType=VARCHAR},
</if>
<if test="tenancyId != null">
TENANCY_ID = #{tenancyId,jdbcType=VARCHAR},
</if>
<if test="linkMan != null">
LINK_MAN = #{linkMan,jdbcType=VARCHAR},
</if>
<if test="duty != null">
DUTY = #{duty,jdbcType=VARCHAR},
</if>
<if test="sex != null">
SEX = #{sex,jdbcType=VARCHAR},
</if>
<if test="addressTxt != null">
ADDRESS_TXT = #{addressTxt,jdbcType=VARCHAR},
</if>
<if test="postalCode != null">
POSTAL_CODE = #{postalCode,jdbcType=VARCHAR},
</if>
<if test="tel != null">
TEL = #{tel,jdbcType=VARCHAR},
</if>
<if test="fax != null">
FAX = #{fax,jdbcType=VARCHAR},
</if>
<if test="handset != null">
HANDSET = #{handset,jdbcType=VARCHAR},
</if>
<if test="homePage != null">
HOME_PAGE = #{homePage,jdbcType=VARCHAR},
</if>
<if test="email != null">
EMAIL = #{email,jdbcType=VARCHAR},
</if>
<if test="birthdat != null">
BIRTHDAT = #{birthdat,jdbcType=DATE},
</if>
<if test="loveTxt != null">
LOVE_TXT = #{loveTxt,jdbcType=VARCHAR},
</if>
<if test="homeAddr != null">
HOME_ADDR = #{homeAddr,jdbcType=VARCHAR},
</if>
<if test="relaPost != null">
RELA_POST = #{relaPost,jdbcType=VARCHAR},
</if>
<if test="linkTel != null">
LINK_TEL = #{linkTel,jdbcType=VARCHAR},
</if>
<if test="linkFax != null">
LINK_FAX = #{linkFax,jdbcType=VARCHAR},
</if>
<if test="notes != null">
NOTES = #{notes,jdbcType=VARCHAR},
</if>
<if test="createdBy != null">
CREATED_BY = #{createdBy,jdbcType=VARCHAR},
</if>
<if test="createdOn != null">
CREATED_ON = #{createdOn,jdbcType=TIMESTAMP},
</if>
<if test="updatedBy != null">
UPDATED_BY = #{updatedBy,jdbcType=VARCHAR},
</if>
<if test="updatedOn != null">
UPDATED_ON = #{updatedOn,jdbcType=TIMESTAMP},
</if>
</set>
where ID = #{id,jdbcType=VARCHAR}
</update>
<update id="updateByPrimaryKey" parameterType="com.ag.dynamicmodule.basecode.pojo.CClientLinkman">
<!--
WARNING - @mbg.generated
This element is automatically generated by MyBatis Generator, do not modify.
-->
update c_client_linkman
set CLIENT_CODE = #{clientCode,jdbcType=VARCHAR},
TENANCY_ID = #{tenancyId,jdbcType=VARCHAR},
LINK_MAN = #{linkMan,jdbcType=VARCHAR},
DUTY = #{duty,jdbcType=VARCHAR},
SEX = #{sex,jdbcType=VARCHAR},
ADDRESS_TXT = #{addressTxt,jdbcType=VARCHAR},
POSTAL_CODE = #{postalCode,jdbcType=VARCHAR},
TEL = #{tel,jdbcType=VARCHAR},
FAX = #{fax,jdbcType=VARCHAR},
HANDSET = #{handset,jdbcType=VARCHAR},
HOME_PAGE = #{homePage,jdbcType=VARCHAR},
EMAIL = #{email,jdbcType=VARCHAR},
BIRTHDAT = #{birthdat,jdbcType=DATE},
LOVE_TXT = #{loveTxt,jdbcType=VARCHAR},
HOME_ADDR = #{homeAddr,jdbcType=VARCHAR},
RELA_POST = #{relaPost,jdbcType=VARCHAR},
LINK_TEL = #{linkTel,jdbcType=VARCHAR},
LINK_FAX = #{linkFax,jdbcType=VARCHAR},
NOTES = #{notes,jdbcType=VARCHAR},
CREATED_BY = #{createdBy,jdbcType=VARCHAR},
CREATED_ON = #{createdOn,jdbcType=TIMESTAMP},
UPDATED_BY = #{updatedBy,jdbcType=VARCHAR},
UPDATED_ON = #{updatedOn,jdbcType=TIMESTAMP}
where ID = #{id,jdbcType=VARCHAR}
</update>
</mapper>

View File

@@ -0,0 +1,267 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="resources/basecode.CClientMapper">
<resultMap id="BaseResultMap" type="com.ag.dynamicmodule.basecode.pojo.CClient">
<!--
WARNING - @mbg.generated
This element is automatically generated by MyBatis Generator, do not modify.
-->
<id column="ID" jdbcType="VARCHAR" property="id" />
<result column="TENANCY_ID" jdbcType="VARCHAR" property="tenancyId" />
<result column="CLIENT_CODE" jdbcType="VARCHAR" property="clientCode" />
<result column="CLIENT_NAME" jdbcType="VARCHAR" property="clientName" />
<result column="EN_CLIENT_NAME" jdbcType="VARCHAR" property="enClientName" />
<result column="CLIENT_SHORT" jdbcType="VARCHAR" property="clientShort" />
<result column="CLIENT_SHORT_EN" jdbcType="VARCHAR" property="clientShortEn" />
<result column="CLIENT_TYPE" jdbcType="VARCHAR" property="clientType" />
<result column="CREATED_BY" jdbcType="VARCHAR" property="createdBy" />
<result column="CREATED_ON" jdbcType="TIMESTAMP" property="createdOn" />
<result column="UPDATED_BY" jdbcType="VARCHAR" property="updatedBy" />
<result column="UPDATED_ON" jdbcType="TIMESTAMP" property="updatedOn" />
<result column="INVALID_FLAG" jdbcType="DECIMAL" property="invalidFlag" />
<result column="INVALID_BY" jdbcType="VARCHAR" property="invalidBy" />
<result column="INVALID_ON" jdbcType="TIMESTAMP" property="invalidOn" />
<result column="INITIALS" jdbcType="VARCHAR" property="initials" />
<result column="COUNT_CLIENT_CODE" jdbcType="VARCHAR" property="countClientCode" />
</resultMap>
<sql id="Base_Column_List">
<!--
WARNING - @mbg.generated
This element is automatically generated by MyBatis Generator, do not modify.
-->
ID, TENANCY_ID, CLIENT_CODE, CLIENT_NAME, EN_CLIENT_NAME, CLIENT_SHORT, CLIENT_SHORT_EN,
CLIENT_TYPE, CREATED_BY, CREATED_ON, UPDATED_BY, UPDATED_ON, INVALID_FLAG, INVALID_BY,
INVALID_ON, INITIALS, COUNT_CLIENT_CODE
</sql>
<select id="selectByPrimaryKey" parameterType="java.lang.String" resultMap="BaseResultMap">
<!--
WARNING - @mbg.generated
This element is automatically generated by MyBatis Generator, do not modify.
-->
select
<include refid="Base_Column_List" />
from c_client
where ID = #{id,jdbcType=VARCHAR}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.String">
<!--
WARNING - @mbg.generated
This element is automatically generated by MyBatis Generator, do not modify.
-->
delete from c_client
where ID = #{id,jdbcType=VARCHAR}
</delete>
<insert id="insert" parameterType="com.ag.dynamicmodule.basecode.pojo.CClient">
<!--
WARNING - @mbg.generated
This element is automatically generated by MyBatis Generator, do not modify.
-->
insert into c_client (ID, TENANCY_ID, CLIENT_CODE,
CLIENT_NAME, EN_CLIENT_NAME, CLIENT_SHORT,
CLIENT_SHORT_EN, CLIENT_TYPE, CREATED_BY,
CREATED_ON, UPDATED_BY, UPDATED_ON,
INVALID_FLAG, INVALID_BY, INVALID_ON,
INITIALS, COUNT_CLIENT_CODE)
values (#{id,jdbcType=VARCHAR}, #{tenancyId,jdbcType=VARCHAR}, #{clientCode,jdbcType=VARCHAR},
#{clientName,jdbcType=VARCHAR}, #{enClientName,jdbcType=VARCHAR}, #{clientShort,jdbcType=VARCHAR},
#{clientShortEn,jdbcType=VARCHAR}, #{clientType,jdbcType=VARCHAR}, #{createdBy,jdbcType=VARCHAR},
#{createdOn,jdbcType=TIMESTAMP}, #{updatedBy,jdbcType=VARCHAR}, #{updatedOn,jdbcType=TIMESTAMP},
#{invalidFlag,jdbcType=DECIMAL}, #{invalidBy,jdbcType=VARCHAR}, #{invalidOn,jdbcType=TIMESTAMP},
#{initials,jdbcType=VARCHAR}, #{countClientCode,jdbcType=VARCHAR})
</insert>
<insert id="insertSelective" parameterType="com.ag.dynamicmodule.basecode.pojo.CClient">
<!--
WARNING - @mbg.generated
This element is automatically generated by MyBatis Generator, do not modify.
-->
insert into c_client
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">
ID,
</if>
<if test="tenancyId != null">
TENANCY_ID,
</if>
<if test="clientCode != null">
CLIENT_CODE,
</if>
<if test="clientName != null">
CLIENT_NAME,
</if>
<if test="enClientName != null">
EN_CLIENT_NAME,
</if>
<if test="clientShort != null">
CLIENT_SHORT,
</if>
<if test="clientShortEn != null">
CLIENT_SHORT_EN,
</if>
<if test="clientType != null">
CLIENT_TYPE,
</if>
<if test="createdBy != null">
CREATED_BY,
</if>
<if test="createdOn != null">
CREATED_ON,
</if>
<if test="updatedBy != null">
UPDATED_BY,
</if>
<if test="updatedOn != null">
UPDATED_ON,
</if>
<if test="invalidFlag != null">
INVALID_FLAG,
</if>
<if test="invalidBy != null">
INVALID_BY,
</if>
<if test="invalidOn != null">
INVALID_ON,
</if>
<if test="initials != null">
INITIALS,
</if>
<if test="countClientCode != null">
COUNT_CLIENT_CODE,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null">
#{id,jdbcType=VARCHAR},
</if>
<if test="tenancyId != null">
#{tenancyId,jdbcType=VARCHAR},
</if>
<if test="clientCode != null">
#{clientCode,jdbcType=VARCHAR},
</if>
<if test="clientName != null">
#{clientName,jdbcType=VARCHAR},
</if>
<if test="enClientName != null">
#{enClientName,jdbcType=VARCHAR},
</if>
<if test="clientShort != null">
#{clientShort,jdbcType=VARCHAR},
</if>
<if test="clientShortEn != null">
#{clientShortEn,jdbcType=VARCHAR},
</if>
<if test="clientType != null">
#{clientType,jdbcType=VARCHAR},
</if>
<if test="createdBy != null">
#{createdBy,jdbcType=VARCHAR},
</if>
<if test="createdOn != null">
#{createdOn,jdbcType=TIMESTAMP},
</if>
<if test="updatedBy != null">
#{updatedBy,jdbcType=VARCHAR},
</if>
<if test="updatedOn != null">
#{updatedOn,jdbcType=TIMESTAMP},
</if>
<if test="invalidFlag != null">
#{invalidFlag,jdbcType=DECIMAL},
</if>
<if test="invalidBy != null">
#{invalidBy,jdbcType=VARCHAR},
</if>
<if test="invalidOn != null">
#{invalidOn,jdbcType=TIMESTAMP},
</if>
<if test="initials != null">
#{initials,jdbcType=VARCHAR},
</if>
<if test="countClientCode != null">
#{countClientCode,jdbcType=VARCHAR},
</if>
</trim>
</insert>
<update id="updateByPrimaryKeySelective" parameterType="com.ag.dynamicmodule.basecode.pojo.CClient">
<!--
WARNING - @mbg.generated
This element is automatically generated by MyBatis Generator, do not modify.
-->
update c_client
<set>
<if test="tenancyId != null">
TENANCY_ID = #{tenancyId,jdbcType=VARCHAR},
</if>
<if test="clientCode != null">
CLIENT_CODE = #{clientCode,jdbcType=VARCHAR},
</if>
<if test="clientName != null">
CLIENT_NAME = #{clientName,jdbcType=VARCHAR},
</if>
<if test="enClientName != null">
EN_CLIENT_NAME = #{enClientName,jdbcType=VARCHAR},
</if>
<if test="clientShort != null">
CLIENT_SHORT = #{clientShort,jdbcType=VARCHAR},
</if>
<if test="clientShortEn != null">
CLIENT_SHORT_EN = #{clientShortEn,jdbcType=VARCHAR},
</if>
<if test="clientType != null">
CLIENT_TYPE = #{clientType,jdbcType=VARCHAR},
</if>
<if test="createdBy != null">
CREATED_BY = #{createdBy,jdbcType=VARCHAR},
</if>
<if test="createdOn != null">
CREATED_ON = #{createdOn,jdbcType=TIMESTAMP},
</if>
<if test="updatedBy != null">
UPDATED_BY = #{updatedBy,jdbcType=VARCHAR},
</if>
<if test="updatedOn != null">
UPDATED_ON = #{updatedOn,jdbcType=TIMESTAMP},
</if>
<if test="invalidFlag != null">
INVALID_FLAG = #{invalidFlag,jdbcType=DECIMAL},
</if>
<if test="invalidBy != null">
INVALID_BY = #{invalidBy,jdbcType=VARCHAR},
</if>
<if test="invalidOn != null">
INVALID_ON = #{invalidOn,jdbcType=TIMESTAMP},
</if>
<if test="initials != null">
INITIALS = #{initials,jdbcType=VARCHAR},
</if>
<if test="countClientCode != null">
COUNT_CLIENT_CODE = #{countClientCode,jdbcType=VARCHAR},
</if>
</set>
where ID = #{id,jdbcType=VARCHAR}
</update>
<update id="updateByPrimaryKey" parameterType="com.ag.dynamicmodule.basecode.pojo.CClient">
<!--
WARNING - @mbg.generated
This element is automatically generated by MyBatis Generator, do not modify.
-->
update c_client
set TENANCY_ID = #{tenancyId,jdbcType=VARCHAR},
CLIENT_CODE = #{clientCode,jdbcType=VARCHAR},
CLIENT_NAME = #{clientName,jdbcType=VARCHAR},
EN_CLIENT_NAME = #{enClientName,jdbcType=VARCHAR},
CLIENT_SHORT = #{clientShort,jdbcType=VARCHAR},
CLIENT_SHORT_EN = #{clientShortEn,jdbcType=VARCHAR},
CLIENT_TYPE = #{clientType,jdbcType=VARCHAR},
CREATED_BY = #{createdBy,jdbcType=VARCHAR},
CREATED_ON = #{createdOn,jdbcType=TIMESTAMP},
UPDATED_BY = #{updatedBy,jdbcType=VARCHAR},
UPDATED_ON = #{updatedOn,jdbcType=TIMESTAMP},
INVALID_FLAG = #{invalidFlag,jdbcType=DECIMAL},
INVALID_BY = #{invalidBy,jdbcType=VARCHAR},
INVALID_ON = #{invalidOn,jdbcType=TIMESTAMP},
INITIALS = #{initials,jdbcType=VARCHAR},
COUNT_CLIENT_CODE = #{countClientCode,jdbcType=VARCHAR}
where ID = #{id,jdbcType=VARCHAR}
</update>
</mapper>

View File

@@ -0,0 +1,185 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="resources/basecode.CClientTypeMapper">
<resultMap id="BaseResultMap" type="com.ag.dynamicmodule.basecode.pojo.CClientType">
<!--
WARNING - @mbg.generated
This element is automatically generated by MyBatis Generator, do not modify.
-->
<id column="ID" jdbcType="VARCHAR" property="id" />
<result column="TENANCY_ID" jdbcType="VARCHAR" property="tenancyId" />
<result column="TYPE_CODE" jdbcType="VARCHAR" property="typeCode" />
<result column="TYPE_NAME" jdbcType="VARCHAR" property="typeName" />
<result column="SEQ_NO" jdbcType="DECIMAL" property="seqNo" />
<result column="NOTES" jdbcType="VARCHAR" property="notes" />
<result column="CREATED_BY" jdbcType="VARCHAR" property="createdBy" />
<result column="CREATED_ON" jdbcType="TIMESTAMP" property="createdOn" />
<result column="UPDATED_BY" jdbcType="VARCHAR" property="updatedBy" />
<result column="UPDATED_ON" jdbcType="TIMESTAMP" property="updatedOn" />
</resultMap>
<sql id="Base_Column_List">
<!--
WARNING - @mbg.generated
This element is automatically generated by MyBatis Generator, do not modify.
-->
ID, TENANCY_ID, TYPE_CODE, TYPE_NAME, SEQ_NO, NOTES, CREATED_BY, CREATED_ON, UPDATED_BY,
UPDATED_ON
</sql>
<select id="selectByPrimaryKey" parameterType="java.lang.String" resultMap="BaseResultMap">
<!--
WARNING - @mbg.generated
This element is automatically generated by MyBatis Generator, do not modify.
-->
select
<include refid="Base_Column_List" />
from c_client_type
where ID = #{id,jdbcType=VARCHAR}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.String">
<!--
WARNING - @mbg.generated
This element is automatically generated by MyBatis Generator, do not modify.
-->
delete from c_client_type
where ID = #{id,jdbcType=VARCHAR}
</delete>
<insert id="insert" parameterType="com.ag.dynamicmodule.basecode.pojo.CClientType">
<!--
WARNING - @mbg.generated
This element is automatically generated by MyBatis Generator, do not modify.
-->
insert into c_client_type (ID, TENANCY_ID, TYPE_CODE,
TYPE_NAME, SEQ_NO, NOTES,
CREATED_BY, CREATED_ON, UPDATED_BY,
UPDATED_ON)
values (#{id,jdbcType=VARCHAR}, #{tenancyId,jdbcType=VARCHAR}, #{typeCode,jdbcType=VARCHAR},
#{typeName,jdbcType=VARCHAR}, #{seqNo,jdbcType=DECIMAL}, #{notes,jdbcType=VARCHAR},
#{createdBy,jdbcType=VARCHAR}, #{createdOn,jdbcType=TIMESTAMP}, #{updatedBy,jdbcType=VARCHAR},
#{updatedOn,jdbcType=TIMESTAMP})
</insert>
<insert id="insertSelective" parameterType="com.ag.dynamicmodule.basecode.pojo.CClientType">
<!--
WARNING - @mbg.generated
This element is automatically generated by MyBatis Generator, do not modify.
-->
insert into c_client_type
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">
ID,
</if>
<if test="tenancyId != null">
TENANCY_ID,
</if>
<if test="typeCode != null">
TYPE_CODE,
</if>
<if test="typeName != null">
TYPE_NAME,
</if>
<if test="seqNo != null">
SEQ_NO,
</if>
<if test="notes != null">
NOTES,
</if>
<if test="createdBy != null">
CREATED_BY,
</if>
<if test="createdOn != null">
CREATED_ON,
</if>
<if test="updatedBy != null">
UPDATED_BY,
</if>
<if test="updatedOn != null">
UPDATED_ON,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null">
#{id,jdbcType=VARCHAR},
</if>
<if test="tenancyId != null">
#{tenancyId,jdbcType=VARCHAR},
</if>
<if test="typeCode != null">
#{typeCode,jdbcType=VARCHAR},
</if>
<if test="typeName != null">
#{typeName,jdbcType=VARCHAR},
</if>
<if test="seqNo != null">
#{seqNo,jdbcType=DECIMAL},
</if>
<if test="notes != null">
#{notes,jdbcType=VARCHAR},
</if>
<if test="createdBy != null">
#{createdBy,jdbcType=VARCHAR},
</if>
<if test="createdOn != null">
#{createdOn,jdbcType=TIMESTAMP},
</if>
<if test="updatedBy != null">
#{updatedBy,jdbcType=VARCHAR},
</if>
<if test="updatedOn != null">
#{updatedOn,jdbcType=TIMESTAMP},
</if>
</trim>
</insert>
<update id="updateByPrimaryKeySelective" parameterType="com.ag.dynamicmodule.basecode.pojo.CClientType">
<!--
WARNING - @mbg.generated
This element is automatically generated by MyBatis Generator, do not modify.
-->
update c_client_type
<set>
<if test="tenancyId != null">
TENANCY_ID = #{tenancyId,jdbcType=VARCHAR},
</if>
<if test="typeCode != null">
TYPE_CODE = #{typeCode,jdbcType=VARCHAR},
</if>
<if test="typeName != null">
TYPE_NAME = #{typeName,jdbcType=VARCHAR},
</if>
<if test="seqNo != null">
SEQ_NO = #{seqNo,jdbcType=DECIMAL},
</if>
<if test="notes != null">
NOTES = #{notes,jdbcType=VARCHAR},
</if>
<if test="createdBy != null">
CREATED_BY = #{createdBy,jdbcType=VARCHAR},
</if>
<if test="createdOn != null">
CREATED_ON = #{createdOn,jdbcType=TIMESTAMP},
</if>
<if test="updatedBy != null">
UPDATED_BY = #{updatedBy,jdbcType=VARCHAR},
</if>
<if test="updatedOn != null">
UPDATED_ON = #{updatedOn,jdbcType=TIMESTAMP},
</if>
</set>
where ID = #{id,jdbcType=VARCHAR}
</update>
<update id="updateByPrimaryKey" parameterType="com.ag.dynamicmodule.basecode.pojo.CClientType">
<!--
WARNING - @mbg.generated
This element is automatically generated by MyBatis Generator, do not modify.
-->
update c_client_type
set TENANCY_ID = #{tenancyId,jdbcType=VARCHAR},
TYPE_CODE = #{typeCode,jdbcType=VARCHAR},
TYPE_NAME = #{typeName,jdbcType=VARCHAR},
SEQ_NO = #{seqNo,jdbcType=DECIMAL},
NOTES = #{notes,jdbcType=VARCHAR},
CREATED_BY = #{createdBy,jdbcType=VARCHAR},
CREATED_ON = #{createdOn,jdbcType=TIMESTAMP},
UPDATED_BY = #{updatedBy,jdbcType=VARCHAR},
UPDATED_ON = #{updatedOn,jdbcType=TIMESTAMP}
where ID = #{id,jdbcType=VARCHAR}
</update>
</mapper>

View File

@@ -0,0 +1,131 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="resources/basecode.CClientTypeRelaDataMapper">
<resultMap id="BaseResultMap" type="com.ag.dynamicmodule.basecode.pojo.CClientTypeRelaData">
<!--
WARNING - @mbg.generated
This element is automatically generated by MyBatis Generator, do not modify.
-->
<id column="ID" jdbcType="VARCHAR" property="id" />
<result column="TENANCY_ID" jdbcType="VARCHAR" property="tenancyId" />
<result column="CLIENT_TYPE_CODE" jdbcType="VARCHAR" property="clientTypeCode" />
<result column="CLIENT_CODE" jdbcType="VARCHAR" property="clientCode" />
<result column="CHECK_FLAG" jdbcType="VARCHAR" property="checkFlag" />
</resultMap>
<sql id="Base_Column_List">
<!--
WARNING - @mbg.generated
This element is automatically generated by MyBatis Generator, do not modify.
-->
ID, TENANCY_ID, CLIENT_TYPE_CODE, CLIENT_CODE, CHECK_FLAG
</sql>
<select id="selectByPrimaryKey" parameterType="java.lang.String" resultMap="BaseResultMap">
<!--
WARNING - @mbg.generated
This element is automatically generated by MyBatis Generator, do not modify.
-->
select
<include refid="Base_Column_List" />
from c_client_type_rela_data
where ID = #{id,jdbcType=VARCHAR}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.String">
<!--
WARNING - @mbg.generated
This element is automatically generated by MyBatis Generator, do not modify.
-->
delete from c_client_type_rela_data
where ID = #{id,jdbcType=VARCHAR}
</delete>
<insert id="insert" parameterType="com.ag.dynamicmodule.basecode.pojo.CClientTypeRelaData">
<!--
WARNING - @mbg.generated
This element is automatically generated by MyBatis Generator, do not modify.
-->
insert into c_client_type_rela_data (ID, TENANCY_ID, CLIENT_TYPE_CODE,
CLIENT_CODE, CHECK_FLAG)
values (#{id,jdbcType=VARCHAR}, #{tenancyId,jdbcType=VARCHAR}, #{clientTypeCode,jdbcType=VARCHAR},
#{clientCode,jdbcType=VARCHAR}, #{checkFlag,jdbcType=VARCHAR})
</insert>
<insert id="insertSelective" parameterType="com.ag.dynamicmodule.basecode.pojo.CClientTypeRelaData">
<!--
WARNING - @mbg.generated
This element is automatically generated by MyBatis Generator, do not modify.
-->
insert into c_client_type_rela_data
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">
ID,
</if>
<if test="tenancyId != null">
TENANCY_ID,
</if>
<if test="clientTypeCode != null">
CLIENT_TYPE_CODE,
</if>
<if test="clientCode != null">
CLIENT_CODE,
</if>
<if test="checkFlag != null">
CHECK_FLAG,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null">
#{id,jdbcType=VARCHAR},
</if>
<if test="tenancyId != null">
#{tenancyId,jdbcType=VARCHAR},
</if>
<if test="clientTypeCode != null">
#{clientTypeCode,jdbcType=VARCHAR},
</if>
<if test="clientCode != null">
#{clientCode,jdbcType=VARCHAR},
</if>
<if test="checkFlag != null">
#{checkFlag,jdbcType=VARCHAR},
</if>
</trim>
</insert>
<update id="updateByPrimaryKeySelective" parameterType="com.ag.dynamicmodule.basecode.pojo.CClientTypeRelaData">
<!--
WARNING - @mbg.generated
This element is automatically generated by MyBatis Generator, do not modify.
-->
update c_client_type_rela_data
<set>
<if test="tenancyId != null">
TENANCY_ID = #{tenancyId,jdbcType=VARCHAR},
</if>
<if test="clientTypeCode != null">
CLIENT_TYPE_CODE = #{clientTypeCode,jdbcType=VARCHAR},
</if>
<if test="clientCode != null">
CLIENT_CODE = #{clientCode,jdbcType=VARCHAR},
</if>
<if test="checkFlag != null">
CHECK_FLAG = #{checkFlag,jdbcType=VARCHAR},
</if>
</set>
where ID = #{id,jdbcType=VARCHAR}
</update>
<update id="updateByPrimaryKey" parameterType="com.ag.dynamicmodule.basecode.pojo.CClientTypeRelaData">
<!--
WARNING - @mbg.generated
This element is automatically generated by MyBatis Generator, do not modify.
-->
update c_client_type_rela_data
set TENANCY_ID = #{tenancyId,jdbcType=VARCHAR},
CLIENT_TYPE_CODE = #{clientTypeCode,jdbcType=VARCHAR},
CLIENT_CODE = #{clientCode,jdbcType=VARCHAR},
CHECK_FLAG = #{checkFlag,jdbcType=VARCHAR}
where ID = #{id,jdbcType=VARCHAR}
</update>
<!--删除客户关联关系-->
<delete id="deleteByClientCode" parameterType="java.lang.String">
delete from C_CLIENT_TYPE_RELA_DATA
where CLIENT_CODE = #{ids,jdbcType=VARCHAR}
</delete>
</mapper>

View File

@@ -0,0 +1,506 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="resources/ctariff.CtariffMapper">
<resultMap id="BaseResultMap" type="com.ag.ctc.domain.pojo.Ctariff">
<!--
WARNING - @mbggenerated
This element is automatically generated by MyBatis Generator, do not modify.
-->
<id column="ID" jdbcType="VARCHAR" property="id" />
<result column="TENANCY_ID" jdbcType="VARCHAR" property="tenancyId" />
<result column="CHARGING_ID" jdbcType="VARCHAR" property="chargingId" />
<result column="RATE" jdbcType="DECIMAL" property="rate" />
<result column="CURRENCY" jdbcType="VARCHAR" property="currency" />
<result column="NOTES" jdbcType="VARCHAR" property="notes" />
<result column="CREATED_BY" jdbcType="VARCHAR" property="createdBy" />
<result column="CREATED_ON" jdbcType="TIMESTAMP" property="createdOn" />
<result column="UPDATED_BY" jdbcType="VARCHAR" property="updatedBy" />
<result column="UPDATED_ON" jdbcType="TIMESTAMP" property="updatedOn" />
<result column="CONTRACT_ID" jdbcType="VARCHAR" property="contractId" />
<result column="AMOUNT_FORMAT" jdbcType="DECIMAL" property="amountFormat" />
<result column="FORMAT_UNIT" jdbcType="DECIMAL" property="formatUnit" />
<result column="SORT" jdbcType="DECIMAL" property="sort" />
<result column="VOL_PRICE" jdbcType="DECIMAL" property="volPrice" />
<result column="RECEIVE_CODE" jdbcType="VARCHAR" property="receiveCode" />
<result column="PAY_CODE" jdbcType="VARCHAR" property="payCode" />
<result column="PAY_RATE" jdbcType="DECIMAL" property="payRate" />
<result column="RECEIVE_RATE" jdbcType="DECIMAL" property="receiveRate" />
<result column="PAY_CURRENCY" jdbcType="VARCHAR" property="payCurrency" />
<result column="RECEIVE_CURRENCY" jdbcType="VARCHAR" property="receiveCurrency" />
<result column="KEY_DESCRIPTION" jdbcType="VARCHAR" property="keyDescription" />
<result column="VAL_DESCRIPTION" jdbcType="VARCHAR" property="valDescription" />
<result column="EFFECTIVE_DATE" jdbcType="TIMESTAMP" property="effectiveDate" />
<result column="EXPIRED_DATE" jdbcType="TIMESTAMP" property="expiredDate" />
<result column="APPENDLX_NOTES" jdbcType="VARCHAR" property="appendlxNotes" />
<result column="CONFIRM_STATUS" jdbcType="DECIMAL" property="confirmStatus" />
<result column="CONFIRM_BY" jdbcType="VARCHAR" property="confirmBy" />
<result column="CONFIRM_ON" jdbcType="TIMESTAMP" property="confirmOn" />
<result column="DEL_FLAG" jdbcType="DECIMAL" property="delFlag" />
<result column="BYTON" jdbcType="DECIMAL" property="byton" />
<result column="MIN_AMOUNT" jdbcType="DECIMAL" property="minAmount" />
<result column="MAX_AMOUNT" jdbcType="DECIMAL" property="maxAmount" />
<result column="IS_FORMAT" jdbcType="DECIMAL" property="isFormat" />
<result column="VERIFY_FLAG" jdbcType="DECIMAL" property="verifyFlag" />
</resultMap>
<sql id="Base_Column_List">
<!--
WARNING - @mbggenerated
This element is automatically generated by MyBatis Generator, do not modify.
-->
ID, TENANCY_ID, CHARGING_ID, RATE, CURRENCY, NOTES, CREATED_BY, CREATED_ON, UPDATED_BY,
UPDATED_ON, CONTRACT_ID, AMOUNT_FORMAT, FORMAT_UNIT, SORT, VOL_PRICE, RECEIVE_CODE,
PAY_CODE, PAY_RATE, RECEIVE_RATE, PAY_CURRENCY, RECEIVE_CURRENCY, KEY_DESCRIPTION,
VAL_DESCRIPTION, EFFECTIVE_DATE, EXPIRED_DATE, APPENDLX_NOTES, CONFIRM_STATUS, CONFIRM_BY,
CONFIRM_ON, DEL_FLAG, BYTON, MIN_AMOUNT, MAX_AMOUNT, IS_FORMAT, VERIFY_FLAG
</sql>
<select id="selectByPrimaryKey" parameterType="java.lang.String" resultMap="BaseResultMap">
<!--
WARNING - @mbggenerated
This element is automatically generated by MyBatis Generator, do not modify.
-->
select
<include refid="Base_Column_List" />
from C_TARIFF
where ID = #{id,jdbcType=VARCHAR}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.String">
<!--
WARNING - @mbggenerated
This element is automatically generated by MyBatis Generator, do not modify.
-->
delete from C_TARIFF
where ID = #{id,jdbcType=VARCHAR}
</delete>
<insert id="insert" parameterType="com.ag.ctc.domain.pojo.Ctariff">
<!--
WARNING - @mbggenerated
This element is automatically generated by MyBatis Generator, do not modify.
-->
insert into C_TARIFF (ID, TENANCY_ID, CHARGING_ID,
RATE, CURRENCY, NOTES,
CREATED_BY, CREATED_ON, UPDATED_BY,
UPDATED_ON, CONTRACT_ID, AMOUNT_FORMAT,
FORMAT_UNIT, SORT, VOL_PRICE,
RECEIVE_CODE, PAY_CODE, PAY_RATE,
RECEIVE_RATE, PAY_CURRENCY, RECEIVE_CURRENCY,
KEY_DESCRIPTION, VAL_DESCRIPTION, EFFECTIVE_DATE,
EXPIRED_DATE, APPENDLX_NOTES, CONFIRM_STATUS,
CONFIRM_BY, CONFIRM_ON, DEL_FLAG,
BYTON, MIN_AMOUNT, MAX_AMOUNT,
IS_FORMAT, VERIFY_FLAG)
values (#{id,jdbcType=VARCHAR}, #{tenancyId,jdbcType=VARCHAR}, #{chargingId,jdbcType=VARCHAR},
#{rate,jdbcType=DECIMAL}, #{currency,jdbcType=VARCHAR}, #{notes,jdbcType=VARCHAR},
#{createdBy,jdbcType=VARCHAR}, #{createdOn,jdbcType=TIMESTAMP}, #{updatedBy,jdbcType=VARCHAR},
#{updatedOn,jdbcType=TIMESTAMP}, #{contractId,jdbcType=VARCHAR}, #{amountFormat,jdbcType=DECIMAL},
#{formatUnit,jdbcType=DECIMAL}, #{sort,jdbcType=DECIMAL}, #{volPrice,jdbcType=DECIMAL},
#{receiveCode,jdbcType=VARCHAR}, #{payCode,jdbcType=VARCHAR}, #{payRate,jdbcType=DECIMAL},
#{receiveRate,jdbcType=DECIMAL}, #{payCurrency,jdbcType=VARCHAR}, #{receiveCurrency,jdbcType=VARCHAR},
#{keyDescription,jdbcType=VARCHAR}, #{valDescription,jdbcType=VARCHAR}, #{effectiveDate,jdbcType=TIMESTAMP},
#{expiredDate,jdbcType=TIMESTAMP}, #{appendlxNotes,jdbcType=VARCHAR}, #{confirmStatus,jdbcType=DECIMAL},
#{confirmBy,jdbcType=VARCHAR}, #{confirmOn,jdbcType=TIMESTAMP}, #{delFlag,jdbcType=DECIMAL},
#{byton,jdbcType=DECIMAL}, #{minAmount,jdbcType=DECIMAL}, #{maxAmount,jdbcType=DECIMAL},
#{isFormat,jdbcType=DECIMAL}, #{verifyFlag,jdbcType=DECIMAL})
</insert>
<insert id="insertSelective" parameterType="com.ag.ctc.domain.pojo.Ctariff">
<!--
WARNING - @mbggenerated
This element is automatically generated by MyBatis Generator, do not modify.
-->
insert into C_TARIFF
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">
ID,
</if>
<if test="tenancyId != null">
TENANCY_ID,
</if>
<if test="chargingId != null">
CHARGING_ID,
</if>
<if test="rate != null">
RATE,
</if>
<if test="currency != null">
CURRENCY,
</if>
<if test="notes != null">
NOTES,
</if>
<if test="createdBy != null">
CREATED_BY,
</if>
<if test="createdOn != null">
CREATED_ON,
</if>
<if test="updatedBy != null">
UPDATED_BY,
</if>
<if test="updatedOn != null">
UPDATED_ON,
</if>
<if test="contractId != null">
CONTRACT_ID,
</if>
<if test="amountFormat != null">
AMOUNT_FORMAT,
</if>
<if test="formatUnit != null">
FORMAT_UNIT,
</if>
<if test="sort != null">
SORT,
</if>
<if test="volPrice != null">
VOL_PRICE,
</if>
<if test="receiveCode != null">
RECEIVE_CODE,
</if>
<if test="payCode != null">
PAY_CODE,
</if>
<if test="payRate != null">
PAY_RATE,
</if>
<if test="receiveRate != null">
RECEIVE_RATE,
</if>
<if test="payCurrency != null">
PAY_CURRENCY,
</if>
<if test="receiveCurrency != null">
RECEIVE_CURRENCY,
</if>
<if test="keyDescription != null">
KEY_DESCRIPTION,
</if>
<if test="valDescription != null">
VAL_DESCRIPTION,
</if>
<if test="effectiveDate != null">
EFFECTIVE_DATE,
</if>
<if test="expiredDate != null">
EXPIRED_DATE,
</if>
<if test="appendlxNotes != null">
APPENDLX_NOTES,
</if>
<if test="confirmStatus != null">
CONFIRM_STATUS,
</if>
<if test="confirmBy != null">
CONFIRM_BY,
</if>
<if test="confirmOn != null">
CONFIRM_ON,
</if>
<if test="delFlag != null">
DEL_FLAG,
</if>
<if test="byton != null">
BYTON,
</if>
<if test="minAmount != null">
MIN_AMOUNT,
</if>
<if test="maxAmount != null">
MAX_AMOUNT,
</if>
<if test="isFormat != null">
IS_FORMAT,
</if>
<if test="verifyFlag != null">
VERIFY_FLAG,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null">
#{id,jdbcType=VARCHAR},
</if>
<if test="tenancyId != null">
#{tenancyId,jdbcType=VARCHAR},
</if>
<if test="chargingId != null">
#{chargingId,jdbcType=VARCHAR},
</if>
<if test="rate != null">
#{rate,jdbcType=DECIMAL},
</if>
<if test="currency != null">
#{currency,jdbcType=VARCHAR},
</if>
<if test="notes != null">
#{notes,jdbcType=VARCHAR},
</if>
<if test="createdBy != null">
#{createdBy,jdbcType=VARCHAR},
</if>
<if test="createdOn != null">
#{createdOn,jdbcType=TIMESTAMP},
</if>
<if test="updatedBy != null">
#{updatedBy,jdbcType=VARCHAR},
</if>
<if test="updatedOn != null">
#{updatedOn,jdbcType=TIMESTAMP},
</if>
<if test="contractId != null">
#{contractId,jdbcType=VARCHAR},
</if>
<if test="amountFormat != null">
#{amountFormat,jdbcType=DECIMAL},
</if>
<if test="formatUnit != null">
#{formatUnit,jdbcType=DECIMAL},
</if>
<if test="sort != null">
#{sort,jdbcType=DECIMAL},
</if>
<if test="volPrice != null">
#{volPrice,jdbcType=DECIMAL},
</if>
<if test="receiveCode != null">
#{receiveCode,jdbcType=VARCHAR},
</if>
<if test="payCode != null">
#{payCode,jdbcType=VARCHAR},
</if>
<if test="payRate != null">
#{payRate,jdbcType=DECIMAL},
</if>
<if test="receiveRate != null">
#{receiveRate,jdbcType=DECIMAL},
</if>
<if test="payCurrency != null">
#{payCurrency,jdbcType=VARCHAR},
</if>
<if test="receiveCurrency != null">
#{receiveCurrency,jdbcType=VARCHAR},
</if>
<if test="keyDescription != null">
#{keyDescription,jdbcType=VARCHAR},
</if>
<if test="valDescription != null">
#{valDescription,jdbcType=VARCHAR},
</if>
<if test="effectiveDate != null">
#{effectiveDate,jdbcType=TIMESTAMP},
</if>
<if test="expiredDate != null">
#{expiredDate,jdbcType=TIMESTAMP},
</if>
<if test="appendlxNotes != null">
#{appendlxNotes,jdbcType=VARCHAR},
</if>
<if test="confirmStatus != null">
#{confirmStatus,jdbcType=DECIMAL},
</if>
<if test="confirmBy != null">
#{confirmBy,jdbcType=VARCHAR},
</if>
<if test="confirmOn != null">
#{confirmOn,jdbcType=TIMESTAMP},
</if>
<if test="delFlag != null">
#{delFlag,jdbcType=DECIMAL},
</if>
<if test="byton != null">
#{byton,jdbcType=DECIMAL},
</if>
<if test="minAmount != null">
#{minAmount,jdbcType=DECIMAL},
</if>
<if test="maxAmount != null">
#{maxAmount,jdbcType=DECIMAL},
</if>
<if test="isFormat != null">
#{isFormat,jdbcType=DECIMAL},
</if>
<if test="verifyFlag != null">
#{verifyFlag,jdbcType=DECIMAL},
</if>
</trim>
</insert>
<update id="updateByPrimaryKeySelective" parameterType="com.ag.ctc.domain.pojo.Ctariff">
<!--
WARNING - @mbggenerated
This element is automatically generated by MyBatis Generator, do not modify.
-->
update C_TARIFF
<set>
<if test="tenancyId != null">
TENANCY_ID = #{tenancyId,jdbcType=VARCHAR},
</if>
<if test="chargingId != null">
CHARGING_ID = #{chargingId,jdbcType=VARCHAR},
</if>
<if test="rate != null">
RATE = #{rate,jdbcType=DECIMAL},
</if>
<if test="currency != null">
CURRENCY = #{currency,jdbcType=VARCHAR},
</if>
<if test="notes != null">
NOTES = #{notes,jdbcType=VARCHAR},
</if>
<if test="createdBy != null">
CREATED_BY = #{createdBy,jdbcType=VARCHAR},
</if>
<if test="createdOn != null">
CREATED_ON = #{createdOn,jdbcType=TIMESTAMP},
</if>
<if test="updatedBy != null">
UPDATED_BY = #{updatedBy,jdbcType=VARCHAR},
</if>
<if test="updatedOn != null">
UPDATED_ON = #{updatedOn,jdbcType=TIMESTAMP},
</if>
<if test="contractId != null">
CONTRACT_ID = #{contractId,jdbcType=VARCHAR},
</if>
<if test="amountFormat != null">
AMOUNT_FORMAT = #{amountFormat,jdbcType=DECIMAL},
</if>
<if test="formatUnit != null">
FORMAT_UNIT = #{formatUnit,jdbcType=DECIMAL},
</if>
<if test="sort != null">
SORT = #{sort,jdbcType=DECIMAL},
</if>
<if test="volPrice != null">
VOL_PRICE = #{volPrice,jdbcType=DECIMAL},
</if>
<if test="receiveCode != null">
RECEIVE_CODE = #{receiveCode,jdbcType=VARCHAR},
</if>
<if test="payCode != null">
PAY_CODE = #{payCode,jdbcType=VARCHAR},
</if>
<if test="payRate != null">
PAY_RATE = #{payRate,jdbcType=DECIMAL},
</if>
<if test="receiveRate != null">
RECEIVE_RATE = #{receiveRate,jdbcType=DECIMAL},
</if>
<if test="payCurrency != null">
PAY_CURRENCY = #{payCurrency,jdbcType=VARCHAR},
</if>
<if test="receiveCurrency != null">
RECEIVE_CURRENCY = #{receiveCurrency,jdbcType=VARCHAR},
</if>
<if test="keyDescription != null">
KEY_DESCRIPTION = #{keyDescription,jdbcType=VARCHAR},
</if>
<if test="valDescription != null">
VAL_DESCRIPTION = #{valDescription,jdbcType=VARCHAR},
</if>
<!--<if test="effectiveDate != null">-->
EFFECTIVE_DATE = #{effectiveDate,jdbcType=TIMESTAMP},
<!--</if>-->
<!--<if test="expiredDate != null">-->
EXPIRED_DATE = #{expiredDate,jdbcType=TIMESTAMP},
<!--</if>-->
<!--<if test="appendlxNotes != null">-->
APPENDLX_NOTES = #{appendlxNotes,jdbcType=VARCHAR},
<!--</if>-->
<if test="confirmStatus != null">
CONFIRM_STATUS = #{confirmStatus,jdbcType=DECIMAL},
</if>
<if test="confirmBy != null">
CONFIRM_BY = #{confirmBy,jdbcType=VARCHAR},
</if>
<if test="confirmOn != null">
CONFIRM_ON = #{confirmOn,jdbcType=TIMESTAMP},
</if>
<if test="delFlag != null">
DEL_FLAG = #{delFlag,jdbcType=DECIMAL},
</if>
<if test="byton != null">
BYTON = #{byton,jdbcType=DECIMAL},
</if>
<if test="minAmount != null">
MIN_AMOUNT = #{minAmount,jdbcType=DECIMAL},
</if>
<if test="maxAmount != null">
MAX_AMOUNT = #{maxAmount,jdbcType=DECIMAL},
</if>
<if test="isFormat != null">
IS_FORMAT = #{isFormat,jdbcType=DECIMAL},
</if>
<if test="verifyFlag != null">
VERIFY_FLAG = #{verifyFlag,jdbcType=DECIMAL},
</if>
</set>
where ID = #{id,jdbcType=VARCHAR}
</update>
<update id="updateByPrimaryKey" parameterType="com.ag.ctc.domain.pojo.Ctariff">
<!--
WARNING - @mbggenerated
This element is automatically generated by MyBatis Generator, do not modify.
-->
update C_TARIFF
set TENANCY_ID = #{tenancyId,jdbcType=VARCHAR},
CHARGING_ID = #{chargingId,jdbcType=VARCHAR},
RATE = #{rate,jdbcType=DECIMAL},
CURRENCY = #{currency,jdbcType=VARCHAR},
NOTES = #{notes,jdbcType=VARCHAR},
CREATED_BY = #{createdBy,jdbcType=VARCHAR},
CREATED_ON = #{createdOn,jdbcType=TIMESTAMP},
UPDATED_BY = #{updatedBy,jdbcType=VARCHAR},
UPDATED_ON = #{updatedOn,jdbcType=TIMESTAMP},
CONTRACT_ID = #{contractId,jdbcType=VARCHAR},
AMOUNT_FORMAT = #{amountFormat,jdbcType=DECIMAL},
FORMAT_UNIT = #{formatUnit,jdbcType=DECIMAL},
SORT = #{sort,jdbcType=DECIMAL},
VOL_PRICE = #{volPrice,jdbcType=DECIMAL},
RECEIVE_CODE = #{receiveCode,jdbcType=VARCHAR},
PAY_CODE = #{payCode,jdbcType=VARCHAR},
PAY_RATE = #{payRate,jdbcType=DECIMAL},
RECEIVE_RATE = #{receiveRate,jdbcType=DECIMAL},
PAY_CURRENCY = #{payCurrency,jdbcType=VARCHAR},
RECEIVE_CURRENCY = #{receiveCurrency,jdbcType=VARCHAR},
KEY_DESCRIPTION = #{keyDescription,jdbcType=VARCHAR},
VAL_DESCRIPTION = #{valDescription,jdbcType=VARCHAR},
EFFECTIVE_DATE = #{effectiveDate,jdbcType=TIMESTAMP},
EXPIRED_DATE = #{expiredDate,jdbcType=TIMESTAMP},
APPENDLX_NOTES = #{appendlxNotes,jdbcType=VARCHAR},
CONFIRM_STATUS = #{confirmStatus,jdbcType=DECIMAL},
CONFIRM_BY = #{confirmBy,jdbcType=VARCHAR},
CONFIRM_ON = #{confirmOn,jdbcType=TIMESTAMP},
DEL_FLAG = #{delFlag,jdbcType=DECIMAL},
BYTON = #{byton,jdbcType=DECIMAL},
MIN_AMOUNT = #{minAmount,jdbcType=DECIMAL},
MAX_AMOUNT = #{maxAmount,jdbcType=DECIMAL},
IS_FORMAT = #{isFormat,jdbcType=DECIMAL},
VERIFY_FLAG = #{verifyFlag,jdbcType=DECIMAL}
where ID = #{id,jdbcType=VARCHAR}
</update>
<select id="selectByitemid" parameterType="map" resultMap="BaseResultMap">
select
ID, TENANCY_ID, CHARGING_ID, RATE, CURRENCY, NOTES, CREATED_BY, CREATED_ON, UPDATED_BY,
UPDATED_ON, CONTRACT_ID, AMOUNT_FORMAT, FORMAT_UNIT, SORT, VOL_PRICE, RECEIVE_CODE,
PAY_CODE, PAY_RATE, RECEIVE_RATE, PAY_CURRENCY, RECEIVE_CURRENCY, KEY_DESCRIPTION,
VAL_DESCRIPTION, EFFECTIVE_DATE, EXPIRED_DATE, APPENDLX_NOTES, CONFIRM_STATUS, CONFIRM_BY,
CONFIRM_ON, DEL_FLAG, BYTON, MIN_AMOUNT, MAX_AMOUNT, IS_FORMAT, VERIFY_FLAG
from C_TARIFF
where CHARGING_ID = #{itemId,jdbcType=VARCHAR}
and CONTRACT_ID = #{contractId,jdbcType=VARCHAR}
and del_flag = 0
<if test="confirmStatus != null">
and CONFIRM_STATUS = #{confirmStatus}
</if>
</select>
<select id="selectpropertyByitemid" parameterType="java.lang.String" resultType="map">
select * from C_ITEM_PROPERTIES where ITEM_ID=#{id,jdbcType=VARCHAR}
</select>
<update id="updateDelFlagById" parameterType="java.lang.String">
update C_TARIFF
set DEL_FLAG = 1
where ID = #{id,jdbcType=VARCHAR}
</update>
</mapper>

View File

@@ -0,0 +1,240 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="resources/ctariff.CtariffRitemMapper">
<resultMap id="BaseResultMap" type="com.ag.ctc.domain.pojo.TariffRitem">
<!--
WARNING - @mbggenerated
This element is automatically generated by MyBatis Generator, do not modify.
-->
<id column="ID" jdbcType="VARCHAR" property="id" />
<result column="TENANCY_ID" jdbcType="VARCHAR" property="tenancyId" />
<result column="RULE_ID" jdbcType="VARCHAR" property="ruleId" />
<result column="KEY_NAME" jdbcType="VARCHAR" property="keyName" />
<result column="OPER_CHAR" jdbcType="VARCHAR" property="operChar" />
<result column="COMPARE_VAL" jdbcType="VARCHAR" property="compareVal" />
<result column="CREATED_BY" jdbcType="VARCHAR" property="createdBy" />
<result column="CREATED_ON" jdbcType="TIMESTAMP" property="createdOn" />
<result column="UPDATED_BY" jdbcType="VARCHAR" property="updatedBy" />
<result column="UPDATED_ON" jdbcType="TIMESTAMP" property="updatedOn" />
<result column="COMPARE_NAME" jdbcType="VARCHAR" property="compareName" />
<result column="DEL_FLAG" jdbcType="DECIMAL" property="delFlag" />
<result column="COMNAME1" jdbcType="VARCHAR" property="comname1" />
</resultMap>
<sql id="Base_Column_List">
<!--
WARNING - @mbggenerated
This element is automatically generated by MyBatis Generator, do not modify.
-->
ID, TENANCY_ID, RULE_ID, KEY_NAME, OPER_CHAR, COMPARE_VAL, CREATED_BY, CREATED_ON,
UPDATED_BY, UPDATED_ON, COMPARE_NAME, DEL_FLAG, COMNAME1
</sql>
<select id="selectByPrimaryKey" parameterType="java.lang.String" resultMap="BaseResultMap">
<!--
WARNING - @mbggenerated
This element is automatically generated by MyBatis Generator, do not modify.
-->
select
<include refid="Base_Column_List" />
from C_TARIFF_RITEM
where ID = #{id,jdbcType=VARCHAR}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.String">
<!--
WARNING - @mbggenerated
This element is automatically generated by MyBatis Generator, do not modify.
-->
delete from C_TARIFF_RITEM
where ID = #{id,jdbcType=VARCHAR}
</delete>
<insert id="insert" parameterType="com.ag.ctc.domain.pojo.TariffRitem">
<!--
WARNING - @mbggenerated
This element is automatically generated by MyBatis Generator, do not modify.
-->
insert into C_TARIFF_RITEM (ID, TENANCY_ID, RULE_ID,
KEY_NAME, OPER_CHAR, COMPARE_VAL,
CREATED_BY, CREATED_ON, UPDATED_BY,
UPDATED_ON, COMPARE_NAME, DEL_FLAG,
COMNAME1)
values (#{id,jdbcType=VARCHAR}, #{tenancyId,jdbcType=VARCHAR}, #{ruleId,jdbcType=VARCHAR},
#{keyName,jdbcType=VARCHAR}, #{operChar,jdbcType=VARCHAR}, #{compareVal,jdbcType=VARCHAR},
#{createdBy,jdbcType=VARCHAR}, #{createdOn,jdbcType=TIMESTAMP}, #{updatedBy,jdbcType=VARCHAR},
#{updatedOn,jdbcType=TIMESTAMP}, #{compareName,jdbcType=VARCHAR}, #{delFlag,jdbcType=DECIMAL},
#{comname1,jdbcType=VARCHAR})
</insert>
<insert id="insertSelective" parameterType="com.ag.ctc.domain.pojo.TariffRitem">
<!--
WARNING - @mbggenerated
This element is automatically generated by MyBatis Generator, do not modify.
-->
insert into C_TARIFF_RITEM
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">
ID,
</if>
<if test="tenancyId != null">
TENANCY_ID,
</if>
<if test="ruleId != null">
RULE_ID,
</if>
<if test="keyName != null">
KEY_NAME,
</if>
<if test="operChar != null">
OPER_CHAR,
</if>
<if test="compareVal != null">
COMPARE_VAL,
</if>
<if test="createdBy != null">
CREATED_BY,
</if>
<if test="createdOn != null">
CREATED_ON,
</if>
<if test="updatedBy != null">
UPDATED_BY,
</if>
<if test="updatedOn != null">
UPDATED_ON,
</if>
<if test="compareName != null">
COMPARE_NAME,
</if>
<if test="delFlag != null">
DEL_FLAG,
</if>
<if test="comname1 != null">
COMNAME1,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null">
#{id,jdbcType=VARCHAR},
</if>
<if test="tenancyId != null">
#{tenancyId,jdbcType=VARCHAR},
</if>
<if test="ruleId != null">
#{ruleId,jdbcType=VARCHAR},
</if>
<if test="keyName != null">
#{keyName,jdbcType=VARCHAR},
</if>
<if test="operChar != null">
#{operChar,jdbcType=VARCHAR},
</if>
<if test="compareVal != null">
#{compareVal,jdbcType=VARCHAR},
</if>
<if test="createdBy != null">
#{createdBy,jdbcType=VARCHAR},
</if>
<if test="createdOn != null">
#{createdOn,jdbcType=TIMESTAMP},
</if>
<if test="updatedBy != null">
#{updatedBy,jdbcType=VARCHAR},
</if>
<if test="updatedOn != null">
#{updatedOn,jdbcType=TIMESTAMP},
</if>
<if test="compareName != null">
#{compareName,jdbcType=VARCHAR},
</if>
<if test="delFlag != null">
#{delFlag,jdbcType=DECIMAL},
</if>
<if test="comname1 != null">
#{comname1,jdbcType=VARCHAR},
</if>
</trim>
</insert>
<update id="updateByPrimaryKeySelective" parameterType="com.ag.ctc.domain.pojo.TariffRitem">
<!--
WARNING - @mbggenerated
This element is automatically generated by MyBatis Generator, do not modify.
-->
update C_TARIFF_RITEM
<set>
<if test="tenancyId != null">
TENANCY_ID = #{tenancyId,jdbcType=VARCHAR},
</if>
<if test="ruleId != null">
RULE_ID = #{ruleId,jdbcType=VARCHAR},
</if>
<if test="keyName != null">
KEY_NAME = #{keyName,jdbcType=VARCHAR},
</if>
<if test="operChar != null">
OPER_CHAR = #{operChar,jdbcType=VARCHAR},
</if>
<if test="compareVal != null">
COMPARE_VAL = #{compareVal,jdbcType=VARCHAR},
</if>
<if test="createdBy != null">
CREATED_BY = #{createdBy,jdbcType=VARCHAR},
</if>
<if test="createdOn != null">
CREATED_ON = #{createdOn,jdbcType=TIMESTAMP},
</if>
<if test="updatedBy != null">
UPDATED_BY = #{updatedBy,jdbcType=VARCHAR},
</if>
<if test="updatedOn != null">
UPDATED_ON = #{updatedOn,jdbcType=TIMESTAMP},
</if>
<if test="compareName != null">
COMPARE_NAME = #{compareName,jdbcType=VARCHAR},
</if>
<if test="delFlag != null">
DEL_FLAG = #{delFlag,jdbcType=DECIMAL},
</if>
<if test="comname1 != null">
COMNAME1 = #{comname1,jdbcType=VARCHAR},
</if>
</set>
where ID = #{id,jdbcType=VARCHAR}
</update>
<update id="updateByPrimaryKey" parameterType="com.ag.ctc.domain.pojo.TariffRitem">
<!--
WARNING - @mbggenerated
This element is automatically generated by MyBatis Generator, do not modify.
-->
update C_TARIFF_RITEM
set TENANCY_ID = #{tenancyId,jdbcType=VARCHAR},
RULE_ID = #{ruleId,jdbcType=VARCHAR},
KEY_NAME = #{keyName,jdbcType=VARCHAR},
OPER_CHAR = #{operChar,jdbcType=VARCHAR},
COMPARE_VAL = #{compareVal,jdbcType=VARCHAR},
CREATED_BY = #{createdBy,jdbcType=VARCHAR},
CREATED_ON = #{createdOn,jdbcType=TIMESTAMP},
UPDATED_BY = #{updatedBy,jdbcType=VARCHAR},
UPDATED_ON = #{updatedOn,jdbcType=TIMESTAMP},
COMPARE_NAME = #{compareName,jdbcType=VARCHAR},
DEL_FLAG = #{delFlag,jdbcType=DECIMAL},
COMNAME1 = #{comname1,jdbcType=VARCHAR}
where ID = #{id,jdbcType=VARCHAR}
</update>
<select id="selectByruleid" parameterType="java.lang.String" resultMap="BaseResultMap">
select
<include refid="Base_Column_List" />
from C_TARIFF_RITEM
where rule_ID = #{id,jdbcType=VARCHAR}
</select>
<delete id="deleteByRuleId" parameterType="java.lang.String">
delete from C_TARIFF_RITEM
where RULE_ID = #{id,jdbcType=VARCHAR}
</delete>
<update id="updateDelFlagById" parameterType="java.lang.String">
update C_TARIFF_RITEM
set DEL_FLAG = 1
where ID = #{id,jdbcType=VARCHAR}
</update>
</mapper>

View File

@@ -0,0 +1,65 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="resources/platform/wbgrid.WbResourceMapper">
<resultMap id="BaseResultMap" type="com.ag.dynamicmodule.wbgrid.pojo.WbResource">
<!--
WARNING - @mbg.generated
This element is automatically generated by MyBatis Generator, do not modify.
-->
<result column="RES_ID" jdbcType="VARCHAR" property="resId" />
<result column="ID" jdbcType="VARCHAR" property="id" />
</resultMap>
<resultMap extends="BaseResultMap" id="ResultMapWithBLOBs" type="com.ag.dynamicmodule.wbgrid.pojo.WbResource">
<!--
WARNING - @mbg.generated
This element is automatically generated by MyBatis Generator, do not modify.
-->
<result column="RES_CONTENT" jdbcType="BLOB" property="resContent" />
</resultMap>
<sql id="Blob_Column_List">
<!--
WARNING - @mbg.generated
This element is automatically generated by MyBatis Generator, do not modify.
-->
RES_CONTENT
</sql>
<insert id="insert" parameterType="com.ag.dynamicmodule.wbgrid.pojo.WbResource">
<!--
WARNING - @mbg.generated
This element is automatically generated by MyBatis Generator, do not modify.
-->
insert into WB_RESOURCE (RES_ID, ID, RES_CONTENT
)
values (#{resId,jdbcType=VARCHAR}, #{id,jdbcType=VARCHAR}, #{resContent,jdbcType=BLOB}
)
</insert>
<insert id="insertSelective" parameterType="com.ag.dynamicmodule.wbgrid.pojo.WbResource">
<!--
WARNING - @mbg.generated
This element is automatically generated by MyBatis Generator, do not modify.
-->
insert into WB_RESOURCE
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="resId != null">
RES_ID,
</if>
<if test="id != null">
ID,
</if>
<if test="resContent != null">
RES_CONTENT,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="resId != null">
#{resId,jdbcType=VARCHAR},
</if>
<if test="id != null">
#{id,jdbcType=VARCHAR},
</if>
<if test="resContent != null">
#{resContent,jdbcType=BLOB},
</if>
</trim>
</insert>
</mapper>

View File

@@ -0,0 +1,16 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
This is the JRebel configuration file. It maps the running application to your IDE workspace, enabling JRebel reloading for this project.
Refer to https://manuals.jrebel.com/jrebel/standalone/config.html for more information.
-->
<application generated-by="intellij" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://www.zeroturnaround.com" xsi:schemaLocation="http://www.zeroturnaround.com http://update.zeroturnaround.com/jrebel/rebel-2_3.xsd">
<id>IlogDynamicModule</id>
<classpath>
<dir name="E:/IdeaProject/AG_MYSQL_PLATFORM3.0/IlogDynamicModule/target/classes">
</dir>
</classpath>
</application>

View File

@@ -0,0 +1,67 @@
package ${classPath};
import com.ag.dynamicmodule.service.BaseMapperRepository;
import com.ag.dynamicmodule.service.IBaseServiceImpl;
import ${beanPath};
import org.mybatis.spring.SqlSessionTemplate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
/**
* Description:
* Author: ${author}
* Version: ${version}
* Create Date: ${date}
*/
@Service
public class ${className} {
@Autowired
SqlSessionTemplate sqlSessionTemplate;
@Autowired
private IBaseServiceImpl baseService;
/**
* Description: 新增和修改
* @param ${lowerBeanName}
* @return
* Note: Nothing much.
*/
public void save(${upperBeanName} ${lowerBeanName}){
baseService.save(new BaseMapperRepository(${lowerBeanName},sqlSessionTemplate,
"${sqlPath}"));
}
/**
* Description: 新增
* @param ${lowerBeanName}
* @return
* Note: Nothing much.
*/
public void insert(${upperBeanName} ${lowerBeanName}){
baseService.insert(new BaseMapperRepository(${lowerBeanName},sqlSessionTemplate,
"${sqlPath}"));
}
/**
* Description: 修改
* @param ${lowerBeanName}
* @return
* Note: Nothing much.
*/
public void update(${upperBeanName} ${lowerBeanName}){
baseService.update(new BaseMapperRepository(${lowerBeanName},sqlSessionTemplate,
"${sqlPath}"));
}
/**
* Description: 删除
* @param id
* @return
* Note: Nothing much.
*/
public void delete(String id){
baseService.delete(new BaseMapperRepository(id,sqlSessionTemplate,
"${sqlPath}"));
}
}

View File

@@ -0,0 +1,46 @@
package ${classPath};
import com.ag.dynamicmodule.service.IBaseServiceImpl;
import com.alibaba.fastjson.JSON;
import com.wb.util.WebUtil;
import org.json.JSONObject;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import org.springframework.transaction.annotation.Transactional;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
/**
* Description:
* Author: ${author}
* Version: ${version}
* Create Date: ${date}
*/
@Component
public class ${className} {
@Autowired
private IBaseServiceImpl baseService;
/**
* Description:
* @param object
* @param response
* @param request
* @return Note: Nothing much.
*/
@Transactional(rollbackFor = Exception.class)
public void saveCVesselCodeMethod(JSONObject object, HttpServletResponse response, HttpServletRequest request) {
//CVesselCode cVesselCode = JSON.parseObject(object.getString("cVesselCodeData"), CVesselCode.class);
baseService.setParameterValue(null,request);
//保存数据
//cVesselCodeBO.save(cVesselCode);
try {
String reJson= JSON.toJSONString(null);
WebUtil.send(response,null);
} catch (IOException e) {
e.printStackTrace();
}
}
}