diff --git a/src/main/java/com/emr/controller/FontController.java b/src/main/java/com/emr/controller/FontController.java index be40196..93804ab 100644 --- a/src/main/java/com/emr/controller/FontController.java +++ b/src/main/java/com/emr/controller/FontController.java @@ -5,6 +5,7 @@ import com.emr.dao.Emr_DictionaryMapper; import com.emr.entity.*; import com.emr.service.Archive_DetailService; import com.emr.service.Archive_MasterService; +import com.emr.service.ipml.ArchiveOtherService; import com.emr.service.ipml.TPrintinfoService; import com.emr.service.ipml.ZdAssortService; import com.emr.util.Msg; @@ -20,6 +21,7 @@ import org.springframework.stereotype.Controller; import org.springframework.ui.Model; import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestMethod; import org.springframework.web.bind.annotation.ResponseBody; import javax.servlet.http.HttpServletResponse; import java.text.SimpleDateFormat; @@ -47,6 +49,8 @@ public class FontController { private Emr_DictionaryMapper dictionaryMapper; @Autowired private ZdAssortService assortService; + @Autowired + private ArchiveOtherService archiveOtherService; @RequestMapping("selectIsPrintByPatienId") @ResponseBody public Msg selectIsPrintByPatienId(String patientId){ @@ -95,6 +99,7 @@ public class FontController { return retrunErrorPage(model,"记账号不存在!"); } model.addAttribute("patientId",list.get(0).getId()); + model.addAttribute("accountNumber",list.get(0).getPatientId()); model.addAttribute("assortIds",assortIds); return "font/showRecord"; } @@ -293,4 +298,49 @@ public class FontController { model.addAttribute("errorMsg",errorMsg); return "font/error"; } + + /** + * 对外预览病案接口页面点击刷新按钮 + * 按需采集 + * @param patientId 记账号 + * @return + * @throws Exception + */ + @RequestMapping(value="updateArchiveOther",method = RequestMethod.POST) + @ResponseBody + public Msg updateArchiveOther(String patientId,String masterId) throws Exception{ + if(StringUtils.isBlank(patientId)){ + return Msg.fail("记账号不能为空,请联系系统管理员"); + } + if(StringUtils.isBlank(masterId)){ + return Msg.fail("masterId不能为空,请联系系统管理员"); + } + //查询是否已归档 + Archive_Master master = archiveMasterService.selectByPrimaryKey(masterId); + //获取状态码 + String archivestate = master.getArchivestate(); + if(StringUtils.isNotBlank(archivestate) && "128".equals(archivestate)){ + //已归档 + return Msg.success().add("data",1); + } + archiveOtherService.updateArchiveOther(patientId,masterId); + return Msg.success(); + } + + /** + * 根据记账号实时查询archiveOther的C1字段是否变更为done + * @param patientId 记账号 + * @return + * @throws Exception + */ + @RequestMapping("selectC1ByPatientId") + @ResponseBody + public Msg selectC1ByPatientId(String patientId) throws Exception{ + int count = archiveOtherService.selectC1ByPatientId(patientId); + if(count == 1){ + return Msg.success(); + }else{ + return null; + } + } } diff --git a/src/main/java/com/emr/controller/LoginController.java b/src/main/java/com/emr/controller/LoginController.java index 369e6e0..328da1b 100644 --- a/src/main/java/com/emr/controller/LoginController.java +++ b/src/main/java/com/emr/controller/LoginController.java @@ -1,6 +1,8 @@ package com.emr.controller; +import com.alibaba.fastjson.JSONObject; import com.emr.entity.Power_User; +import com.emr.util.HttpClientUtils; import com.fasterxml.jackson.databind.ObjectMapper; import org.apache.commons.lang3.StringUtils; import org.apache.cxf.endpoint.Client; @@ -38,8 +40,21 @@ public class LoginController { //实现用户登录@PathVariable("username") @RequestMapping(value = "/login") public String login(Model model, HttpServletRequest request) throws Exception{ - String token = request.getParameter("token"); - if(StringUtils.isNoneBlank(token)){ + String token = request.getParameter("token"); + String userName = request.getParameter("userName"); + if(StringUtils.isNoneBlank(token)){ + //高明归档特殊token=1462903487866169011 + if("1462903487866169011".equals(token)){ + //请求权限系统根据用户名登录换取token + String requestUrl = POWER_URLHEAD + "/font/getToken?userName="+userName+"&password="+token; + JSONObject obj = HttpClientUtils.httpGet(requestUrl); + if(obj!=null) { + if ((obj.getString("code")).equals("100")) { + JSONObject extend = obj.getJSONObject("extend"); + token = extend.getString("token"); + } + } + } JAXDynamicClientFactory dcf = JAXDynamicClientFactory.newInstance(); Client client = dcf.createClient(POWER_URLHEAD + "/WebService/PowerWebService?wsdl"); Object[] objects = client.invoke("getInfosByUserId", token, "emr_medical_record"); @@ -48,9 +63,8 @@ public class LoginController { //设置进session request.getSession().setAttribute("CURRENT_USER", powerUser); if (null == powerUser.getUserId()) { - return "redirect:/emr_medical_record/error.jsp"; + return "redirect:/error.jsp"; } - String userName = request.getParameter("userName"); UsernamePasswordToken userToken = new UsernamePasswordToken(userName, "123456"); Subject subject = SecurityUtils.getSubject(); subject.login(userToken); diff --git a/src/main/java/com/emr/dao/ArchiveOtherMapper.java b/src/main/java/com/emr/dao/ArchiveOtherMapper.java new file mode 100644 index 0000000..ddb3c15 --- /dev/null +++ b/src/main/java/com/emr/dao/ArchiveOtherMapper.java @@ -0,0 +1,26 @@ +package com.emr.dao; + +import com.emr.entity.ArchiveOther; + +import java.util.List; + +public interface ArchiveOtherMapper { + int deleteByPrimaryKey(Long id); + + int insert(ArchiveOther record); + + int insertSelective(ArchiveOther record); + + ArchiveOther selectByPrimaryKey(Long id); + + int updateByPrimaryKeySelective(ArchiveOther record); + + int updateByPrimaryKey(ArchiveOther record); + + /** + * 根据patientId查询是否存在 + * @param patientId 记账号 + * @return + */ + List selectExistByPatientId(String patientId); +} \ No newline at end of file diff --git a/src/main/java/com/emr/entity/ArchiveOther.java b/src/main/java/com/emr/entity/ArchiveOther.java new file mode 100644 index 0000000..1b97e29 --- /dev/null +++ b/src/main/java/com/emr/entity/ArchiveOther.java @@ -0,0 +1,239 @@ +package com.emr.entity; + +import java.io.Serializable; +import java.math.BigDecimal; +import java.util.Date; + +public class ArchiveOther implements Serializable { + private Long id; + + private String pid; + + private Date createdtime; + + private String otherinfo; + + private String masterid; + + private String detailid; + + private Date dtime; + + private Integer sysflag; + + private String c1; + + private String c2; + + private String c3; + + private String c4; + + private String c5; + + private BigDecimal n1; + + private BigDecimal n2; + + private BigDecimal n3; + + private Date t1; + + private Date t2; + + private Date t3; + + private Boolean isfulltext; + + private static final long serialVersionUID = 1L; + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public String getPid() { + return pid; + } + + public void setPid(String pid) { + this.pid = pid == null ? null : pid.trim(); + } + + public Date getCreatedtime() { + return createdtime; + } + + public void setCreatedtime(Date createdtime) { + this.createdtime = createdtime; + } + + public String getOtherinfo() { + return otherinfo; + } + + public void setOtherinfo(String otherinfo) { + this.otherinfo = otherinfo == null ? null : otherinfo.trim(); + } + + public String getMasterid() { + return masterid; + } + + public void setMasterid(String masterid) { + this.masterid = masterid == null ? null : masterid.trim(); + } + + public String getDetailid() { + return detailid; + } + + public void setDetailid(String detailid) { + this.detailid = detailid == null ? null : detailid.trim(); + } + + public Date getDtime() { + return dtime; + } + + public void setDtime(Date dtime) { + this.dtime = dtime; + } + + public Integer getSysflag() { + return sysflag; + } + + public void setSysflag(Integer sysflag) { + this.sysflag = sysflag; + } + + public String getC1() { + return c1; + } + + public void setC1(String c1) { + this.c1 = c1 == null ? null : c1.trim(); + } + + public String getC2() { + return c2; + } + + public void setC2(String c2) { + this.c2 = c2 == null ? null : c2.trim(); + } + + public String getC3() { + return c3; + } + + public void setC3(String c3) { + this.c3 = c3 == null ? null : c3.trim(); + } + + public String getC4() { + return c4; + } + + public void setC4(String c4) { + this.c4 = c4 == null ? null : c4.trim(); + } + + public String getC5() { + return c5; + } + + public void setC5(String c5) { + this.c5 = c5 == null ? null : c5.trim(); + } + + public BigDecimal getN1() { + return n1; + } + + public void setN1(BigDecimal n1) { + this.n1 = n1; + } + + public BigDecimal getN2() { + return n2; + } + + public void setN2(BigDecimal n2) { + this.n2 = n2; + } + + public BigDecimal getN3() { + return n3; + } + + public void setN3(BigDecimal n3) { + this.n3 = n3; + } + + public Date getT1() { + return t1; + } + + public void setT1(Date t1) { + this.t1 = t1; + } + + public Date getT2() { + return t2; + } + + public void setT2(Date t2) { + this.t2 = t2; + } + + public Date getT3() { + return t3; + } + + public void setT3(Date t3) { + this.t3 = t3; + } + + public Boolean getIsfulltext() { + return isfulltext; + } + + public void setIsfulltext(Boolean isfulltext) { + this.isfulltext = isfulltext; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append(getClass().getSimpleName()); + sb.append(" ["); + sb.append("Hash = ").append(hashCode()); + sb.append(", id=").append(id); + sb.append(", pid=").append(pid); + sb.append(", createdtime=").append(createdtime); + sb.append(", otherinfo=").append(otherinfo); + sb.append(", masterid=").append(masterid); + sb.append(", detailid=").append(detailid); + sb.append(", dtime=").append(dtime); + sb.append(", sysflag=").append(sysflag); + sb.append(", c1=").append(c1); + sb.append(", c2=").append(c2); + sb.append(", c3=").append(c3); + sb.append(", c4=").append(c4); + sb.append(", c5=").append(c5); + sb.append(", n1=").append(n1); + sb.append(", n2=").append(n2); + sb.append(", n3=").append(n3); + sb.append(", t1=").append(t1); + sb.append(", t2=").append(t2); + sb.append(", t3=").append(t3); + sb.append(", isfulltext=").append(isfulltext); + sb.append("]"); + return sb.toString(); + } +} \ No newline at end of file diff --git a/src/main/java/com/emr/service/ipml/ArchiveOtherService.java b/src/main/java/com/emr/service/ipml/ArchiveOtherService.java new file mode 100644 index 0000000..d1b0117 --- /dev/null +++ b/src/main/java/com/emr/service/ipml/ArchiveOtherService.java @@ -0,0 +1,96 @@ +package com.emr.service.ipml; + +import com.emr.dao.ArchiveOtherMapper; +import com.emr.entity.ArchiveOther; +import com.emr.util.IDHelper; +import org.apache.commons.lang.StringUtils; +import org.apache.shiro.util.CollectionUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.math.BigDecimal; +import java.text.SimpleDateFormat; +import java.util.Date; +import java.util.List; + +/** + * @ProjectName: + * @Description: + * @Param 传输参数 + * @Return + * @Author: 曾文和 + * @CreateDate: 2020/7/8 10:33 + * @UpdateUser: 曾文和 + * @UpdateDate: 2020/7/8 10:33 + * @UpdateRemark: 更新说明 + * @Version: 1.0 + */ +@Service +@Transactional +public class ArchiveOtherService { + @Autowired + private ArchiveOtherMapper archiveOtherMapper; + + /** + * 存在将C1置为'' 不存在新增一条记录 + * @param patientId 记账号 + */ + public void updateArchiveOther(String patientId,String masterId) throws Exception{ + //查询记账号是否存在 + List archiveOthers = archiveOtherMapper.selectExistByPatientId(patientId); + if(!CollectionUtils.isEmpty(archiveOthers)){ + //存在则将C1值置为空字符串 + ArchiveOther archiveOther = archiveOthers.get(0); + archiveOther.setC1(""); + archiveOtherMapper.updateByPrimaryKeySelective(archiveOther); + }else{ + //不存在则新增 + ArchiveOther archiveOther = new ArchiveOther(); + long id = IDHelper.NewID(); + archiveOther.setId(id); + archiveOther.setPid(patientId); + archiveOther.setCreatedtime(new Date()); + archiveOther.setOtherinfo("护理系统按需采集"); + archiveOther.setMasterid(masterId); + archiveOther.setDetailid("0"); + archiveOther.setDtime(new Date()); + archiveOther.setSysflag(-2); + archiveOther.setC1(""); + archiveOther.setC2(""); + archiveOther.setC3(""); + archiveOther.setC4(""); + archiveOther.setC5(""); + archiveOther.setN1(BigDecimal.valueOf(0)); + archiveOther.setN2(BigDecimal.valueOf(0)); + archiveOther.setN3(BigDecimal.valueOf(0)); + String date = "1801-02-03 00:00:00"; + SimpleDateFormat fmt = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); + archiveOther.setT1(fmt.parse(date)); + archiveOther.setT2(fmt.parse(date)); + archiveOther.setT3(fmt.parse(date)); + archiveOther.setIsfulltext(false); + archiveOtherMapper.insert(archiveOther); + } + } + + /** + * @param patientId 记账号 + * @return + */ + public int selectC1ByPatientId(String patientId) { + List archiveOthers = archiveOtherMapper.selectExistByPatientId(patientId); + if(!CollectionUtils.isEmpty(archiveOthers)){ + //获取对象 + ArchiveOther archiveOther = archiveOthers.get(0); + //获取C1值 + String c1 = archiveOther.getC1(); + //定义c1需求值 + String c1Temp = "done"; + if(StringUtils.isNotBlank(c1) && c1Temp.equals(c1)){ + return 1; + } + } + return 0; + } +} diff --git a/src/main/java/com/emr/util/ExSys.java b/src/main/java/com/emr/util/ExSys.java new file mode 100644 index 0000000..615be04 --- /dev/null +++ b/src/main/java/com/emr/util/ExSys.java @@ -0,0 +1,9 @@ +package com.emr.util; + + +public class ExSys extends Exception { + public ExSys(String message, Object... args) + { + super(String.format(message, args)); + } +} diff --git a/src/main/java/com/emr/util/IDHelper.java b/src/main/java/com/emr/util/IDHelper.java new file mode 100644 index 0000000..7670466 --- /dev/null +++ b/src/main/java/com/emr/util/IDHelper.java @@ -0,0 +1,294 @@ +package com.emr.util; + +import org.apache.commons.lang3.StringUtils; + +import java.text.SimpleDateFormat; +import java.util.Calendar; +import java.util.Date; +import java.util.TimeZone; +import java.util.UUID; + +/* +* 该类,只能用于随机数,可以实现时间与long类型的转化 +* 如果当前系统的时区与服务器同步,则时间与long可以完全与服务器同步,也可相互转化 +* +* */ +public final class IDHelper { + + public static final long BASE = 2; + public static final long MIN_YEAR = 2000; + public static final long MAX_YEAR = 2127; + public static final long MIN_RANDOM = 0; + public static final long MAX_RANDOM = 1048575; + + private static final long UP_YEAR = 62; // bits: 7 max: 127 + private static final long DN_YEAR = 56; + private static final long UP_MONTH = 55; // bits: 4 max: 15 + private static final long DN_MONTH = 52; + private static final long UP_DAY = 51; // bits: 5 max: 31 + private static final long DN_DAY = 47; + private static final long UP_HOUR = 46; // bits: 5 max: 31 + private static final long DN_HOUR = 42; + private static final long UP_MINUTE = 41; // bits: 6 max: 63 + private static final long DN_MINUTE = 36; + private static final long UP_SECOND = 35; // bits: 6 max: 63 + private static final long DN_SECOND = 30; + private static final long UP_MILLI_SECOND = 29; // bits: 10 max: 1023 + private static final long DN_MILLI_SECOND = 20; + private static final long UP_RANDOM = 19; // bits: 20 max: 1048575 FFFFF + private static final long DN_RANDOM = 0; + + private static long DN_YEAR_POW = (long)Math.pow(BASE, DN_YEAR); + private static long DN_MONTH_POW = (long)Math.pow(BASE, DN_MONTH); + private static long DN_DAY_POW = (long)Math.pow(BASE, DN_DAY); + private static long DN_HOUR_POW = (long)Math.pow(BASE, DN_HOUR); + private static long DN_MINUTE_POW = (long)Math.pow(BASE, DN_MINUTE); + private static long DN_SECOND_POW = (long)Math.pow(BASE, DN_SECOND); + private static long DN_MILLI_SECOND_POW = (long)Math.pow(BASE, DN_MILLI_SECOND); + private static long DN_RANDOM_POW = (long)Math.pow(BASE, DN_RANDOM); + + + public static long GetRandom(long id) + { + return id % DN_MILLI_SECOND_POW + MIN_RANDOM; + } + public static long MIN_ID() throws Exception + { + Calendar c = Calendar.getInstance(); + c.set((int)MIN_YEAR,0,1,0,0,0); + + return NewID(c, MIN_RANDOM); + } + public static long MAX_ID() throws Exception + { + Calendar c = Calendar.getInstance(); + c.set((int)MAX_YEAR,11,31,23,59,59); + + return NewID(c, MIN_RANDOM); + } + + + public static long NewID(Calendar datetime, long random) throws Exception + { + int yy = datetime.get(Calendar.YEAR); + int mm = datetime.get(Calendar.MONTH)+1; + int dd = datetime.get(Calendar.DATE); + int hh = datetime.get(Calendar.HOUR_OF_DAY); + int MM = datetime.get(Calendar.MINUTE); + int ss = datetime.get(Calendar.SECOND); + int mi = datetime.get(Calendar.MILLISECOND); + if (yy > MAX_YEAR) + { + throw new ExSys("Year(%d) can not be more than %d !", yy, MAX_YEAR); + } + if (yy < MIN_YEAR) + { + throw new ExSys("Year(%d) can not be less than %d!", yy, MIN_YEAR); + } + if (random > MAX_RANDOM) + { + throw new ExSys("Random(%d) can not be more than %d!", random, MAX_RANDOM); + } + if (random < MIN_RANDOM) + { + throw new ExSys("Random(%d) can not be less than %d!", random, MIN_RANDOM); + } + long id = 0; + + id += ((long)yy - MIN_YEAR) * DN_YEAR_POW; + id += ((long)mm) * DN_MONTH_POW; + id += ((long)dd) * DN_DAY_POW; + id += ((long)hh) * DN_HOUR_POW; + id += ((long)MM) * DN_MINUTE_POW; + id += ((long)ss) * DN_SECOND_POW; + id += ((long)mi) * DN_MILLI_SECOND_POW; + id += (random - MIN_RANDOM) * DN_RANDOM_POW; + return id; + } + + + + public static long NewID(Calendar datetime) throws Exception + { + UUID id= UUID.randomUUID(); + String strID = id.toString().substring(0,5); + long random = Long.parseLong(strID, 16); + return NewID(datetime, random); + } + + public static long NewID() throws Exception + { + Calendar c = Calendar.getInstance(); + c.setTime(new Date()); + return NewID(c); + } + + public static Calendar GetDateTimeWithoutMilliseconds(long id) throws Exception + { + if (id < MIN_ID() || id > MAX_ID()) + { + throw new ExSys("Invalid id! \"%d\"", id); + } + long YEAR = id / DN_YEAR_POW + MIN_YEAR; + long MONTH = (id % DN_YEAR_POW) / DN_MONTH_POW; + long DAY = (id % DN_MONTH_POW) / DN_DAY_POW; + long HOUR = (id % DN_DAY_POW) / DN_HOUR_POW; + long MINUTE = (id % DN_HOUR_POW) / DN_MINUTE_POW; + long SECOND = (id % DN_MINUTE_POW) / DN_SECOND_POW; + + + Calendar c = Calendar.getInstance(); + c.set((int)YEAR,(int)MONTH-1,(int)DAY,(int)HOUR,(int)MINUTE,(int)SECOND); + return c; + } + + public static String GetDateTimeWithoutMilliseconds(long id, String format) throws Exception + { + Calendar c =GetDateTimeWithoutMilliseconds(id); + return ConvertToStringFromDateTime(c, format); + } + + public static String ConvertToStringFromDateTime(Calendar c, String format) throws Exception + { + String str = (new SimpleDateFormat(format)).format(c.getTime()); + return str; + } + public static String ConvertToStringFromDateTime(Date c, String format) throws Exception + { + String str = (new SimpleDateFormat(format)).format(c); + return str; + } + + public static String GetDateTime_yyyy_MM_dd_HH_mm_ss_sss(long id) throws Exception + { + return GetDateTimeWithoutMilliseconds(id, "yyyy-MM-dd HH:mm:ss:SSS"); + } + + public static String DefaultDateTime1 = "1900-01-01 00:00:00"; + public static String DefaultDateTime2 = "2099-12-31 23:59:59"; + public static String EmptyDateTime = "1801-02-03 00:00:00"; + + + public static Calendar GetCalendarFromStr_yyyyMMddHHmmss(String strTime) throws Exception + { + String tmpTime = strTime.trim(); + tmpTime = tmpTime.replace("-", ""); + tmpTime = tmpTime.replace(".", ""); + tmpTime = tmpTime.replace("/", ""); + tmpTime = tmpTime.replace(":", ""); + tmpTime = tmpTime.replace(" ", ""); + if (StringUtils.isBlank(tmpTime)) + { + throw new Exception("日期格式错误。"); + } + + int yy, MM, dd, HH, mm, ss; + String syy, sMM, sdd, sHH, smm, sss; + syy = tmpTime.substring(0, 4); + sMM = tmpTime.substring(4, 6); + sdd = tmpTime.substring(6, 8); + sHH = tmpTime.substring(8, 10); + smm = tmpTime.substring(10, 12); + sss = tmpTime.substring(12); + + yy = Integer.valueOf(syy); + MM = Integer.valueOf(sMM) - 1; + dd = Integer.valueOf(sdd); + HH = Integer.valueOf(sHH); + mm = Integer.valueOf(smm); + ss = Integer.valueOf(sss); + + Calendar c = Calendar.getInstance(TimeZone.getTimeZone("GMT+8:00")); + c.set(yy, MM, dd, HH, mm, ss); + return c; + } + + + + public static Calendar cEmptyDateTime() + { + Calendar c= Calendar.getInstance(); + c.set(1801, 1,3,0,0,0); + return c; + } + + public static boolean IsEmptyDateTime(Calendar c) throws Exception + { + String str = GetDatetime_Min(c); + return str.equals(EmptyDateTime); + } + public static boolean IsEmptyDateTime(String c) throws Exception + { + return c.equals(EmptyDateTime); + } + public static boolean IsEmptyDateTime(Date date) throws Exception + { + Calendar c = Calendar.getInstance(); + c.setTime(date); + return IsEmptyDateTime(c); + } + + + public static String GetDatetime_Max(Calendar dt) throws Exception + { + return ConvertToStringFromDateTime(dt,"yyyy-MM-dd") + " 23:59:59.995"; + } + public static String GetDatetime_Min(Calendar dt) throws Exception + { + return ConvertToStringFromDateTime(dt,"yyyy-MM-dd") + " 00:00:00.002"; + } + public static String GetNow_Max() throws Exception + { + Calendar c= Calendar.getInstance(); + c.setTime(c.getTime()); + return GetDatetime_Max(c); + } + public static String GetNow_Min() throws Exception + { + Calendar c= Calendar.getInstance(); + c.setTime(c.getTime()); + return GetDatetime_Min(c); + } + + public static Calendar dt_GetDatetime_Max(Calendar dt) throws Exception + { + + int yy = dt.get(Calendar.YEAR); + int mm = dt.get(Calendar.MONTH)+1; + int dd = dt.get(Calendar.DATE); +// int hh = datetime.get(Calendar.HOUR_OF_DAY); +// int MM = datetime.get(Calendar.MINUTE); +// int ss = datetime.get(Calendar.SECOND); +// int mi = datetime.get(Calendar.MILLISECOND); + Calendar c = Calendar.getInstance(); + c.set(yy,mm,dd, 23,59,59); + return c; + } + public static Calendar dt_GetDatetime_Min(Calendar dt) throws Exception + { + int yy = dt.get(Calendar.YEAR); + int mm = dt.get(Calendar.MONTH)+1; + int dd = dt.get(Calendar.DATE); +// int hh = datetime.get(Calendar.HOUR_OF_DAY); +// int MM = datetime.get(Calendar.MINUTE); +// int ss = datetime.get(Calendar.SECOND); +// int mi = datetime.get(Calendar.MILLISECOND); + Calendar c = Calendar.getInstance(); + c.set(yy,mm,dd, 0,0,0); + return c; + } + public static Calendar dt_GetNow_Max() throws Exception + { + Calendar c= Calendar.getInstance(); + c.setTime(c.getTime()); + return dt_GetDatetime_Max(c); + } + public static Calendar dt_GetNow_Min() throws Exception + { + Calendar c= Calendar.getInstance(); + c.setTime(c.getTime()); + return dt_GetDatetime_Min(c); + } + + +} diff --git a/src/main/resources/mapper/ArchiveOtherMapper.xml b/src/main/resources/mapper/ArchiveOtherMapper.xml new file mode 100644 index 0000000..6c73bb6 --- /dev/null +++ b/src/main/resources/mapper/ArchiveOtherMapper.xml @@ -0,0 +1,271 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + ID, pid, createdtime, otherInfo, masterID, detailID, dTime, sysFlag, C1, C2, C3, + C4, C5, N1, N2, N3, T1, T2, T3, IsFullText + + + + delete from archive_other + where ID = #{id,jdbcType=BIGINT} + + + insert into archive_other (ID, pid, createdtime, + otherInfo, masterID, detailID, + dTime, sysFlag, C1, + C2, C3, C4, C5, + N1, N2, N3, T1, + T2, T3, IsFullText) + values (#{id,jdbcType=BIGINT}, #{pid,jdbcType=NVARCHAR}, #{createdtime,jdbcType=TIMESTAMP}, + #{otherinfo,jdbcType=VARCHAR}, #{masterid,jdbcType=NVARCHAR}, #{detailid,jdbcType=NVARCHAR}, + #{dtime,jdbcType=TIMESTAMP}, #{sysflag,jdbcType=INTEGER}, #{c1,jdbcType=NVARCHAR}, + #{c2,jdbcType=NVARCHAR}, #{c3,jdbcType=NVARCHAR}, #{c4,jdbcType=NVARCHAR}, #{c5,jdbcType=NVARCHAR}, + #{n1,jdbcType=DECIMAL}, #{n2,jdbcType=DECIMAL}, #{n3,jdbcType=DECIMAL}, #{t1,jdbcType=TIMESTAMP}, + #{t2,jdbcType=TIMESTAMP}, #{t3,jdbcType=TIMESTAMP}, #{isfulltext,jdbcType=BIT}) + + + insert into archive_other + + + ID, + + + pid, + + + createdtime, + + + otherInfo, + + + masterID, + + + detailID, + + + dTime, + + + sysFlag, + + + C1, + + + C2, + + + C3, + + + C4, + + + C5, + + + N1, + + + N2, + + + N3, + + + T1, + + + T2, + + + T3, + + + IsFullText, + + + + + #{id,jdbcType=BIGINT}, + + + #{pid,jdbcType=NVARCHAR}, + + + #{createdtime,jdbcType=TIMESTAMP}, + + + #{otherinfo,jdbcType=VARCHAR}, + + + #{masterid,jdbcType=NVARCHAR}, + + + #{detailid,jdbcType=NVARCHAR}, + + + #{dtime,jdbcType=TIMESTAMP}, + + + #{sysflag,jdbcType=INTEGER}, + + + #{c1,jdbcType=NVARCHAR}, + + + #{c2,jdbcType=NVARCHAR}, + + + #{c3,jdbcType=NVARCHAR}, + + + #{c4,jdbcType=NVARCHAR}, + + + #{c5,jdbcType=NVARCHAR}, + + + #{n1,jdbcType=DECIMAL}, + + + #{n2,jdbcType=DECIMAL}, + + + #{n3,jdbcType=DECIMAL}, + + + #{t1,jdbcType=TIMESTAMP}, + + + #{t2,jdbcType=TIMESTAMP}, + + + #{t3,jdbcType=TIMESTAMP}, + + + #{isfulltext,jdbcType=BIT}, + + + + + update archive_other + + + pid = #{pid,jdbcType=NVARCHAR}, + + + createdtime = #{createdtime,jdbcType=TIMESTAMP}, + + + otherInfo = #{otherinfo,jdbcType=VARCHAR}, + + + masterID = #{masterid,jdbcType=NVARCHAR}, + + + detailID = #{detailid,jdbcType=NVARCHAR}, + + + dTime = #{dtime,jdbcType=TIMESTAMP}, + + + sysFlag = #{sysflag,jdbcType=INTEGER}, + + + C1 = #{c1,jdbcType=NVARCHAR}, + + + C2 = #{c2,jdbcType=NVARCHAR}, + + + C3 = #{c3,jdbcType=NVARCHAR}, + + + C4 = #{c4,jdbcType=NVARCHAR}, + + + C5 = #{c5,jdbcType=NVARCHAR}, + + + N1 = #{n1,jdbcType=DECIMAL}, + + + N2 = #{n2,jdbcType=DECIMAL}, + + + N3 = #{n3,jdbcType=DECIMAL}, + + + T1 = #{t1,jdbcType=TIMESTAMP}, + + + T2 = #{t2,jdbcType=TIMESTAMP}, + + + T3 = #{t3,jdbcType=TIMESTAMP}, + + + IsFullText = #{isfulltext,jdbcType=BIT}, + + + where ID = #{id,jdbcType=BIGINT} + + + update archive_other + set pid = #{pid,jdbcType=NVARCHAR}, + createdtime = #{createdtime,jdbcType=TIMESTAMP}, + otherInfo = #{otherinfo,jdbcType=VARCHAR}, + masterID = #{masterid,jdbcType=NVARCHAR}, + detailID = #{detailid,jdbcType=NVARCHAR}, + dTime = #{dtime,jdbcType=TIMESTAMP}, + sysFlag = #{sysflag,jdbcType=INTEGER}, + C1 = #{c1,jdbcType=NVARCHAR}, + C2 = #{c2,jdbcType=NVARCHAR}, + C3 = #{c3,jdbcType=NVARCHAR}, + C4 = #{c4,jdbcType=NVARCHAR}, + C5 = #{c5,jdbcType=NVARCHAR}, + N1 = #{n1,jdbcType=DECIMAL}, + N2 = #{n2,jdbcType=DECIMAL}, + N3 = #{n3,jdbcType=DECIMAL}, + T1 = #{t1,jdbcType=TIMESTAMP}, + T2 = #{t2,jdbcType=TIMESTAMP}, + T3 = #{t3,jdbcType=TIMESTAMP}, + IsFullText = #{isfulltext,jdbcType=BIT} + where ID = #{id,jdbcType=BIGINT} + + + + \ No newline at end of file diff --git a/src/main/webapp/WEB-INF/views/font/showRecord.jsp b/src/main/webapp/WEB-INF/views/font/showRecord.jsp index 27a200c..3ff11a4 100644 --- a/src/main/webapp/WEB-INF/views/font/showRecord.jsp +++ b/src/main/webapp/WEB-INF/views/font/showRecord.jsp @@ -90,7 +90,10 @@ + + +
diff --git a/src/main/webapp/WEB-INF/views/font/showRecordIframe.jsp b/src/main/webapp/WEB-INF/views/font/showRecordIframe.jsp index 697ac0e..a1d917a 100644 --- a/src/main/webapp/WEB-INF/views/font/showRecordIframe.jsp +++ b/src/main/webapp/WEB-INF/views/font/showRecordIframe.jsp @@ -47,13 +47,14 @@
-
-
-
+
+
+ +
@@ -66,7 +67,7 @@
- + diff --git a/src/main/webapp/error.jsp b/src/main/webapp/error.jsp index 29b8f25..14f4022 100644 --- a/src/main/webapp/error.jsp +++ b/src/main/webapp/error.jsp @@ -9,7 +9,7 @@ <%----%> - <%@ include file="/WEB-INF/jspf/common.jspf" %> + <%@ include file="/WEB-INF/jspf/comm.jspf" %>