Commit f2ebd625 by wuchengwu

质量抽查任务:任务新建以及抽样对象生成

parent 799336e8
......@@ -25,6 +25,8 @@ public interface AfisQualityCcrwDao extends MyMapper<AfisQualityCcrw> {
public List<AfisQualityCcrw> getAfisQualityCcrw(Map<String, Object> map);
public List<AfisQualityCcrw> getAfisQualityCcrwlbxq(Map<String, Object> map);
public List<AfisQualityCcrw> getAfisQualityCcrwByRwbh(Map<String, Object> map);
public boolean insertCcrw(Map<String, Object> map);
......
package com.founder.dao;
import com.founder.model.AfisQualityCk;
import com.founder.model.AfisQualityDto;
import com.founder.util.MyMapper;
import org.springframework.stereotype.Component;
......@@ -51,4 +52,17 @@ public interface AfisQualityCkDao extends MyMapper<AfisQualityCk> {
public List<AfisQualityCk> queryZlccWcPageList(Map<String, Object> map);
public List<AfisQualityCk> queryZlccDwList(Map<String, Object> map);
public List<AfisQualityDto> queryZlccjcPageList(Map<String, Object> map);
/***************************抽查任务导出*******************************************/
/**
* 抽查任务下的单位
* @param map
* @return
*/
public List<AfisQualityDto> queryZlccRwDwList(Map<String, Object> map);
public List<AfisQualityDto> queryCcrwtjList(Map<String, Object> map);
/*********************************************************************/
}
......@@ -19,6 +19,7 @@ public class AfisQualityCcrw implements Serializable {
private Date ccsjJzsj; //抽查时间截止时间
private String ccsjJzsjStr; //抽查时间截止时间
private String ccdw; //抽查单位
private String ccdwStr; //抽查单位名称
private String ccfs; //抽查份数
private String jcfs; //已检查份数
private String cjdwdm; //创建单位
......@@ -30,6 +31,14 @@ public class AfisQualityCcrw implements Serializable {
private String gxr; //修改人
private Date gxsj; //修改时间
public String getCcdwStr() {
return ccdwStr;
}
public void setCcdwStr(String ccdwStr) {
this.ccdwStr = ccdwStr;
}
public String getXxbh() {
return xxbh;
}
......
......@@ -9,10 +9,12 @@ import java.util.List;
public interface AfisQualityCcrwService extends IService<AfisQualityCcrw> {
public EasyUIPage queryZlccrwPage(EasyUIPage page, AfisQualityCcrw entity,String ifwc);
public EasyUIPage queryZlccrwPage(EasyUIPage page, AfisQualityCcrw entity,String ifwc,String pid);
public AfisQualityCcrw getAfisQualityCcrw(String xxbh);
public AfisQualityCcrw getAfisQualityCcrwlbxq(String xxbh,String rwbh,String sfdrw);
public AfisQualityCcrw getAfisQualityCcrwByRwbh(String rwbh);
public boolean insertCcrw(AfisQualityCcrw entity);
......
package com.founder.service;
import com.founder.model.AfisQualityCk;
import com.founder.model.AfisQualityDto;
import com.founder.model.User;
import com.founder.utils.EasyUIPage;
......@@ -19,11 +20,30 @@ public interface AfisQualityService extends IService<AfisQualityCk> {
public EasyUIPage queryZljcPage(EasyUIPage page, AfisQualityCk entity);
public EasyUIPage queryZlccPage(EasyUIPage page, AfisQualityCk entity,int ccfs,String rwbh,String flg);
public EasyUIPage queryZlccPage(EasyUIPage page, AfisQualityCk entity,int ccfs,String rwbh,String flg,int jcfs);
public List<AfisQualityCk> queryZljcList(AfisQualityCk entity);
public List<AfisQualityCk> queryZlccList(AfisQualityCk entity,String rwbh);
public List<AfisQualityDto> queryZlccList(AfisQualityCk entity, String rwbh);
public EasyUIPage queryZlccjcPage(EasyUIPage page, AfisQualityCk entity,String sfdrw, String ccdw,String ssdw);
/**
* 质量抽查详情导出
* @param entity
* @param sfdrw
* @return
*/
public List<AfisQualityDto> getCcdwData( AfisQualityCk entity,String sfdrw,String ccdw);
/**
* 获取抽查任务单位
* @param entity
* @param sfdrw
* @return
*/
public List<AfisQualityDto> queryZlccRwDwList( AfisQualityCk entity,String sfdrw);
/**
* 指纹质量检查保存函数
* @param afisQualityCk
......
package com.founder.service.impl;
import com.founder.dao.AfisQualityCcrwDao;
import com.founder.dao.IDictitemDao;
import com.founder.model.AfisQualityCcrw;
import com.founder.model.SysDictitem;
import com.founder.service.AfisQualityCcrwService;
import com.founder.utils.EasyUIPage;
import org.slf4j.Logger;
......@@ -10,6 +12,7 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.util.StringUtils;
import javax.annotation.Resource;
import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
......@@ -25,8 +28,11 @@ public class AfisQualityCcrwServiceImpl extends BaseService<AfisQualityCcrw> imp
@Autowired
private AfisQualityCcrwDao mapper;
@Resource
private IDictitemDao dictitemDao;
@Override
public EasyUIPage queryZlccrwPage(EasyUIPage page, AfisQualityCcrw entity,String ifwc) {
public EasyUIPage queryZlccrwPage(EasyUIPage page, AfisQualityCcrw entity,String ifwc,String pid) {
Map<String, Object> map = new HashMap<>();
map.put("begin", page.getBegin());
map.put("end", page.getEnd());
......@@ -39,6 +45,10 @@ public class AfisQualityCcrwServiceImpl extends BaseService<AfisQualityCcrw> imp
map.put("sort", sort);
map.put("order", order);
map.put("entity", entity);
//添加字典查询条件
map.put("code","CODE_SXDWCC");
map.put("pid",pid);
List<SysDictitem> dictitemList = dictitemDao.queryDictByPid(map);
if(entity!=null&&entity.getRwbh()!=null&&!"".equals(entity.getRwbh())){
page.setTotal(mapper.queryZlccrwByRwbhPageCount(map));
}else {
......@@ -73,6 +83,20 @@ public class AfisQualityCcrwServiceImpl extends BaseService<AfisQualityCcrw> imp
}else{
afisQualityCks.get(i).setCcsjJzsjStr("");
}
if(afisQualityCks.get(i).getCcdw() != null){
String ccdwStr ="";
String[] words = afisQualityCks.get(i).getCcdw() .split(",");
for (SysDictitem dict:dictitemList ) {
for (int s=0;s<words.length;s++){
if(dict.getCode().substring(0,6).equals(words[s])){
ccdwStr += ","+dict.getName();
}
}
}
if(ccdwStr != null && ccdwStr !="") {
afisQualityCks.get(i).setCcdw(ccdwStr.substring(1));
}
}
}
page.setRows(afisQualityCks);
......@@ -104,6 +128,31 @@ public class AfisQualityCcrwServiceImpl extends BaseService<AfisQualityCcrw> imp
}
@Override
public AfisQualityCcrw getAfisQualityCcrwlbxq(String xxbh, String rwbh,String sfdrw) {
AfisQualityCcrw xyrC = new AfisQualityCcrw();
Map map = new HashMap();
map.put("xxbh", xxbh);
map.put("rwbh", rwbh);
map.put("sfdrw", sfdrw);
List<AfisQualityCcrw> xyrCs = mapper.getAfisQualityCcrwlbxq(map);
if ((xyrCs != null) && (xyrCs.size() > 0)) {
xyrC = xyrCs.get(0);
DateFormat df = new SimpleDateFormat("yyyy-MM-dd");
if(xyrC.getCcsjQssj()!=null&&!"".equals(xyrC.getCcsjQssj())){
xyrC.setCcsjQssjStr(df.format(xyrC.getCcsjQssj()));
}else{
xyrC.setCcsjQssjStr("");
}
if(xyrC.getCcsjJzsj()!=null&&!"".equals(xyrC.getCcsjJzsj())){
xyrC.setCcsjJzsjStr(df.format(xyrC.getCcsjJzsj()));
}else{
xyrC.setCcsjJzsjStr("");
}
}
return xyrC;
}
@Override
public AfisQualityCcrw getAfisQualityCcrwByRwbh(String rwbh)
{
AfisQualityCcrw xyrC = new AfisQualityCcrw();
......
......@@ -17,7 +17,7 @@
<sql id="queryWhere">
<if test="entity.xxbh != null and entity.xxbh != ''"> AND XXBH = #{entity.xxbh , jdbcType=VARCHAR } </if>
<if test="entity.rwbh != null and entity.rwbh != ''"> AND RWBH = #{entity.rwbh , jdbcType=VARCHAR } </if>
<if test="entity.ccdw != null and entity.ccdw != ''"> AND CCDW = #{entity.ccdw , jdbcType=VARCHAR } </if>
<if test="entity.ccdw != null and entity.ccdw != ''"> AND CCDW = #{entity.ccdw , jdbcType=VARCHAR }</if>
<if test="entity.cjdwdm != null and entity.cjdwdm != ''"> AND CJDWDM = #{entity.cjdwdm , jdbcType=VARCHAR } </if>
<if test="entity.ccsjQssjStr != null and entity.ccsjQssjStr != ''"> AND cjsj <![CDATA[>=]]> to_date(#{entity.ccsjQssjStr , jdbcType=VARCHAR },'yyyy-mm-dd') </if>
<if test="entity.ccsjJzsjStr != null and entity.ccsjJzsjStr != ''"> AND cjsj <![CDATA[<]]> to_date(#{entity.ccsjJzsjStr , jdbcType=VARCHAR },'yyyy-mm-dd')+1 </if>
......@@ -114,6 +114,7 @@
A.XXBH as xxbh,
A.RWBH as rwbh,
A.CCDW as ccdw,
(select name from sys_dictitem s where s.groupid='CODE_SXDWCC' and SUBSTR(s.code,0, 6) = A.CCDW) as ccdwStr ,
A.CCSJ_QSSJ as ccsjQssj,
A.CCSJ_JZSJ as ccsjJzsj,
A.CCFS as ccfs,
......@@ -128,6 +129,49 @@
and A.XXBH = #{xxbh , jdbcType=VARCHAR }
</select>
<!-- 质量抽查多任务列表 -->
<select id="getAfisQualityCcrwlbxq" resultType="com.founder.model.AfisQualityCcrw" parameterType="map">
SELECT
A.XXBH AS xxbh,
A.RWBH AS rwbh,
A.CCDW AS ccdw,
( SELECT name FROM sys_dictitem s WHERE s.groupid = 'CODE_SXDWCC' AND SUBSTR( s.code, 0, 6 ) = A.CCDW ) AS ccdwStr,
A.CCSJ_QSSJ AS ccsjQssj,
A.CCSJ_JZSJ AS ccsjJzsj,
<if test=" sfdrw == 'true'">
cs.CCFS AS ccfs,
cs.JCFS AS jcfs,
</if>
<if test="sfdrw == 'false'">
A.CCFS AS ccfs,
A.JCFS AS jcfs,
</if>
A.CJDWDM AS cjdwdm,
A.CJR AS cjr,
A.BZ AS bz,
A.RWBZ AS rwbz,
A.CJSJ AS cjsj
FROM
<if test=" sfdrw == 'true'">
(
SELECT
sum( A.jcfs ) AS jcfs,
SUM( A.ccfs ) AS ccfs,
rwbh
FROM
AFIS_QUALITY_CCRW A
WHERE
A.rwbh = #{rwbh , jdbcType=VARCHAR }
AND A.SCBZ = '0'
GROUP BY
rwbh
) cs,
</if>
AFIS_QUALITY_CCRW A
WHERE A.SCBZ = '0'
and A.XXBH = #{xxbh , jdbcType=VARCHAR }
</select>
<select id="getAfisQualityCcrwByRwbh" resultType="com.founder.model.AfisQualityCcrw" parameterType="map">
select
A.XXBH as xxbh,
......@@ -208,7 +252,7 @@
where SCBZ = '0'
<if test="entity.xxbh != null and entity.xxbh != ''"> AND XXBH = #{entity.xxbh , jdbcType=VARCHAR } </if>
<if test="entity.rwbh != null and entity.rwbh != ''"> AND RWBH = #{entity.rwbh , jdbcType=VARCHAR } </if>
<if test="entity.rwbh == null or entity.rwbh == ''"> AND RWBH ='' </if>
<!-- <if test="entity.rwbh == null or entity.rwbh == ''"> AND RWBH ='' </if>-->
</update>
</mapper>
\ No newline at end of file
......@@ -24,6 +24,8 @@
</head>
<body style="overflow: auto">
<input type="hidden" id="unitcode" name="unitcode" th:value="${unitcode}"/>
<header class="heade-box">
<img src="static/xtba/zlcc/img/title_ccrwgl.png" class="header-title-img" alt="">
</header>
......@@ -79,6 +81,19 @@
//pageNumber : 1 //显示在第几页
});
// 调用子页面方法
var frame = document.getElementById("f1");
function chuandicanshu(){
var unitcode = $('#unitcode').val();
frame.onload = function(){
frame.contentWindow.unitcode(unitcode);
}
// .contentWindow.unitcode(unitcode);
}
$(function () {
chuandicanshu()
});
//新建弹框
function newDialog(){
var dialogId='new';
......
......@@ -56,13 +56,13 @@
<td class="ar" width="13.3%">任务对象:</td>
<td width="20%">
<span class="textbox" style="font-size: 14px;">
<select name="ccdw" style="height: 33px;width: 100%;font-size: 14px;">
<option value=""></option>
<option value="4601">海口市公安局</option>
<option value="4602">三亚市公安局</option>
<option value="4603">洋浦经济开发区公安局</option>
<option value="4604">三沙市公安局</option>
<option value="4605">海口铁路公安处</option>
<select name="lrdwdm" id="lrdwdm" style="height: 34px;width: 100%;font-size: 14px;">
<!-- <option value=""></option>-->
<!-- <option value="4601">海口市公安局</option>-->
<!-- <option value="4602">三亚市公安局</option>-->
<!-- <option value="4603">洋浦经济开发区公安局</option>-->
<!-- <option value="4604">三沙市公安局</option>-->
<!-- <option value="4605">海口铁路公安处</option>-->
</select>
</span>
</td>
......@@ -71,7 +71,8 @@
<td colspan="6">
<div style="width: 100%; float: left; text-align: center;height: 44px;line-height: 44px;">
<a class="btn_a btn_search" onclick="doQuery()">查询</a>
<a class="btn_a btn_empty" onclick="newDialog()">新建</a>
<button type="reset" class="btn_a btn_empty">重 置</button>
<!-- <a class="btn_a btn_add" onclick="newDialog()">新建</a>-->
</div>
</td>
</tr>
......@@ -141,11 +142,8 @@
var xxbh=row.xxbh;
var rwbh=row.rwbh;
var ccdw=row.ccdw;
var ccfs=row.ccfs;
var jcfs=row.jcfs;
var ccsjQssjStr=row.ccsjQssjStr;
var ccsjJzsjStr=row.ccsjJzsjStr;
return "<a href='javascript:void(0)' onclick='zlcc(\"" + xxbh + "\",\"3\")'>"+rwbh+"</a>";;
var sfdrw= (ccdw.indexOf(',') >= 0);
return "<a href='javascript:void(0)' onclick='zlcc(\"" + xxbh + "\",\"3\",\"" + rwbh + "\",\"" + sfdrw + "\")'>"+rwbh+"</a>";;
}},
{title:"任务时间",field:"ccsjQssjStr",align:'center',width:285,formatter:function(val,row,index){
var ccsjQssjStr=row.ccsjQssjStr;
......@@ -160,26 +158,7 @@
}
return ccsjQssjStr+" 至 "+ccsjJzsjStr;
}},
{title:"任务对象",field:"ccdw",align:'center',width:175,formatter:function(val,row,index){
var ccdw=row.ccdw;
var rstStr="";
if(ccdw.indexOf('4601') >= 0){
rstStr += "<br>海口市公安局";
}
if(ccdw.indexOf('4602') >= 0){
rstStr += "<br>三亚市公安局";
}
if(ccdw.indexOf('4603') >= 0){
rstStr += "<br>洋浦经济开发区公安局";
}
if(ccdw.indexOf('4604') >= 0){
rstStr += "<br>三沙市公安局";
}
if(ccdw.indexOf('4605') >= 0){
rstStr += "<br>海口铁路公安处";
}
return rstStr.substring(4);
}},
{title:"任务对象",field:"ccdw",align:'center',width:175},
{title:"任务进度",field:"ccfs",align:'center',width:180,formatter:function(val,row,index){
var ccfs=row.ccfs;
var jcfs=row.jcfs;
......@@ -242,10 +221,45 @@
return o;
}
/**
* 数据字典获取系统类型
*/
function rwdw() {
var dicType = "CODE_SXDWCC";
$.ajax({
url: "/queryDictByPid?code=" + dicType,
type: "GET",
success: function (data) {
if (data) {
initSelect(data);
} else {
$.messager.alert( '提示',"字典获取失败!");
}
}
});
// ajax.start();
}
function initSelect (data) {
$("select[name='lrdwdm']").html("<option value=''>请选择</option>");
for (var i = 0; i < data.length; i++) {
// if(major==data[i].VALUE){
// $("select[name='anyScript']").append(
// "<option value='" + data[i].VALUE + "' selected>"
// + data[i].LABEL + "</option>");
// }else {
$("select[name='lrdwdm']").append(
"<option value='" + data[i].code + "'>"
+ data[i].name + "</option>");
// }
}
// form.render();
}
function doClear(){
$("form[name='zlccrwForm']") .find("input").val('');
}
$(function(){
rwdw();
doQuery();
});
//新建弹框
......@@ -258,7 +272,7 @@
id:dialogId,
url:'xj',
title:'新建',
width:600,
width:700,
height:300,
cache:false,
onClose:function(){
......@@ -269,22 +283,39 @@
//确定生成表头配置信息,并重新加载表格数据
text:'保存',
handler:function(){
var ccdw = $('#ccdw').val();
var ccsjQssjStr = $('#ccsjQssjStr').val();
var ccsjJzsjStr = $('#ccsjJzsjStr').val();
var ccfs = $('#ccfs').val();
var flag = false;
if(ccdw ==null || ccdw =='' || ccsjQssjStr ==null || ccsjQssjStr ==''||ccsjJzsjStr ==null || ccsjJzsjStr =='' || ccfs ==null || ccfs ==''){
$.messager.alert('提示',"带*号必填项不能为空!")
}else if (ccdw !=null && ccdw !='' && ccsjQssjStr !=null && ccsjQssjStr !=''&&ccsjJzsjStr !=null
&& ccsjJzsjStr !='' && ccfs !=null && ccfs !=''){
flag = true;
}
if(flag) {
$.ajax({
url:"doAddOrUpdateCcrw?xxbh="+$('#xxbh').val()+"&ccdw="+$('#ccdw').val()+"&fccsj="+$('#ccsjQssjStr').val()+"&eccsj="+$('#ccsjJzsjStr').val()+"&ccfs="+$('#ccfs').val(),
type:"POST",
success:function(data){
if(data){
$.messager.alert( '提示',"任务信息保存成功!");
url: "doAddOrUpdateCcrw?xxbh=" + $('#xxbh').val() + "&ccdw=" + $('#ccdw').val() + "&fccsj=" + $('#ccsjQssjStr').val() + "&eccsj=" + $('#ccsjJzsjStr').val() + "&ccfs=" + $('#ccfs').val(),
type: "POST",
success: function (data) {
$('#ccdw').val('');
$('#ccsjQssjStr').val('');
$('#ccsjJzsjStr').val('');
$('#ccfs').val('');
if (data) {
$.messager.alert('提示', "任务信息保存成功!");
doQuery();
$('#new').dialog('close');
}else{
$.messager.alert( '提示',"任务信息保存失败!");
} else {
$.messager.alert('提示', "任务信息保存失败!");
doQuery();
$('#new').dialog('close');
}
}
});
}
}
},{
text:'取消',
handler:function(){
......@@ -294,8 +325,8 @@
])
}
function zlcc(xxbh,flg){
window.open("/toZlccList?rwbh="+xxbh+"&flg="+flg,'_blank');
function zlcc(xxbh,flg,rwbh,sfdrw){
window.open("/toZlccList?xxbh="+xxbh+"&flg="+flg+"&rwbh="+rwbh+"&sfdrw="+sfdrw,'_blank');
}
function rwxq(){
......
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