Commit ff36183a by sunxin

需求变更

parent 5dfe46da
...@@ -21,6 +21,14 @@ public interface CrudDao<T> extends BaseDao { ...@@ -21,6 +21,14 @@ public interface CrudDao<T> extends BaseDao {
* @return * @return
*/ */
public T get(String id); public T get(String id);
/**
* 跟据类型编码查询列表 是否有相同编码
* @param entity
* @return
*/
public List<T> getByNumber(T entity);
/** /**
* 获取单条数据 * 获取单条数据
......
...@@ -84,6 +84,10 @@ public abstract class CrudService<D extends CrudDao<T>, T extends DataEntity<T>> ...@@ -84,6 +84,10 @@ public abstract class CrudService<D extends CrudDao<T>, T extends DataEntity<T>>
if (entity.getIsNewRecord()){ if (entity.getIsNewRecord()){
entity.preInsert(); entity.preInsert();
List<T> byNumber = dao.getByNumber(entity);
if(byNumber.size() != 0){
throw new RuntimeException("保存失败,编码重复!!!!!!");
}
dao.insert(entity); dao.insert(entity);
}else{ }else{
entity.preUpdate(); entity.preUpdate();
......
...@@ -23,4 +23,5 @@ public interface CtBbtcBusCategoryDao extends CrudDao<CtBbtcBusCategory> { ...@@ -23,4 +23,5 @@ public interface CtBbtcBusCategoryDao extends CrudDao<CtBbtcBusCategory> {
* @return * @return
*/ */
List<CtBbtcBusCategory> getByTypeId(@Param("typeId") String typeId); List<CtBbtcBusCategory> getByTypeId(@Param("typeId") String typeId);
} }
\ No newline at end of file
...@@ -24,4 +24,5 @@ public interface CtBbtcBusTypeDao extends CrudDao<CtBbtcBusType> { ...@@ -24,4 +24,5 @@ public interface CtBbtcBusTypeDao extends CrudDao<CtBbtcBusType> {
* @return * @return
*/ */
List<CtBbtcBusType> getByGroupId(@Param("groupId")String groupId); List<CtBbtcBusType> getByGroupId(@Param("groupId")String groupId);
} }
\ No newline at end of file
...@@ -25,4 +25,5 @@ public interface CtBbtcRegionDao extends CrudDao<CtBbtcRegion> { ...@@ -25,4 +25,5 @@ public interface CtBbtcRegionDao extends CrudDao<CtBbtcRegion> {
*/ */
List<CtBbtcRegion> getByGroupId(@Param("groupId")String groupId); List<CtBbtcRegion> getByGroupId(@Param("groupId")String groupId);
} }
\ No newline at end of file
...@@ -5,6 +5,7 @@ package com.ejweb.modules.report.service; ...@@ -5,6 +5,7 @@ package com.ejweb.modules.report.service;
import java.util.List; import java.util.List;
import com.ejweb.modules.report.entity.CtBbtcRegion;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
...@@ -39,7 +40,12 @@ public class CtBbtcBusCategoryService extends CrudService<CtBbtcBusCategoryDao, ...@@ -39,7 +40,12 @@ public class CtBbtcBusCategoryService extends CrudService<CtBbtcBusCategoryDao,
@Transactional(readOnly = false) @Transactional(readOnly = false)
public void save(CtBbtcBusCategory ctBbtcBusCategory) { public void save(CtBbtcBusCategory ctBbtcBusCategory) {
super.save(ctBbtcBusCategory); try{
super.save(ctBbtcBusCategory);
}catch (RuntimeException e){
throw new RuntimeException(e.getMessage());
}
} }
@Transactional(readOnly = false) @Transactional(readOnly = false)
......
...@@ -49,7 +49,11 @@ public class CtBbtcBusTypeService extends CrudService<CtBbtcBusTypeDao, CtBbtcBu ...@@ -49,7 +49,11 @@ public class CtBbtcBusTypeService extends CrudService<CtBbtcBusTypeDao, CtBbtcBu
@Transactional(readOnly = false) @Transactional(readOnly = false)
public void save(CtBbtcBusType ctBbtcBusType) { public void save(CtBbtcBusType ctBbtcBusType) {
super.save(ctBbtcBusType); try{
super.save(ctBbtcBusType);
}catch (RuntimeException e){
throw new RuntimeException(e.getMessage());
}
/*将可用范围存到 typearea表中*/ /*将可用范围存到 typearea表中*/
String[] groups = ctBbtcBusType.getGroup().split(","); String[] groups = ctBbtcBusType.getGroup().split(",");
......
...@@ -41,15 +41,20 @@ public class CtBbtcRegionService extends CrudService<CtBbtcRegionDao, CtBbtcRegi ...@@ -41,15 +41,20 @@ public class CtBbtcRegionService extends CrudService<CtBbtcRegionDao, CtBbtcRegi
return this.ctBbtcRegionDao.getByGroupId(groupId); return this.ctBbtcRegionDao.getByGroupId(groupId);
} }
@Transactional(readOnly = false) @Transactional(readOnly = false)
public void save(CtBbtcRegion ctBbtcRegion) { public void save(CtBbtcRegion ctBbtcRegion) {
super.save(ctBbtcRegion); try{
super.save(ctBbtcRegion);
}catch (RuntimeException e){
throw new RuntimeException(e.getMessage());
}
} }
@Transactional(readOnly = false) @Transactional(readOnly = false)
public void delete(CtBbtcRegion ctBbtcRegion) { public void delete(CtBbtcRegion ctBbtcRegion) {
super.delete(ctBbtcRegion); super.delete(ctBbtcRegion);
} }
} }
\ No newline at end of file
...@@ -144,8 +144,12 @@ public class CtBbtcBusCategoryController extends BaseController { ...@@ -144,8 +144,12 @@ public class CtBbtcBusCategoryController extends BaseController {
if (!beanValidator(model, ctBbtcBusCategory)){ if (!beanValidator(model, ctBbtcBusCategory)){
return form(ctBbtcBusCategory, model); return form(ctBbtcBusCategory, model);
} }
ctBbtcBusCategoryService.save(ctBbtcBusCategory); try{
addMessage(redirectAttributes, "保存业务类别成功"); ctBbtcBusCategoryService.save(ctBbtcBusCategory);
addMessage(redirectAttributes, "保存业务类别成功");
}catch (RuntimeException e){
addMessage(redirectAttributes, e.getMessage());
}
return "redirect:"+adminPath+"/report/ctBbtcBusCategory/?repage"; return "redirect:"+adminPath+"/report/ctBbtcBusCategory/?repage";
} }
......
...@@ -92,8 +92,12 @@ public class CtBbtcBusTypeController extends BaseController { ...@@ -92,8 +92,12 @@ public class CtBbtcBusTypeController extends BaseController {
if (!beanValidator(model, ctBbtcBusType)){ if (!beanValidator(model, ctBbtcBusType)){
return form(ctBbtcBusType, model); return form(ctBbtcBusType, model);
} }
ctBbtcBusTypeService.save(ctBbtcBusType); try{
addMessage(redirectAttributes, "保存业务类型成功"); ctBbtcBusTypeService.save(ctBbtcBusType);
addMessage(redirectAttributes, "保存业务类型成功");
}catch (RuntimeException e){
addMessage(redirectAttributes, e.getMessage());
}
return "redirect:"+adminPath+"/report/ctBbtcBusType/?repage"; return "redirect:"+adminPath+"/report/ctBbtcBusType/?repage";
} }
...@@ -135,7 +139,7 @@ public class CtBbtcBusTypeController extends BaseController { ...@@ -135,7 +139,7 @@ public class CtBbtcBusTypeController extends BaseController {
@RequestMapping(value = "getTypeList") @RequestMapping(value = "getTypeList")
public void getRegionList(String groupId, RedirectAttributes redirectAttributes,HttpServletResponse response,String area) { public void getRegionList(String groupId, RedirectAttributes redirectAttributes,HttpServletResponse response,String area) {
if (groupId != null && !"".equals(groupId) && area != null && !"".equals(area)) { if (groupId != null && !"".equals(groupId)) {
JSONObject res = new JSONObject(); JSONObject res = new JSONObject();
List<CtBbtcTypeArea> ctBbtcTypeList = ctBbtcBusTypeService.getByArea(groupId, area); List<CtBbtcTypeArea> ctBbtcTypeList = ctBbtcBusTypeService.getByArea(groupId, area);
res.put("ctBbtcTypeList", ctBbtcTypeList); res.put("ctBbtcTypeList", ctBbtcTypeList);
......
...@@ -28,6 +28,7 @@ import org.springframework.web.servlet.mvc.support.RedirectAttributes; ...@@ -28,6 +28,7 @@ import org.springframework.web.servlet.mvc.support.RedirectAttributes;
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
import java.io.PrintWriter; import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.List; import java.util.List;
/** /**
...@@ -84,8 +85,12 @@ public class CtBbtcRegionController extends BaseController { ...@@ -84,8 +85,12 @@ public class CtBbtcRegionController extends BaseController {
if (!beanValidator(model, ctBbtcRegion)){ if (!beanValidator(model, ctBbtcRegion)){
return form(ctBbtcRegion, model); return form(ctBbtcRegion, model);
} }
ctBbtcRegionService.save(ctBbtcRegion); try{
addMessage(redirectAttributes, "保存区域基础资料成功"); ctBbtcRegionService.save(ctBbtcRegion);
addMessage(redirectAttributes, "保存区域基础资料成功");
}catch (RuntimeException e){
addMessage(redirectAttributes, e.getMessage());
}
return "redirect:"+adminPath+"/report/ctBbtcRegion/?repage"; return "redirect:"+adminPath+"/report/ctBbtcRegion/?repage";
} }
......
...@@ -1012,7 +1012,7 @@ public class ReportController extends BaseController { ...@@ -1012,7 +1012,7 @@ public class ReportController extends BaseController {
if (ctBbtcBusType != null) { if (ctBbtcBusType != null) {
SupplementTypeStr = SupplementTypeStr + ctBbtcBusType.getName() + ","; SupplementTypeStr = SupplementTypeStr + ctBbtcBusType.getName() + ",";
} else { } else {
/* SupplementTypeStr = SupplementTypeStr + "--";*/ SupplementTypeStr = SupplementTypeStr + "-";
} }
} }
...@@ -1027,7 +1027,7 @@ public class ReportController extends BaseController { ...@@ -1027,7 +1027,7 @@ public class ReportController extends BaseController {
if (ctBbtcBusCategory != null) { if (ctBbtcBusCategory != null) {
SupplementCategoryStr = SupplementCategoryStr + ctBbtcBusCategory.getName() + ","; SupplementCategoryStr = SupplementCategoryStr + ctBbtcBusCategory.getName() + ",";
} else { } else {
/* SupplementCategoryStr = SupplementCategoryStr + "--";*/ SupplementCategoryStr = SupplementCategoryStr + "-";
} }
} }
reportEntity1.setSupplementCategory(SupplementCategoryStr.substring(0,SupplementCategoryStr.length()-1)); reportEntity1.setSupplementCategory(SupplementCategoryStr.substring(0,SupplementCategoryStr.length()-1));
......
...@@ -26,6 +26,14 @@ ...@@ -26,6 +26,14 @@
WHERE a.id = #{id} WHERE a.id = #{id}
</select> </select>
<select id="getByNumber" resultType="CtBbtcBusCategory">
SELECT
<include refid="ctBbtcBusCategoryColumns"/>
FROM ct_bbtc_bus_category a
<include refid="ctBbtcBusCategoryJoins"/>
WHERE a.fnumber = #{number}
</select>
<select id="getByTypeId" resultType="CtBbtcBusCategory"> <select id="getByTypeId" resultType="CtBbtcBusCategory">
SELECT SELECT
<include refid="ctBbtcBusCategoryColumns"/> <include refid="ctBbtcBusCategoryColumns"/>
......
...@@ -18,7 +18,14 @@ ...@@ -18,7 +18,14 @@
FROM ct_bbtc_bus_type FROM ct_bbtc_bus_type
WHERE id = #{id} WHERE id = #{id}
</select> </select>
<select id="getByNumber" resultType="CtBbtcBusType">
SELECT
<include refid="ctBbtcBusTypeColumns"/>
FROM ct_bbtc_bus_type
WHERE fnumber = #{number}
</select>
<select id="findList" resultType="CtBbtcBusType"> <select id="findList" resultType="CtBbtcBusType">
SELECT SELECT
<include refid="ctBbtcBusTypeColumns"/> <include refid="ctBbtcBusTypeColumns"/>
......
...@@ -22,6 +22,14 @@ ...@@ -22,6 +22,14 @@
WHERE a.id = #{id} WHERE a.id = #{id}
</select> </select>
<select id="getByNumber" resultType="CtBbtcRegion">
SELECT
<include refid="ctBbtcRegionColumns"/>
FROM ct_bbtc_region a
<include refid="ctBbtcRegionJoins"/>
WHERE a.fnumber = #{number}
</select>
<select id="getByGroupId" resultType="CtBbtcRegion"> <select id="getByGroupId" resultType="CtBbtcRegion">
SELECT SELECT
<include refid="ctBbtcRegionColumns"/> <include refid="ctBbtcRegionColumns"/>
......
...@@ -37,8 +37,13 @@ ...@@ -37,8 +37,13 @@
<include refid="ctBbtcTypeAreaColumns"/> <include refid="ctBbtcTypeAreaColumns"/>
FROM CT_BBTC_TYPE_AREA a FROM CT_BBTC_TYPE_AREA a
<include refid="ctBbtcTypeAreaJoins"/> <include refid="ctBbtcTypeAreaJoins"/>
WHERE a.area = #{area} AND a.group_name=#{group} <where>
a.group_name=#{group}
<if test="area != null and area != ''">
AND a.area = #{area}
</if>
</where>
GROUP BY a.parent_id
</select> </select>
<select id="findList" resultType="com.ejweb.modules.report.entity.CtBbtcTypeArea"> <select id="findList" resultType="com.ejweb.modules.report.entity.CtBbtcTypeArea">
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
<meta name="decorator" content="default"/> <meta name="decorator" content="default"/>
<script type="text/javascript"> <script type="text/javascript">
$(document).ready(function() { $(document).ready(function() {
getRegion(); /*getRegion();*/
getType(); getType();
}); });
function page(n,s){ function page(n,s){
...@@ -60,11 +60,11 @@ ...@@ -60,11 +60,11 @@
selectNode.append("<option value=''>请选择</option>"); selectNode.append("<option value=''>请选择</option>");
var ts_describe1= $("#supplementGroup").val(); var ts_describe1= $("#supplementGroup").val();
var ts_describe2= $("#supplementArea").val(); /*var ts_describe2= $("#supplementArea").val();*/
if(ts_describe1 != null && ts_describe1 != '' && ts_describe2 != null && ts_describe2 != '' ){ if(ts_describe1 != null && ts_describe1 != ''){
$.ajax({ $.ajax({
type: "POST", type: "POST",
url: "${ctx}/report/ctBbtcBusType/getTypeList?groupId="+ts_describe1+"&area="+ts_describe2, url: "${ctx}/report/ctBbtcBusType/getTypeList?groupId="+ts_describe1,
dataType: "json", dataType: "json",
success: function(returnedData) { success: function(returnedData) {
var data2 = returnedData.ctBbtcTypeList; var data2 = returnedData.ctBbtcTypeList;
...@@ -105,23 +105,23 @@ ...@@ -105,23 +105,23 @@
<input id="pageSize" name="pageSize" type="hidden" value="${page.pageSize}"/> <input id="pageSize" name="pageSize" type="hidden" value="${page.pageSize}"/>
<ul class="ul-form"> <ul class="ul-form">
<li><label>所属集团:</label> <li><label>所属集团:</label>
<form:select id="supplementGroup" path="ctBbtcGroup" class="input-small required" onchange="getRegion()" cssStyle="width: 160px"> <form:select id="supplementGroup" path="ctBbtcGroup" class="input-small required" onchange="getType()" cssStyle="width: 160px">
<form:option value="">请选择</form:option> <form:option value="">请选择</form:option>
<form:options items="${fns:getDictList('supplement_group')}" itemLabel="label" itemValue="id" <form:options items="${fns:getDictList('supplement_group')}" itemLabel="label" itemValue="id"
htmlEscape="false"/> htmlEscape="false"/>
</form:select> </form:select>
</li> </li>
<li><label>所属区域:</label> <%-- <li><label>所属区域:</label>
<%-- <select id="supplementArea" path="supplementArea" class="input-small required" onchange="resetPageNo();"> &lt;%&ndash; <select id="supplementArea" path="supplementArea" class="input-small required" onchange="resetPageNo();">
<option value="">请选择</option> <option value="">请选择</option>
&lt;%&ndash;<options items="${ctBbtcRegionList}" itemLabel="name" itemValue="id"&ndash;%&gt; &lt;%&ndash;<options items="${ctBbtcRegionList}" itemLabel="name" itemValue="id"&ndash;%&gt;
&lt;%&ndash;htmlEscape="false"/></select>&ndash;%&gt; &lt;%&ndash;htmlEscape="false"/></select>&ndash;%&gt;
</select>--%> </select>&ndash;%&gt;
<form:select id="supplementArea" onchange="getType();" path="supplementArea" class="input-medium " cssStyle="width: 160px" htmlEscape="false"> <form:select id="supplementArea" onchange="getType();" path="supplementArea" class="input-medium " cssStyle="width: 160px" htmlEscape="false">
<form:option value="">请选择</form:option> <form:option value="">请选择</form:option>
</form:select> </form:select>
</li> </li>--%>
<li><label>业务类型:</label> <li><label>业务类型:</label>
<form:select id="supplementType" onchange="resetPageNo();" path="typeName" class="input-small required" cssStyle="width: 160px"> <form:select id="supplementType" onchange="resetPageNo();" path="typeName" class="input-small required" cssStyle="width: 160px">
<form:option value="">请选择</form:option> <form:option value="">请选择</form:option>
...@@ -142,7 +142,7 @@ ...@@ -142,7 +142,7 @@
<th>业务类别编码</th> <th>业务类别编码</th>
<th>业务类别名称</th> <th>业务类别名称</th>
<th>所属集团</th> <th>所属集团</th>
<th>所属区域</th> <%--<th>所属区域</th>--%>
<th>所属业务类型</th> <th>所属业务类型</th>
<shiro:hasPermission name="report:ctBbtcBusCategory:edit"><th>操作</th></shiro:hasPermission> <shiro:hasPermission name="report:ctBbtcBusCategory:edit"><th>操作</th></shiro:hasPermission>
</tr> </tr>
...@@ -165,9 +165,9 @@ ...@@ -165,9 +165,9 @@
<c:if test="${ctBbtcBusCategory.ctBbtcGroup eq '3770618512934949260'}">文旅集团</c:if>--%> <c:if test="${ctBbtcBusCategory.ctBbtcGroup eq '3770618512934949260'}">文旅集团</c:if>--%>
<c:if test="${ctBbtcBusCategory.ctBbtcGroup eq null}">--</c:if> <c:if test="${ctBbtcBusCategory.ctBbtcGroup eq null}">--</c:if>
</td> </td>
<td> <%--<td>
${ctBbtcBusCategory.supplementArea} ${ctBbtcBusCategory.supplementArea}
</td> </td>--%>
<td> <td>
${ctBbtcBusCategory.typeName} ${ctBbtcBusCategory.typeName}
</td> </td>
......
...@@ -137,7 +137,7 @@ ...@@ -137,7 +137,7 @@
<tr class="reportList"> <tr class="reportList">
<td><input type="checkbox" value="${report.id}"></td> <td><input type="checkbox" value="${report.id}"></td>
<td></td> <td></td>
<td>${report.supplementTitle}</td> <td> <a href="${ctx}/report/view?id=${report.id}">${report.supplementTitle}</a></td>
<td align="center"> <td align="center">
${report.supplementGroup} ${report.supplementGroup}
<%-- <c:if test="${user.supplementGroup eq '30590306011301372591'}">集团本部</c:if> <%-- <c:if test="${user.supplementGroup eq '30590306011301372591'}">集团本部</c:if>
......
...@@ -583,7 +583,7 @@ ...@@ -583,7 +583,7 @@
<c:forEach items="${page.list}" var="report" varStatus="vs"> <c:forEach items="${page.list}" var="report" varStatus="vs">
<tr class="reportList"> <tr class="reportList">
<td align="center" style="width:5%"></td> <td align="center" style="width:5%"></td>
<td align="left" style="width:15%" title= ${report.supplementTitle}>${report.supplementTitle}</td> <td align="left" style="width:15%" title= ${report.supplementTitle}> <a href="${ctx}/report/view?id=${report.id}">${report.supplementTitle}</a></td>
</c:forEach> </c:forEach>
</c:if> </c:if>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment