Commit 701c76c7 authored by suichenguang's avatar suichenguang

Merge remote-tracking branch 'origin/dev' into dev

# Conflicts:
#	src/main/java/com/yxproject/start/api/ReceiptApi.java
#	src/main/java/com/yxproject/start/service/impl/ReceiptServiceImpl.java
parents 2b0ed62f 014617c7
......@@ -31,11 +31,11 @@ public class ExportExcelApi {
List<Map<String, Object>> mapList = detailReceiptListService.selectPostDetails(replaceDate(date));
response.setContentType("application/x-download");
response.setCharacterEncoding("UTF-8");
String dateTime = DateFormatUtils.format(new Date(), "yyyyMMddHH");
String dateTime = DateFormatUtils.format(new Date(), "yyyy年MM月dd日");
// //使用Servlet实现文件下载的时候,避免浏览器自动打开文件
String fout = null;
fout = ExportExcel.exportExcelDate(mapList);
String outFile = dateTime + "myExcel";
String outFile = dateTime + "公安网数据";
try {
FileInputStream fis = new FileInputStream(new File(fout));
byte[] b = new byte[fis.available()];
......
......@@ -238,4 +238,43 @@ public class ReceiptApi {
return true;
}
/**
* 生成交接单
* @param receiptId
* @return
*/
@RequestMapping("updateReceiptDateByReceiptId")
public boolean updateReceiptDateByReceiptId(@RequestParam("receiptId")String receiptId){
try {
receiptService.updateReceiptDateByReceiptId(receiptId);
} catch (Exception e) {
e.printStackTrace();
}
return true;
}
/**
* 查询交接单
* @param date 复核时间
* @return
*/
@RequestMapping("queryReceiptDateByCheckDate")
public List<Map<String,Object>> queryReceiptDateByCheckDate(@RequestParam("date")String date){
return receiptService.selectReceiptDateByCheckDate(replaceDate(date));
}
/**
* 去除字符串中中线
*
* @param str
* @return
*/
private String replaceDate(String str) {
return str.replace("-", "");
}
}
......@@ -95,9 +95,11 @@ public interface ReceiptMapper {
"where id=#{receiptId}")
public boolean updateReceiptList(@Param("receiptId") String receiptId,@Param("checkName") String checkName,@Param("date") Date date);
//根据传入的交接单ID和复核人ID插入复核人、复核时间
@Update("update receipt_list set \n" +
"RECEIPT_DATE = sysdate \n" +
"where id=#{receiptId}")
public boolean updateReceiptDateByReceiptId(@Param("receiptId") String receiptId);
//根据输入id查询交接单是否生成
@Select("select count(*) from RECEIPT_LIST where QR_CODE=(select accept_no from prod_card_t@prod_link where id_no=#{id})")
......@@ -124,7 +126,16 @@ public interface ReceiptMapper {
"prod_trace_t.ELECTRIC_WRITE_DATE as electricDate\n" +
"from prod_trace_t@PROD_LINK \n" +
"WHERE subStr(ACCEPT_NO,0,8) = #{groupNo} or ACCEPT_NO=#{groupNo}")
public Map<String,Object>selectTimes(@Param("groupNo") String groupNo);
public Map<String,Object> selectTimes(@Param("groupNo") String groupNo);
@Select("select RECEIPT_LIST.id,RECEIPT_LIST.QR_CODE,RECEIPT_LIST.RECEIPT_DATE,RECEIPT_LIST.POLICE_CODE,c1.CARD_TYPE_ID,\n" +
"c2.CARD_TYPE_ID CARD_TYPE2,RECEIPT_LIST.FINISH_COUNT,GAJG_DM.GAJG_DM,GAJG_DM.GAJG_MC,RECEIPT_LIST.CHECK_DATE,RECEIPT_LIST.CHECK_NAME\n" +
",COUNTY_DIC.COUNTY_CODE ,COUNTY_DIC.COUNTYNAME from RECEIPT_LIST left join CARD_TYPE_DIC c1 on c1.CARD_TYPE_ID = RECEIPT_LIST.CARD_TYPE_ID\n" +
"left join CARD_TYPE_DIC c2 on c2.CARD_TYPE_ID = RECEIPT_LIST.CARD_TYPE_ID\n" +
"left join GAJG_DM on GAJG_DM.GAJG_DM = RECEIPT_LIST.POLICE_CODE\n" +
"left join COUNTY_DIC on substr(RECEIPT_LIST.POLICE_CODE,0,6) = COUNTY_DIC.COUNTY_CODE" +
" where to_char(CHECK_DATE,'yyyyMMdd') = #{date}")
public List<Map<String,Object>> selectReceiptDateByCheckDate(@Param("date") String date);
@Select("select * from DETAIL_RECEIPT_LIST where ACCEPT_NO=#{acceptNo} or card_id=#{acceptNo}")
......
......@@ -31,6 +31,10 @@ public interface ReceiptService {
public boolean updateReceiptList(String receiptId, String checkName, Date date);
public boolean updateReceiptDateByReceiptId(String receiptId);
public List<Map<String,Object>> selectReceiptDateByCheckDate(String date);
public int selectCount(String GROUP_NO);
public boolean updateFinishCount(String GROUP_NO,int count);
......
......@@ -6,9 +6,7 @@ import com.yxproject.start.service.ReceiptService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.Date;
import java.util.List;
import java.util.Map;
import java.util.*;
@Service
public class ReceiptServiceImpl implements ReceiptService {
......@@ -82,6 +80,11 @@ public class ReceiptServiceImpl implements ReceiptService {
receiptMapper.updateReceiptList(receiptId, checkName, date);
return true;
}
@Override
public boolean updateReceiptDateByReceiptId(String receiptId) {
receiptMapper.updateReceiptDateByReceiptId(receiptId);
return true;
}
@Override
public int selectCount(String GROUP_NO) {
......@@ -142,4 +145,92 @@ public class ReceiptServiceImpl implements ReceiptService {
receiptMapper.updateDetail(accept,note);
return false;
}
@Override
public List<Map<String, Object>> selectReceiptDateByCheckDate(String date) {
List<Map<String, Object>> mapList = receiptMapper.selectReceiptDateByCheckDate(date);
List<Map<String, Object>> mapList1 = formateMap(mapList);
return mapList1;
}
private List<Map<String,Object>> formateMap(List<Map<String, Object>> mapList){
Map<String,Object> objectMap = new LinkedHashMap<>();
for (Map<String,Object> map :mapList){
if (objectMap!=null&&objectMap.containsKey(map.get("COUNTY_CODE")+"")){
List<Map<String,Object>> maps = (List<Map<String,Object>>) objectMap.get(map.get("COUNTY_CODE")+"");
maps.add(map);
objectMap.put(map.get("COUNTY_CODE")+"",maps);
}else {
List<Map<String,Object>> maps = new ArrayList<>();
maps.add(map);
objectMap.put(map.get("COUNTY_CODE")+"",maps);
}
}
List<Map<String,Object>> countyMapList = new ArrayList<>();
for (String countyCode:objectMap.keySet()){
Map<String,Object> countyMap = new LinkedHashMap<>();
String countyName =null;
List<Map<String,Object>> policeMapList = new ArrayList<>();
List<Map<String,Object>> maps = (List<Map<String,Object>>) objectMap.get(countyCode);
Map<String,Object> policeMap = new LinkedHashMap<>();
for (Map<String,Object> map :maps){
countyName = map.get("COUNTYNAME")+"";
if (policeMap != null&&policeMap.containsKey(map.get("POLICE_CODE")+"")){
List<Map<String,Object>> policeMapList2= (List<Map<String,Object>>) policeMap.get(map.get("POLICE_CODE")+"");
policeMapList2.add(map);
policeMap.put(map.get("POLICE_CODE")+"",policeMapList2);
}else {
List<Map<String,Object>> policeMapList2= new ArrayList<>();
policeMapList2.add(map);
policeMap.put(map.get("POLICE_CODE")+"",policeMapList2);
}
}
for (String policeCode : policeMap.keySet()){
List<Map<String,Object>> policeList= (List<Map<String,Object>>) policeMap.get(policeCode);
Map<String,Object> policemap = new LinkedHashMap<>();
String GAJG_MC = null;
String CHECK_DATE =null;
String CHECK_NAME =null;
int youSum =0;
int puSum =0;
for (Map<String,Object> map :policeList){
GAJG_MC =map.get("GAJG_MC")+"";
CHECK_DATE =map.get("CHECK_DATE")+"";
CHECK_NAME =map.get("CHECK_NAME")+"";
if ("null".equals(map.get("CARD_TYPE2"))){
if ("9".equals(map.get("CARD_TYPE_ID")+"")){
youSum+=Integer.parseInt(map.get("FINISH_COUNT")+"");
}else {
puSum+=Integer.parseInt(map.get("FINISH_COUNT")+"");
}
}else {
if ("9".equals(map.get("CARD_TYPE2")+"")){
youSum+=Integer.parseInt(map.get("FINISH_COUNT")+"");
}else {
puSum+=Integer.parseInt(map.get("FINISH_COUNT")+"");
}
}
}
policemap.put("youSum",youSum);
policemap.put("puSum",puSum);
policemap.put("checkName",CHECK_NAME);
policemap.put("checkDate",CHECK_DATE);
policemap.put("policeName",GAJG_MC);
policemap.put("policeCode",policeCode);
policeMapList.add(policemap);
}
countyMap.put("policeList",policeMapList);
countyMap.put("countyName",countyName);
countyMap.put("countyCode",countyCode);
countyMapList.add(countyMap);
}
return countyMapList;
}
}
......@@ -334,6 +334,18 @@ angular.module('AvatarCheck.http', ['ngDialog', 'LocalStorageModule'])
success(response.data)
})
},
updateReceiptList:function(id,success) {
$http({
method: 'GET',
url: "../LogApi/selectNewFileLogCount"+urlTimeStamp(),
params:{
receiptId:id,
checkName:$rootScope.loginData.name
}
}).then(function successCallback(response) {
success(response.data)
})
},
selectAnalyseLogCount:function (oldPackageName,date,success) {
if(angular.isUndefined(oldPackageName)){
oldPackageName='';
......
......@@ -110,7 +110,7 @@
</table>
<div class="box-footer clearfix" style="border: 0;">
<button class="btn btn-success pull-right" style="margin-right: 20px;" ng-click="checkSame(json.id)">复核一致</button>
<button class="btn btn-info pull-right" style="margin-right: 20px;">打印标签</button>
<button class="btn btn-info pull-right" style="margin-right: 20px;" ng-click="PreviewMytableRotate()">打印标签</button>
</div>
</div>
<h4 class="col-md-7" ng-if="json.policeCardsList.length==0">
......@@ -120,3 +120,15 @@
</div>
</div>
</section>
<div style="display: none;">
<div id="div1">
<p>
<object id="LODOP_OB" classid="clsid:2105C259-1E0C-4534-8141-A753534CB4CA" width=0 height=0>
<embed id="LODOP_EM" type="application/x-print-lodop" width=0 height=0 pluginspage="install_lodop32.exe"></embed>
</object>
</p>
<div style="font-family:'黑体';height:7mm;position: absolute;top:5mm;left:5mm;">密云分局</div>
<div style="font-family:'黑体';height:7mm;position: absolute;top:12mm;left:3mm;">河南寨派出所</div>
<div style="font-family:'黑体';height:7mm;position: absolute;top:20mm;left:5mm;">数量:1张</div>
</div>
</div>
\ No newline at end of file
......@@ -61,9 +61,31 @@ angular.module('AvatarCheck.tagPrint', ['ngRoute', 'AvatarCheck.http', 'tm.pagin
})
}
$scope.checkSame = function () {
$scope.checkSame = function (id) {
HttpService.updateReceiptList(id,function(data) {
if(data){
getPoliceListDataNotChecked();
}else {
MessageService.showAlert("复核失败")
}
})
}
$scope.PreviewMytableRotate = function(){
var LODOP = getLodop();
LODOP.SET_LICENSES("", "15F0BE661E7F32F37491843CB2510905", "C94CEE276DB2187AE6B65D56B3FC2848", "");
LODOP.SET_PRINT_STYLE("FontName", "黑体");
LODOP.PRINT_INIT("标签");
LODOP.SET_PRINT_PAGESIZE(1, "70mm", "40mm", "");
LODOP = getLodop(document.getElementById('LODOP1'), document.getElementById('LODOP_EM'));
LODOP.SET_PRINT_STYLE("FontName", "黑体");
LODOP.ADD_PRINT_BARCODE(7, 20, 242, 60, "128A", "E1006155001");
LODOP.ADD_PRINT_HTM(60, 80, 300, 300, document.getElementById("div1").innerHTML);
LODOP.SET_PRINT_STYLEA(0, "AngleOfPageInside", 0);
LODOP.PREVIEW();
// LODOP.PRINT();
};
});
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