igds-api-inte/src/main/java/com/ld/igds/sh/service/ApiShServiceImpl1404.java
@@ -21,6 +21,7 @@ import org.apache.commons.lang3.time.DateUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import java.util.ArrayList; import java.util.Date; import java.util.List; @@ -40,6 +41,7 @@ private InteStatusLogService inteStatusLogService; @Autowired private RedisUtil redisUtil; @Override public String getInterfaceId() { return ApiShConst.API_SH_1404; @@ -96,7 +98,7 @@ dto.setXzxgpj(StringUtils.isEmpty(data.getEvaluate())?"0":data.getEvaluate()); dto.setCzsjff(StringUtils.isEmpty(data.getCzsjff())?"0":data.getCzsjff()); dto.setCzclcs(StringUtils.isEmpty(data.getCzclcs())?"0":data.getCzclcs()); dto.setXzzyry(StringUtils.isEmpty(data.getUser())?"0":data.getUser()); // dto.setXzzyry(StringUtils.isEmpty(data.getUser())?"0":data.getUser()); dto.setZhgxsj(DateFormatUtils.format(new Date(), "yyyy-MM-dd HH:mm:ss")); //查询日志状态表,设置操作标志 igds-recir/src/main/java/com/ld/igds/drug/service/DrugLogRowMapper.java
igds-recir/src/main/java/com/ld/igds/drug/service/DrugRowMapper.java
@@ -17,7 +17,7 @@ data.setCount(rs.getInt("COUNT_")); data.setDosage(rs.getString("DOSAGE_")); data.setName(rs.getString("NAME_")); data.setSpec(rs.getString("SPEC_")); // data.setSpec(rs.getString("SPEC_")); data.setRemarks(rs.getString("REMARKS_")); data.setUpdateTime(rs.getTimestamp("UPDATE_TIME_")); data.setUpdateUser(rs.getString("UPDATE_USER_")); igds-recir/src/main/java/com/ld/igds/drug/service/HDrugLogService.java
@@ -9,6 +9,7 @@ import org.apache.commons.lang3.time.DateFormatUtils; import org.hibernate.Session; import org.springframework.stereotype.Service; import java.util.Date; import java.util.HashMap; import java.util.List; @@ -91,7 +92,7 @@ data.setUpdateUser(ContextUtil.getLoginUserCName()); try { if (null == data.getId()) { data.setId(DateFormatUtils.format(new Date(), "yyyyMMdd") + getIndex(data.getCompanyId())); data.setId(data.getDepotId() + DateFormatUtils.format(new Date(), "yyyyMMdd") + getIndex(data.getCompanyId())); session.save(data); } else { session.update(data); @@ -103,6 +104,7 @@ session.close(); } } public String delData(DrugLog data) { Session session = this.getSessionFactory().openSession(); try { igds-recir/src/main/java/com/ld/igds/drug/service/HDrugService.java
@@ -1,271 +1,154 @@ package com.ld.igds.drug.service; import java.util.ArrayList; import java.util.Date; import java.util.List; import java.util.Map; import java.util.*; import org.apache.commons.lang3.StringUtils; import org.springframework.stereotype.Repository; import com.bstek.bdf2.core.model.DefaultDept; import com.bstek.bdf2.core.orm.hibernate.HibernateDao; import com.bstek.bdf2.core.orm.jdbc.JdbcDao; import com.bstek.dorado.data.provider.Page; import com.ld.igds.constant.RedisConst; import com.ld.igds.models.Drug; import com.ld.igds.models.DrugApply; import com.ld.igds.models.DrugInout; import com.ld.igds.models.DrugLog; import com.ld.igds.sys.service.SysDeptService; import com.ld.igds.util.ContextUtil; import com.ld.igds.util.RedisUtil; import org.apache.commons.lang3.StringUtils; import org.hibernate.Session; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; /** * 后期调整为Hibernate * @author Andy * 药剂管理 * * @author Andy */ @Repository public class HDrugService extends JdbcDao { @Service public class HDrugService extends HibernateDao { @Autowired private RedisUtil redisUtil; @Autowired private SysDeptService sysDeptService; public void pageDrug(Page<Drug> page, Map<String, Object> param) throws Exception { /** * 缓存 药剂ID */ public static final String CACHE_DRUG_ID = "LOSS_DRUG_ID"; List<Object> args = new ArrayList<Object>(); args.add(ContextUtil.getCompanyId()); String sql = "select * from D_DRUG where company_id_ =? "; /** * 分页查询药剂信息 * * @param page * @param param * @throws Exception */ public void pageDrug(Page<Drug> page, Map<String, Object> param) throws Exception { StringBuffer hql = new StringBuffer(); Map<String, Object> args = new HashMap<>(); hql.append(" from " + Drug.class.getName() + " where companyId=:companyId"); args.put("companyId", ContextUtil.getCompanyId()); if (null != param) { String str = (String) param.get("name"); if (StringUtils.isNotEmpty(str)) { sql += " and name_ like ?"; args.add("%" + str + "%"); buildHql(hql, param, args); } } sql += " order by name_ "; this.pagingQuery(page, sql, args.toArray(), new DrugRowMapper()); hql.append(" order by id "); String countHql = "select count(*) " + hql.toString(); this.pagingQuery(page, String.valueOf(hql), countHql, args); } public List<Drug> listDrug(String name) { /** * 获取药剂列表 * * @param companyId * @return */ public List<Drug> listDrug(String companyId, Map<String, Object> param) { StringBuffer hql = new StringBuffer(" from " + Drug.class.getName() + " where companyId=:companyId"); Map<String, Object> args = new HashMap<>(); args.put("companyId", companyId); if (null != param) { buildHql(hql, param, args); } hql.append(" order by id desc"); return this.query(hql.toString(), args); String sql = "select * from D_DRUG where company_id_ =? "; List<Object> args = new ArrayList<Object>(); args.add(ContextUtil.getCompanyId()); if (StringUtils.isNotEmpty(name)) { sql += " and name_ like ?"; args.add("%" + name + "%"); } sql += " order by name_ "; return this.getJdbcTemplate().query(sql, args.toArray(), new DrugRowMapper()); /** * 更新或添加药剂信息 * * @param data * @return */ public String saveDrug(Drug data) { if (null == data.getCompanyId()) { data.setCompanyId(ContextUtil.getCompanyId()); } public String delDrug(Drug data) { if (null == data.getId()) { return null; if (null == data.getDeptId()) { data.setDeptId(ContextUtil.subDeptId(null)); } String sql = " delete from D_DRUG where ID_ =?"; this.getJdbcTemplate().update(sql, new Object[] { data.getId() }); return null; } public String updateDrug(Drug data) { DefaultDept dept = sysDeptService.getDeptById(data.getDeptId()); data.setDeptName(dept.getName()); Session session = this.getSessionFactory().openSession(); data.setUpdateTime(new Date()); data.setUpdateUser(ContextUtil.getLoginUserCName()); try { if (null == data.getId()) { return this.addDrug(data); String id = createId(data.getCompanyId(), data.getDeptId()); data.setId(id); session.save(data); } else { session.saveOrUpdate(data); } String sql = " update D_DRUG set name_=?," + "spec_=?," + "dosage_=?," + "count_=?," + "update_User_=?," + "update_Time_=?," + "remarks_=? where id_=?"; this.getJdbcTemplate().update( sql, new Object[] { data.getName(), data.getSpec(), data.getDosage(), data.getCount(), data.getUpdateUser(), data.getUpdateTime(), data.getRemarks(), data.getId() }); } catch (Exception e) { e.printStackTrace(); } finally { session.flush(); session.close(); } return null; } private String addDrug(Drug data) { data.setId(ContextUtil.getUUID()); data.setCompanyId(ContextUtil.getCompanyId()); String sql = " insert into D_DRUG(id_,company_ID_,name_,spec_,dosage_,count_,update_User_,update_Time_,remarks_) " + " values(?,?,?,?,?,?,?,?,?)"; this.getJdbcTemplate().update( sql, new Object[] { data.getId(), data.getCompanyId(), data.getName(), data.getSpec(), data.getDosage(), data.getCount(), data.getUpdateUser(), data.getUpdateTime(), data.getRemarks() }); /** * 删除药剂信息 * * @param data * @return */ public String delDrug(Drug data) { Session session = this.getSessionFactory().openSession(); try { if (null != data.getId()) { session.delete(data); } } catch (Exception e) { e.printStackTrace(); } finally { session.flush(); session.close(); } return null; } public void pageDrugInout(Page<DrugInout> page, Map<String, Object> param) { List<Object> args = new ArrayList<Object>(); args.add(ContextUtil.getCompanyId()); String sql = "select * from D_DRUG_INOUT where company_id_ =? "; if (null != param) { String str = (String) param.get("name"); if (StringUtils.isNotEmpty(str)) { sql += " and person_ like ?"; args.add("%" + str + "%"); } str = (String) param.get("type"); if (StringUtils.isNotEmpty(str)) { sql += " and type_ = ?"; args.add(str); } } sql += " order by update_time_ desc "; this.pagingQuery(page, sql, args.toArray(), new DrugInoutRowMapper()); } public String delDrugInout(DrugInout data) { if (null == data.getId()) { return null; } String sql = " delete from D_DRUG_INOUT where ID_ =?"; this.getJdbcTemplate().update(sql, new Object[] { data.getId() }); return null; } public String updateDrugInout(DrugInout data) { data.setUpdateTime(new Date()); data.setUpdateUser(ContextUtil.getLoginUserCName()); if (null == data.getId()) { return this.addDrugInout(data); } String sql = " update D_DRUG_INOUT set DRUG_ID_=?," + "TIME_=?," + "PERSON_=?," + "REASON_=?," + "COUNT_=?," + "TYPE_=?," + "UPDATE_USER_=?,UPDATE_TIME_=?,REMARKS_=? where id_=?"; this.getJdbcTemplate() .update(sql, new Object[] { data.getDrugId(), data.getTime(), data.getPerson(), data.getReason(), data.getCount(), data.getType(), data.getUpdateUser(), data.getUpdateTime(), data.getRemarks(), data.getId() }); return null; } private String addDrugInout(DrugInout data) { data.setId(ContextUtil.getUUID()); data.setCompanyId(ContextUtil.getCompanyId()); String sql = "insert into D_DRUG_INOUT(ID_,COMPANY_ID_,DRUG_ID_,TIME_,PERSON_,REASON_,COUNT_,TYPE_,UPDATE_USER_,UPDATE_TIME_,REMARKS_)" + " values(?,?,?,?,?,?,?,?,?,?,?)"; this.getJdbcTemplate().update( sql, new Object[] { data.getId(), data.getCompanyId(), data.getDrugId(), data.getTime(), data.getPerson(), data.getReason(), data.getCount(), data.getType(), data.getUpdateUser(), data.getUpdateTime(), data.getRemarks() }); return null; } public String delDrugLog(DrugLog data) { if (null == data.getId()) { return null; } String sql = " delete from D_DRUG_LOG where ID_ =?"; this.getJdbcTemplate().update(sql, new Object[] { data.getId() }); return null; } public String updateDrugLog(DrugLog data) { data.setUpdateTime(new Date()); data.setUpdateUser(ContextUtil.getLoginUserCName()); if (null == data.getId()) { return this.addDrugLog(data); } String sql = " update D_DRUG_LOG set DEPOT_ID_=?," + "START_=?," + "END_=?," + "USER_=?," + "UPDATE_USER_=?,UPDATE_TIME_=?,REMARKS_=?,DOSE_=? where ID_=?"; this.getJdbcTemplate().update( sql, new Object[] { data.getDepotId(), data.getStart(), data.getEnd(), data.getUser(), data.getUpdateUser(), data.getUpdateTime(), data.getRemarks(), data.getDose(), data.getId() }); return null; } private String addDrugLog(DrugLog data) { data.setId(ContextUtil.getUUID()); data.setCompanyId(ContextUtil.getCompanyId()); String sql = "insert into D_DRUG_LOG(ID_,COMPANY_ID_,DEPOT_ID_,START_,END_,USER_,UPDATE_USER_,UPDATE_TIME_,REMARKS_,DOSE_)" + " values(?,?,?,?,?,?,?,?,?,?)"; this.getJdbcTemplate() .update(sql, new Object[] { data.getId(), data.getCompanyId(), data.getDepotId(), data.getStart(), data.getEnd(), data.getUser(), data.getUpdateUser(), data.getUpdateTime(), data.getRemarks(), data.getDose() }); return null; } public void pageDrugLog(Page<DrugLog> page, Map<String, Object> param) { List<Object> args = new ArrayList<Object>(); args.add(ContextUtil.getCompanyId()); String sql = "select * from D_DRUG_LOG where company_id_ =? "; if (null != param) { String str = (String) param.get("name"); if (StringUtils.isNotEmpty(str)) { sql += " and user_ = ?"; args.add(str); } } sql += " order by start_ desc "; this.pagingQuery(page, sql, args.toArray(), new DrugLogRowMapper()); } public String auditDrugApply(DrugApply data) { @@ -286,84 +169,71 @@ public String updateDrugApply(DrugApply data) { if (null == data.getApplyTime()) { data.setAuditTime(new Date()); } if (null == data.getApplyUser()) { data.setApplyUser(ContextUtil.getLoginUserCName()); } if (null == data.getId()) { return this.addDrugApply(data); } String sql = " update D_DRUG_APPLY set " + "APPLY_TIME_=?," + "APPLY_USER_=?," + "APPLY_REASON_=?," + "DRUG_NAME_=?," + "COUNT_=?," + "AUDIT_TIME_=?," + "AUDIT_USER_=?," + "AUDIT_REASON_=?," + "STATUS_=?," + "REMARKS_=? " + "where ID_=?"; this.getJdbcTemplate().update( sql, new Object[] { data.getApplyTime(), data.getApplyUser(), data.getApplyReason(), data.getDrugName(), data.getCount(), data.getAuditTime(), data.getAuditUser(), data.getAuditReason(), data.getStatus(), data.getRemarks(), data.getId() }); return null; } private String addDrugApply(DrugApply data) { data.setId(ContextUtil.getUUID()); data.setCompanyId(ContextUtil.getCompanyId()); data.setStatus(DrugApply.STATUS_APPLY); String sql = "INSERT INTO D_DRUG_APPLY(ID_,COMPANY_ID_,APPLY_TIME_,APPLY_USER_,APPLY_REASON_,DRUG_NAME_,COUNT_,AUDIT_TIME_,AUDIT_USER_,AUDIT_REASON_," + "STATUS_,REMARKS_) values(?,?,?,?,?,?,?,?,?,?,?,?)"; this.getJdbcTemplate().update( sql, new Object[] { data.getId(), data.getCompanyId(), data.getApplyTime(), data.getApplyUser(), data.getApplyReason(), data.getDrugName(), data.getCount(), data.getAuditTime(), data.getAuditUser(), data.getAuditReason(), data.getStatus(), data.getRemarks() }); return null; } public String delDrugApply(DrugApply data) { if (null == data.getId()) { return null; } String sql = " delete from D_DRUG_APPLY where ID_ =?"; this.getJdbcTemplate().update(sql, new Object[] { data.getId() }); return null; } public void pageDrugApply(Page<DrugApply> page, Map<String, Object> param) { List<Object> args = new ArrayList<Object>(); args.add(ContextUtil.getCompanyId()); } String sql = "select * from D_DRUG_APPLY where company_id_ =? "; public String createId(String companyId, String deptId) { if (null != param) { String str = (String) param.get("name"); // 从缓存中获取已有的组织编码 String cacheKey = RedisConst.buildKey(companyId, HDrugService.CACHE_DRUG_ID); String cacheId = (String) redisUtil.get(cacheKey); if (null != cacheId && cacheId.indexOf(deptId) >= 0) { String temp = cacheId.substring(cacheId.length() - 3); Integer i = Integer.valueOf(temp); cacheId = deptId + String.format("%03d", ++i); } else { List<Drug> result = listDrug(companyId, null); if (null == result || result.size() == 0) { cacheId = deptId + "001"; } else { Drug drug = result.get(0); String temp = drug.getId().substring(drug.getId().length() - 3); Integer i = Integer.valueOf(temp); cacheId = deptId + String.format("%03d", ++i); } } // 更新缓存 redisUtil.set(cacheKey, cacheId); return cacheId; } public void buildHql(StringBuffer hql, Map<String, Object> param, Map<String, Object> args) { String str = (String) param.get("id"); if (StringUtils.isNotEmpty(str)) { sql += " and APPLY_USER_ like ?"; args.add("%" + str + "%"); hql.append(" and id =:id"); args.put("id", str); } str = (String) param.get("name"); if (StringUtils.isNotEmpty(str)) { hql.append(" and name like :name"); args.put("name", "%" + str + "%"); } sql += " order by APPLY_TIME_ desc "; this.pagingQuery(page, sql, args.toArray(), new DrugApplyRowMapper()); Date date = (Date) param.get("start"); if (null != date) { hql.append(" and cgrq >=:start"); args.put("start", date); } date = (Date) param.get("end"); if (null != date) { hql.append(" and cgrq <=:end"); args.put("end", date); } } } igds-recir/src/main/java/com/ld/igds/drug/view/Drug.view.xml
@@ -21,6 +21,7 @@ </Label> <Button layoutConstraint="left"> <ClientEvent name="onClick">view.get("#dsMain").insert({});
 view.get("#id").set("readOnly",false);
 view.get("#dialogMain").show();</ClientEvent> <Property name="caption">新增</Property> <Property name="exClassName">btn-default</Property> @@ -29,6 +30,7 @@ <Button layoutConstraint="left"> <ClientEvent name="onClick">var data = view.get("#dsMain.data:#");
 if(data){
 view.get("#id").set("readOnly",true);
 view.get("#dialogMain").show();
 }</ClientEvent> <Property name="caption">编辑</Property> @@ -61,43 +63,57 @@ </TextEditor> <Trigger id="triggerQuery"> <ClientEvent name="onExecute">var name = view.get("#paramName.text");
 if(null != name && ""!= name){
 view.get("#dsMain").set("parameter",{name:name}).flushAsync();
 }</ClientEvent> view.get("#dsMain").set("parameter",{name:name}).flushAsync();</ClientEvent> <Property name="iconClass">fa fa-search</Property> </Trigger> </Container> <Container layoutConstraint="center"> <Container layout="regionPadding:10" layoutConstraint="center"> <Property name="exClassName">bg-color</Property> <DataGrid> <ClientEvent name="onDataRowDoubleClick">var data = view.get("#dsMain.data:#");
 if(data){
 view.get("#id").set("readOnly",true);
 view.get("#dialogMain").show();
 }</ClientEvent> <Property name="dataSet">dsMain</Property> <Property name="readOnly">true</Property> <Property name="highlightCurrentRow">false</Property> <Property name="highlightCurrentRow">true</Property> <RowNumColumn/> <DataColumn name="id"> <Property name="property">id</Property> <Property name="align">center</Property> </DataColumn> <DataColumn name="name"> <Property name="property">name</Property> <Property name="align">center</Property> </DataColumn> <DataColumn name="count"> <Property name="property">count</Property> <Property name="align">center</Property> </DataColumn> <DataColumn name="dosage"> <Property name="property">dosage</Property> <DataColumn name="kcsldw"> <Property name="property">kcsldw</Property> <Property name="align">center</Property> </DataColumn> <DataColumn name="spec"> <Property name="property">spec</Property> <DataColumn name="sccj"> <Property name="property">sccj</Property> <Property name="align">center</Property> </DataColumn> <DataColumn name="cctj"> <Property name="property">cctj</Property> <Property name="align">center</Property> </DataColumn> <DataColumn name="ccdd"> <Property name="property">ccdd</Property> <Property name="align">center</Property> </DataColumn> <DataColumn name="bzq"> <Property name="property">bzq</Property> <Property name="align">center</Property> </DataColumn> <DataColumn name="updateUser"> <Property name="property">updateUser</Property> </DataColumn> <DataColumn name="updateTime"> <Property name="property">updateTime</Property> </DataColumn> <DataColumn name="remarks"> <Property name="property">remarks</Property> <Property name="align">center</Property> </DataColumn> </DataGrid> </Container> @@ -111,7 +127,8 @@ <Dialog id="dialogMain"> <Property name="closeable">false</Property> <Property name="caption">数据信息</Property> <Property name="width">60%</Property> <Property name="width">85%</Property> <Property name="shadowMode">none</Property> <Buttons> <Button> <ClientEvent name="onClick">var data = view.get("#dsMain.data:#");
 @@ -120,7 +137,6 @@ $notify("数据校验失败!!");
 return;
 }
 
 view.get("#ajaxSave").set("parameter",data).execute(function(result){
 if(result){
 $alert(result);
 @@ -128,6 +144,7 @@ }
 $notify("数据执行完成!!");
 self.get("parent").hide();
 view.get("#dsMain").set("parameter",{}).flushAsync();
 });</ClientEvent> <Property name="caption">确定</Property> <Property name="iconClass">fa fa-check</Property> @@ -140,9 +157,26 @@ </Button> </Buttons> <Children> <Container layout="regionPadding:5"> <FieldSet> <Property name="caption">药剂信息</Property> <Buttons/> <Children> <AutoForm> <Property name="dataSet">dsMain</Property> <Property name="cols">*,*,*</Property> <Property name="labelAlign">right</Property> <Property name="labelSeparator">:</Property> <Property name="labelWidth">120</Property> <AutoFormElement id="id"> <Property name="name">id</Property> <Property name="property">id</Property> <Editor> <TextEditor> <Property name="blankText"> -- 手动填写或系统自动生成 --</Property> </TextEditor> </Editor> </AutoFormElement> <AutoFormElement> <Property name="name">name</Property> <Property name="property">name</Property> @@ -154,20 +188,63 @@ <Editor/> </AutoFormElement> <AutoFormElement> <Property name="name">kcsldw</Property> <Property name="property">kcsldw</Property> <Editor/> </AutoFormElement> <AutoFormElement> <Property name="name">dosage</Property> <Property name="property">dosage</Property> <Property name="trigger">listDosage</Property> <Editor/> </AutoFormElement> <AutoFormElement layoutConstraint="colSpan:2"> <Property name="name">spec</Property> <Property name="property">spec</Property> <AutoFormElement> <Property name="name">deptId</Property> <Property name="property">deptId</Property> <Editor/> </AutoFormElement> <AutoFormElement layoutConstraint="colSpan:3"> <Property name="name">remarks</Property> <Property name="property">remarks</Property> <Property name="editorType">TextArea</Property> <AutoFormElement> <Property name="name">cgrq</Property> <Property name="property">cgrq</Property> <Editor/> </AutoFormElement> <AutoFormElement> <Property name="name">bzw</Property> <Property name="property">bzw</Property> <Editor/> </AutoFormElement> <AutoFormElement> <Property name="name">ggxh</Property> <Property name="property">ggxh</Property> <Editor> <TextEditor> <Property name="blankText">--例如:100mg/粒;10g/片等--</Property> </TextEditor> </Editor> </AutoFormElement> <AutoFormElement> <Property name="name">sccj</Property> <Property name="property">sccj</Property> <Editor/> </AutoFormElement> <AutoFormElement> <Property name="name">cgly</Property> <Property name="property">cgly</Property> <Editor/> </AutoFormElement> <AutoFormElement> <Property name="name">cctj</Property> <Property name="property">cctj</Property> <Editor/> </AutoFormElement> <AutoFormElement> <Property name="name">ccdd</Property> <Property name="property">ccdd</Property> <Editor/> </AutoFormElement> <AutoFormElement> <Property name="name">bzq</Property> <Property name="property">bzq</Property> <Editor/> </AutoFormElement> <AutoFormElement> @@ -182,7 +259,34 @@ <Property name="readOnly">true</Property> <Editor/> </AutoFormElement> <AutoFormElement layoutConstraint="colSpan:3"> <Property name="name">bzwclfs</Property> <Property name="property">bzwclfs</Property> <Property name="editorType">TextEditor</Property> <Editor/> </AutoFormElement> <AutoFormElement layoutConstraint="colSpan:3"> <Property name="name">czclfs</Property> <Property name="property">czclfs</Property> <Property name="editorType">TextEditor</Property> <Editor/> </AutoFormElement> <AutoFormElement layoutConstraint="colSpan:3"> <Property name="name">aqsysms</Property> <Property name="property">aqsysms</Property> <Property name="editorType">TextArea</Property> <Editor/> </AutoFormElement> <AutoFormElement layoutConstraint="colSpan:3"> <Property name="name">remarks</Property> <Property name="property">remarks</Property> <Property name="editorType">TextArea</Property> <Editor/> </AutoFormElement> </AutoForm> </Children> </FieldSet> </Container> </Children> <Tools/> </Dialog> @@ -191,7 +295,7 @@ <Property name="autoOpen">true</Property> </ListDropDown> <AjaxAction id="ajaxSave"> <Property name="service">drugPR#updateDrug</Property> <Property name="service">drugPR#saveDrug</Property> </AjaxAction> <AjaxAction id="ajaxDel"> <Property name="service">drugPR#delDrug</Property> igds-recir/src/main/java/com/ld/igds/drug/view/DrugPR.java
@@ -1,8 +1,11 @@ package com.ld.igds.drug.view; import java.util.ArrayList; import java.util.List; import java.util.Map; import com.ld.igds.inout.InoutConstant; import com.ld.igds.models.DicTrigger; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Component; @@ -19,7 +22,6 @@ * @description: * @version: * @data:2020年3月6日 * */ @Component("drugPR") public class DrugPR { @@ -27,28 +29,70 @@ @Autowired private HDrugService drugService; // ${dorado.getDataProvider("drugPR#triggerPackage").getResult()} @DataProvider public List<DicTrigger> triggerPackage() { List<DicTrigger> list = new ArrayList<DicTrigger>(); list.add(new DicTrigger("1", "瓶装")); list.add(new DicTrigger("2", "袋装")); list.add(new DicTrigger("3", "其他")); return list; } // ${dorado.getDataProvider("drugPR#triggerLocation").getResult()} @DataProvider public List<DicTrigger> triggerLocation() { List<DicTrigger> list = new ArrayList<DicTrigger>(); list.add(new DicTrigger("1", "药剂库")); list.add(new DicTrigger("2", "其他")); return list; } // ${dorado.getDataProvider("drugPR#triggerUnit").getResult()} @DataProvider public List<DicTrigger> triggerUnit() { List<DicTrigger> list = new ArrayList<DicTrigger>(); list.add(new DicTrigger("1", "公斤")); list.add(new DicTrigger("2", "克")); list.add(new DicTrigger("3", "毫克")); return list; } /** * ${dorado.getDataProvider("drugPR#listDrug").getResult()} * * @param page * @param param * @throws Exception */ // @DataProvider // public List<Drug> listDrug(String name) throws Exception { // return drugService.listDrug(name); // } /** * ${dorado.getDataProvider("drugPR#pageDrug").getResult()} * * @throws Exception */ @DataProvider public List<Drug> listDrug(String name) throws Exception { return drugService.listDrug(name); public void pageDrug(Page<Drug> page, Map<String, Object> param) throws Exception { drugService.pageDrug(page, param); } @DataProvider public void pageDrug(Page<Drug> page, Map<String, Object> param) throws Exception { drugService.pageDrug(page, param); /** * ${dorado.getDataProvider("drugPR#saveDrug").getResult()} * * @throws Exception */ @Expose public void saveDrug(Drug drug) throws Exception { drugService.saveDrug(drug); } /** * drugPR#delDrug * * @param param * @param * @throws Exception */ @Expose @@ -56,15 +100,5 @@ return drugService.delDrug(data); } /** * drugPR#updateDrug 新增或者修改 * * @param param * @throws Exception */ @Expose public String updateDrug(Drug data) throws Exception { return drugService.updateDrug(data); } } igds-recir/src/main/java/com/ld/igds/models/Drug.java
@@ -1,5 +1,6 @@ package com.ld.igds.models; import java.io.Serializable; import java.util.Date; import javax.persistence.Column; @@ -7,6 +8,7 @@ import javax.persistence.Id; import javax.persistence.Table; import com.fasterxml.jackson.annotation.JsonFormat; import lombok.Data; import com.bstek.dorado.annotation.PropertyDef; @@ -15,18 +17,36 @@ * 环流熏蒸-药品库存 * * @ClassName: Drug * @date 2018年3月9日 下午2:54:37 * @version 1.0 * @date 2023年7月26日 */ @Data @Entity @Table(name = "D_DRUG") public class Drug { public class Drug implements Serializable { @Id @Column(name = "ID_", length = 40) @PropertyDef(label = "编码") @PropertyDef(label = "药剂编号", description = "库区代码+三位顺序号") private String id; @Id @Column(name = "DEPT_ID_", length = 50) @PropertyDef(label = "库区代码") private String deptId; @Id @Column(name = "cgrq") @PropertyDef(label = "采购日期") @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd", timezone = "GMT+8") private Date cgrq; @Column(name = "DEPT_NAME_", length = 256) @PropertyDef(label = "库区名称") private String deptName; @Column(name = "dwdm", length = 18) @PropertyDef(label = "单位代码") private String dwdm; @Column(name = "COMPANY_ID_", length = 10) @PropertyDef(label = "组织编码") @@ -36,9 +56,51 @@ @PropertyDef(label = "药品名称") private String name; @Column(name = "SPEC_", length = 50) @PropertyDef(label = "规格说明") private String spec; @Column(name = "bzw", length = 1) @PropertyDef(label = "包装物", description = "1:瓶装,2:袋装,3:其他") private String bzw; @Column(name = "ggxh", length = 256) @PropertyDef(label = "型号规格", description = "如:100mg/粒或10g/片") private String ggxh; @Column(name = "aqsysms", length = 1000) @PropertyDef(label = "安全使用说明书") private String aqsysms; @Column(name = "sccj", length = 40) @PropertyDef(label = "生产厂家") private String sccj; @Column(name = "cgly", length = 40) @PropertyDef(label = "采购来源") private String cgly; @Column(name = "cctj", length = 200) @PropertyDef(label = "存储条件") private String cctj; @Column(name = "ccdd", length = 1) @PropertyDef(label = "储存地点", description = "1:药剂库,2:其他") private String ccdd; @Column(name = "bzwclfs", length = 1000) @PropertyDef(label = "包装物处理方式") private String bzwclfs; @Column(name = "czclfs", length = 1000) @PropertyDef(label = "残渣处理方式") private String czclfs; @Column(name = "bzq", length = 20) @PropertyDef(label = "保质期") @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd", timezone = "GMT+8") private Date bzq; // @Column(name = "SPEC_", length = 50) // @PropertyDef(label = "规格说明") // private String spec; @Column(name = "DOSAGE_", length = 20) @PropertyDef(label = "剂型") @@ -48,15 +110,20 @@ @PropertyDef(label = "库存量") private int count = 0; @Column(name = "kcsldw", length = 1) @PropertyDef(label = "库存量单位", description = "1(默认):公斤;2:克;3:毫升;") private String kcsldw; @PropertyDef(label = "操作员") @Column(name = "UPDATE_USER_", length = 30) private String updateUser; @PropertyDef(label = "操作时间") @PropertyDef(label = "更新时间") @Column(name = "UPDATE_TIME_") private Date updateTime; @PropertyDef(label = "操作时间") @PropertyDef(label = "备注") @Column(name = "REMARKS_", length = 300) private String remarks; igds-recir/src/main/java/com/ld/igds/models/DrugApply.java
@@ -1,5 +1,6 @@ package com.ld.igds.models; import java.io.Serializable; import java.util.Date; import javax.persistence.Column; @@ -12,16 +13,16 @@ import com.bstek.dorado.annotation.PropertyDef; /** * 环流熏蒸-药品出入库 * 环流熏蒸-药品申请 * * @ClassName: DrugInOut * @date 2018年3月9日 下午3:46:24 * @version 1.0 * @ClassName: DrugApply * @date 2018年3月9日 下午3:46:24 */ @Data @Entity @Table(name = "D_DRUG_APPLY") public class DrugApply { public class DrugApply implements Serializable { public static final String STATUS_APPLY = "APPLY"; igds-recir/src/main/java/com/ld/igds/models/DrugLog.java
@@ -1,5 +1,6 @@ package com.ld.igds.models; import java.io.Serializable; import java.util.Date; import javax.persistence.Column; @@ -7,6 +8,7 @@ import javax.persistence.Id; import javax.persistence.Table; import com.fasterxml.jackson.annotation.JsonFormat; import lombok.Data; import com.bstek.dorado.annotation.PropertyDef; @@ -14,17 +16,16 @@ /** * 环流熏蒸-熏蒸作业记录 * * @date 2018年3月9日 下午3:46:24 * @version 1.0 * @date 2023年7月26日 */ @Data @Entity @Table(name = "D_DRUG_LOG") public class DrugLog { public class DrugLog implements Serializable { @Id @Column(name = "ID_", length = 40) @PropertyDef(label = "id") @PropertyDef(label = "熏蒸作业单号", description = "仓房代码+作业日期 (yyyyMMdd) +3 位顺序号") private String id; @Column(name = "COMPANY_ID_", length = 10) @@ -38,7 +39,6 @@ @Column(name = "DEPOT_ID_", length = 50) @PropertyDef(label = "仓库") private String depotId; @Column(name = "START_") @PropertyDef(label = "开始时间") @@ -57,63 +57,241 @@ private Integer num = 0; @Column(name = "MODE_", length = 50) @PropertyDef(label = "熏蒸方式") @Column(name = "MODE_", length = 1) @PropertyDef(label = "熏蒸方式", description = "0:粮面潮解1:布袋埋藏2:探管3:综合施药") private String mode; @Column(name = "RECIR_MODE_", length = 50) @PropertyDef(label = "环流熏蒸方式") @Column(name = "RECIR_MODE_", length = 1) @PropertyDef(label = "环流熏蒸方式", description = "0:固定式布置形式1:移动式布置形式") private String recirMode; @Column(name = "DRUG_NAME_", length = 50) @Column(name = "hlxzynhljsjh", length = 1) @PropertyDef(label = "环流熏蒸与内环流技术结合", description = "0:分别使用_固定式1:分别使用_移动式2:二合一应用_单向控制3:二合一应用_双向控制") private String hlxzynhljsjh; @PropertyDef(label = "熏蒸方案制定") @Column(name = "xzfazd", length = 128) private String xzfazd; @PropertyDef(label = "熏蒸方案起草人") @Column(name = "xzfaqcr", length = 64) private String xzfaqcr; @PropertyDef(label = "熏蒸方案批准人") @Column(name = "xzfapzr", length = 64) private String xzfapzr; @PropertyDef(label = "熏蒸方案报备情况") @Column(name = "xzfabbqk", length = 64) private String xzfabbqk; @PropertyDef(label = "施药人员资质情况") @Column(name = "syryzzqk", length = 64) private String syryzzqk; @PropertyDef(label = "施药资质审核") @Column(name = "syzzsh", length = 64) private String syzzsh; @Column(name = "DRUG_NAME_", length = 64) @PropertyDef(label = "药剂名称") private String drugName; @PropertyDef(label = "剂型") @Column(name = "jx", length = 64) private String jx; @Column(name = "CONCENTRATION_", length = 50) @PropertyDef(label = "药剂浓度",description = "%") private Double concentration = 0.0; @Column(name = "GRAIN_DOSE_") @PropertyDef(label = "粮堆使用剂量",description = "g/m³") @PropertyDef(label = "粮堆单位用药量", description = "g/m³") private Double grainDose = 0.0; @Column(name = "SPACE_DOSE_") @PropertyDef(label = "空间使用剂量",description = "g/m³") @PropertyDef(label = "空间单位用药量", description = "g/m³") private Double SpaceDose =0.0; @Column(name = "DOSE_") @PropertyDef(label = "总使用剂量",description = "g/m³") @PropertyDef(label = "总用药量", description = "kg") private Double dose = 0.0; @PropertyDef(label = "施药方法", description = "0:潮解法1:仓外发生器2:钢瓶气") @Column(name = "syff", length = 1) private String syff; @PropertyDef(label = "辅助施药措施") @Column(name = "fzsycs", length = 128) private String fzsycs; @PropertyDef(label = "空气呼吸器及安全检查情况") @Column(name = "kqhqjaqjcqk", length = 128) private String kqhqjaqjcqk; @PropertyDef(label = "磷化氢检测装置调试情况") @Column(name = "lhqjczztsqk", length = 128) private String lhqjczztsqk; @PropertyDef(label = "氧气深度检测装置调试情况") @Column(name = "yqsdjczztsqk", length = 128) private String yqsdjczztsqk; @PropertyDef(label = "磷化氢报警仪安全检查") @Column(name = "lhqbjyaqjc", length = 128) private String lhqbjyaqjc; @PropertyDef(label = "氧气报警仪安全检查") @Column(name = "yqbjyaqjc", length = 128) private String yqbjyaqjc; @PropertyDef(label = "补药前仓内磷化氢浓度") @Column(name = "byqcnlhqnd", precision = 20, scale = 3) private double byqcnlhqnd; @PropertyDef(label = "磷化氢浓度单位", description = "1:g/m³(默认);2:ppm;3:ml/m³;4:%VOL") @Column(name = "nlhqnddw", length = 1) private String nlhqnddw; @PropertyDef(label = "目标浓度", description = "单位:g/m³") @Column(name = "mbnd", precision = 20, scale = 3) private double mbnd; @PropertyDef(label = "计算补药量", description = "单位:g") @Column(name = "jsbyl", precision = 20, scale = 3) private double jsbyl; @PropertyDef(label = "实际补药量", description = "单位:g") @Column(name = "sjbyl", precision = 20, scale = 3) private double sjbyl; @PropertyDef(label = "补药方法") @Column(name = "byff", length = 128) private String byff; @PropertyDef(label = "作业人数") @Column(name = "zyrs") private Integer zyrs; @PropertyDef(label = "补药作业批准人") @Column(name = "byzypzr", length = 64) private String byzypzr; @PropertyDef(label = "现场指挥人") @Column(name = "xczhr", length = 64) private String xczhr; @PropertyDef(label = "峰值浓度", description = "单位:g/m³") @Column(name = "fznd", precision = 20, scale = 3) private double fznd; @PropertyDef(label = "目标浓度维持天数", description = "单位:天") @Column(name = "mbndwcts") private Integer mbndwcts; @PropertyDef(label = "漏气位置监测") @Column(name = "lswzjc", length = 128) private String lswzjc; @PropertyDef(label = "漏气部位采取的补救措施") @Column(name = "lqbwcqdbjcs", length = 128) private String lqbwcqdbjcs; @PropertyDef(label = "密闭时间", description = "单位:天") @Column(name = "mbsj") private Integer mbsj; @PropertyDef(label = "CT值") @Column(name = "ctz", precision = 20, scale = 3) private double ctz; @PropertyDef(label = "散气前磷化氢浓度", description = "单位:g/m³") @Column(name = "sqqlhqnd", precision = 20, scale = 3) private double sqqlhqnd; @Column(name = "VENTILATE_TIME_") @PropertyDef(label = "散气时间") @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd", timezone = "GMT+8") private Date ventilateTime; @Column(name = "VENTILATE_METHOD_",length = 100) @PropertyDef(label = "散气方法") private String ventilateMethod; @PropertyDef(label = "散气批准人") @Column(name = "sqpzr", length = 64) private String sqpzr; @PropertyDef(label = "散气持续天数", description = "单位:天") @Column(name = "sqcsts") private Integer sqcsts; @Column(name = "AFTER_PH3_") @PropertyDef(label = "散气后磷化氢浓度") @PropertyDef(label = "散气后磷化氢浓度", description = "单位:g/m³") private Double afterPh3; @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd", timezone = "GMT+8") @PropertyDef(label = "残渣收集作业时间") @Column(name = "czsjzysj") private Date czsjzysj; @PropertyDef(label = "残渣收集作业人数") @Column(name = "czsjzyrs") private Integer czsjzyrs; @PropertyDef(label = "残渣收集方法") @Column(name = "czsjff", length = 128) private String czsjff; @PropertyDef(label = "残渣收集作业批准人") @Column(name = "czsjzypzr", length = 64) private String czsjzypzr; @PropertyDef(label = "残渣处理措施") @Column(name = "czclcs", length = 128) private String czclcs; @PropertyDef(label = "残渣处理作业人数") @Column(name = "czclzyrs") private Integer czclzyrs; @PropertyDef(label = "残渣处理批准人") @Column(name = "czclpzr", length = 64) private String czclpzr; @PropertyDef(label = "熏蒸后活虫检出情况") @Column(name = "xzhhcjcqk", length = 128) private String xzhhcjcqk; @PropertyDef(label = "熏蒸后虫口密度", description = "单位:头/kg") @Column(name = "xzhckmd") private Integer xzhckmd; @PropertyDef(label = "培养15天后活虫数", description = "单位:头/kg") @Column(name = "pyswthhcs") private Integer pyswthhcs; @PropertyDef(label = "培养45天后活虫数", description = "单位:头/kg") @Column(name = "pysswthhcs") private Integer pysswthhcs; /** * 0:良好 * 1:一般 * 2:不好 */ @Column(name = "EVALUATE_",length = 10) @PropertyDef(label = "熏蒸评价") @Column(name = "EVALUATE_", length = 1) @PropertyDef(label = "熏蒸评价", description = "0:良好 1:一般 2:不好") private String evaluate; @Column(name = "CZSJFF_",length = 100) @PropertyDef(label = "残渣收集方法") private String czsjff; @PropertyDef(label = "熏蒸负责人") @Column(name = "xzfzr", length = 64) private String xzfzr; @Column(name = "CZCLCS_",length = 100) @PropertyDef(label = "残渣处理措施") private String czclcs; @PropertyDef(label = "熏蒸作业人员") @Column(name = "xzzyry", length = 128) private String xzzyry; @Column(name = "USER_", length = 30) @PropertyDef(label = "操作人") @@ -123,7 +301,7 @@ @Column(name = "UPDATE_USER_", length = 30) private String updateUser; @PropertyDef(label = "操作时间") @PropertyDef(label = "更新时间") @Column(name = "UPDATE_TIME_") private Date updateTime; igds-recir/src/main/java/models/recir.model.xml
@@ -4,7 +4,7 @@ <Property name="creationType">com.ld.igds.models.Drug</Property> <PropertyDef name="id"> <Property></Property> <Property name="label">编码</Property> <Property name="label">编码药剂编号</Property> </PropertyDef> <PropertyDef name="companyId"> <Property></Property> @@ -27,19 +27,108 @@ <PropertyDef name="count"> <Property name="dataType">int</Property> <Property name="label">库存量</Property> <Property name="required">true</Property> </PropertyDef> <PropertyDef name="updateUser"> <Property></Property> <Property name="label">操作员</Property> </PropertyDef> <PropertyDef name="updateTime"> <Property name="dataType">Date</Property> <Property name="dataType">DateTime</Property> <Property name="label">操作时间</Property> </PropertyDef> <PropertyDef name="remarks"> <Property></Property> <Property name="label">备注信息</Property> </PropertyDef> <PropertyDef name="deptId"> <Property/> <Property name="label">所属库区</Property> <Property name="mapping"> <Property name="mapValues">${dorado.getDataProvider("deptPR#loadParents").getResult()}</Property> <Property name="keyProperty">id</Property> <Property name="valueProperty">name</Property> </Property> <Property name="required">true</Property> </PropertyDef> <PropertyDef name="deptName"> <Property/> <Property name="label">库区名称</Property> </PropertyDef> <PropertyDef name="dwdm"> <Property/> <Property name="label">单位代码</Property> </PropertyDef> <PropertyDef name="cgrq"> <Property name="dataType">Date</Property> <Property name="label">采购日期</Property> <Property name="required">true</Property> </PropertyDef> <PropertyDef name="bzw"> <Property/> <Property name="label">包装物</Property> <Property name="mapping"> <Property name="mapValues">${dorado.getDataProvider("drugPR#triggerPackage").getResult()}</Property> <Property name="keyProperty">code</Property> <Property name="valueProperty">name</Property> </Property> <Property name="required">true</Property> </PropertyDef> <PropertyDef name="ggxh"> <Property/> <Property name="label">型号规格</Property> <Property name="required">true</Property> </PropertyDef> <PropertyDef name="aqsysms"> <Property/> <Property name="label">安全使用说明书</Property> </PropertyDef> <PropertyDef name="sccj"> <Property/> <Property name="label">生产厂家</Property> <Property name="required">true</Property> </PropertyDef> <PropertyDef name="cgly"> <Property/> <Property name="label">采购来源</Property> </PropertyDef> <PropertyDef name="cctj"> <Property/> <Property name="label">存储条件</Property> </PropertyDef> <PropertyDef name="ccdd"> <Property/> <Property name="label">储存地点</Property> <Property name="mapping"> <Property name="mapValues">${dorado.getDataProvider("drugPR#triggerLocation").getResult()}</Property> <Property name="keyProperty">code</Property> <Property name="valueProperty">name</Property> </Property> <Property name="required">true</Property> </PropertyDef> <PropertyDef name="bzwclfs"> <Property/> <Property name="label">包装物处理方式</Property> </PropertyDef> <PropertyDef name="czclfs"> <Property/> <Property name="label">残渣处理方式</Property> </PropertyDef> <PropertyDef name="bzq"> <Property/> <Property name="label">保质期</Property> <Property name="required">true</Property> <Property name="dataType">Date</Property> </PropertyDef> <PropertyDef name="kcsldw"> <Property/> <Property name="label">库存量单位</Property> <Property name="mapping"> <Property name="mapValues">${dorado.getDataProvider("drugPR#triggerUnit").getResult()}</Property> <Property name="keyProperty">code</Property> <Property name="valueProperty">name</Property> </Property> </PropertyDef> </DataType> <DataType name="dtTempIntelTask"> <Property name="creationType">com.ld.igds.models.TempIntelTask</Property>